1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-30 15:06:06 +00:00

Races+SubRaces

This commit is contained in:
Yan Maniez 2020-03-01 00:27:51 +01:00
parent 2e0dc12243
commit e845cf7c7f
3 changed files with 105 additions and 14 deletions

View file

@ -92,3 +92,29 @@ Future<Item> loadChildrenItems(Item item, List<Filter> filters) async {
return item;
}
Future<List<RaceItem>> loadRaces() async {
final db = await database;
var response = await db.query(
"Items",
where: "ItemType = 'RaceItem'",
orderBy: "NormalizedName"
);
if (response.isNotEmpty) {
return itemsFromMapList(response);
}
return null;
}
Future<List<SubRaceItem>> loadSubRaces(RaceItem race) async {
final db = await database;
var response = await db.query(
"Items",
where: "ItemType = 'SubRaceItem' AND ParentLink = ?",
whereArgs: [race.id],
orderBy: "NormalizedName"
);
if (response.isNotEmpty) {
return itemsFromMapList(response);
}
return null;
}