Update the helper

This commit is contained in:
zontreck 2025-03-26 01:20:46 -07:00
parent cef613c265
commit fb2651facf
2 changed files with 62 additions and 18 deletions

View file

@ -1,3 +1,11 @@
# NOTE
Current highest implemented generation: **Three**
**This file is automatically generated**
# About
This file is a checklist of what Pokemon are up to date with the implemented generations.
# Generation One

View file

@ -95,6 +95,16 @@ class _main extends State<MainGen> {
setState(() {});
} else if (state == 4) {
maxTasks += Pokemon.values.length;
sb = StringBuilder();
sb.append("# NOTE\n");
sb.append(
"\nCurrent highest implemented generation: **${gen.name}**",
);
sb.append("\n**This file is automatically generated**\n\n");
sb.append("# About\n\n");
sb.append(
"This file is a checklist of what Pokemon are up to date with the implemented generations.\n",
);
state++;
setState(() {});
} else if ((state - index) == 5) {
@ -118,21 +128,41 @@ class _main extends State<MainGen> {
statusMessage =
("- Analysis of pokemon ${pokemon.pokemonName} has begun");
// TODO : This needs to check locations and dex entries to see if they are up to date with the latest generation.
// The future task should take into account the generation the pokemon was introduced in. (EX. If introduced in gen 2, it won't have data entries for gen 1).
bool upToDate = false;
for (var loc in pokemon.locations) {
if (loc.gameGen.index >= gen.index) {
upToDate = true;
}
}
bool dexUpToDate = false;
for (var dex in pokemon.dexEntries) {
if (dex.gameGen.index >= gen.index) {
upToDate = true;
}
}
if (pokemon.locations.isEmpty && pokemon.dexEntries.isEmpty) {
sb.append("- [ ] ${pokemon.pokemonName}\n");
} else {
if (pokemon.locations.isNotEmpty && pokemon.dexEntries.isNotEmpty) {
if (upToDate || dexUpToDate) {
if (pokemon.locations.isNotEmpty &&
pokemon.dexEntries.isNotEmpty) {
sb.append("- [x] ${pokemon.pokemonName}\n");
} else if (pokemon.locations.isNotEmpty) {
sb.append("- [ ] ${pokemon.pokemonName} (MISSING DEX ENTRIES)\n");
sb.append(
"- [ ] ${pokemon.pokemonName} (MISSING DEX ENTRIES)\n",
);
} else if (pokemon.dexEntries.isNotEmpty) {
sb.append(
"- [ ] ${pokemon.pokemonName} (MISSING LOCATION ENTRIES)\n",
);
}
} else {
sb.append("- [ ] ${pokemon.pokemonName} (OUT OF DATE DATA)\n");
}
}
index++;
progress = progress / 100; // push it into a 0-1 range.
@ -170,15 +200,21 @@ class _main extends State<MainGen> {
title: Text("Data Generator"),
backgroundColor: LibACFlutterConstants.TITLEBAR_COLOR,
),
body: Column(
body: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Status: ${statusMessage}", style: TextStyle(fontSize: 24)),
Text("Progress: ${progress * 100}%", style: TextStyle(fontSize: 24)),
Text(
"Progress: ${progress * 100}%",
style: TextStyle(fontSize: 24),
),
Text("Task ${state}/${maxTasks}", style: TextStyle(fontSize: 24)),
LinearProgressIndicator(value: progress, minHeight: 30),
],
),
),
);
}
}