👔 Update level requirements
This commit is contained in:
parent
c21ca5573c
commit
0f2b854e45
@ -4,19 +4,19 @@ import 'package:intl/intl.dart';
|
|||||||
class ExperienceProvider extends GetxController {
|
class ExperienceProvider extends GetxController {
|
||||||
static List<int> experienceToLevelRequirements = [
|
static List<int> experienceToLevelRequirements = [
|
||||||
0, // Level 0
|
0, // Level 0
|
||||||
100, // Level 1
|
1000, // Level 1
|
||||||
400, // Level 2
|
4000, // Level 2
|
||||||
900, // Level 3
|
9000, // Level 3
|
||||||
1600, // Level 4
|
16000, // Level 4
|
||||||
2500, // Level 5
|
25000, // Level 5
|
||||||
3600, // Level 6
|
36000, // Level 6
|
||||||
4900, // Level 7
|
49000, // Level 7
|
||||||
6400, // Level 8
|
64000, // Level 8
|
||||||
8100, // Level 9
|
81000, // Level 9
|
||||||
10000, // Level 10
|
100000, // Level 10
|
||||||
12100, // Level 11
|
121000, // Level 11
|
||||||
14400, // Level 12
|
144000, // Level 12
|
||||||
36800 // Level 13
|
368000 // Level 13
|
||||||
];
|
];
|
||||||
|
|
||||||
static List<String> levelLabelMapping =
|
static List<String> levelLabelMapping =
|
||||||
@ -35,7 +35,7 @@ class ExperienceProvider extends GetxController {
|
|||||||
final idx = experienceToLevelRequirements.indexOf(exp);
|
final idx = experienceToLevelRequirements.indexOf(exp);
|
||||||
if (idx + 1 >= experienceToLevelRequirements.length) return 1;
|
if (idx + 1 >= experienceToLevelRequirements.length) return 1;
|
||||||
final nextExp = experienceToLevelRequirements[idx + 1];
|
final nextExp = experienceToLevelRequirements[idx + 1];
|
||||||
return exp / nextExp;
|
return (experience - exp).abs() / (exp - nextExp).abs();
|
||||||
}
|
}
|
||||||
|
|
||||||
static String calcLevelUpProgressLevel(int experience) {
|
static String calcLevelUpProgressLevel(int experience) {
|
||||||
@ -43,9 +43,9 @@ class ExperienceProvider extends GetxController {
|
|||||||
.firstWhere((x) => x <= experience);
|
.firstWhere((x) => x <= experience);
|
||||||
final idx = experienceToLevelRequirements.indexOf(exp);
|
final idx = experienceToLevelRequirements.indexOf(exp);
|
||||||
if (idx + 1 >= experienceToLevelRequirements.length) return 'Infinity';
|
if (idx + 1 >= experienceToLevelRequirements.length) return 'Infinity';
|
||||||
final nextExp = experienceToLevelRequirements[idx + 1];
|
final nextExp = exp - experienceToLevelRequirements[idx + 1];
|
||||||
final formatter =
|
final formatter =
|
||||||
NumberFormat.compactCurrency(symbol: '', decimalDigits: 1);
|
NumberFormat.compactCurrency(symbol: '', decimalDigits: 1);
|
||||||
return '${formatter.format(exp)}/${formatter.format(nextExp)}';
|
return '${formatter.format((exp - experience).abs())}/${formatter.format(nextExp.abs())}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user