mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 06:26:02 +00:00
Renommage colonnes
This commit is contained in:
parent
d4d9f8017b
commit
0d81ea6799
3 changed files with 12 additions and 12 deletions
Binary file not shown.
|
|
@ -49,18 +49,18 @@ Future<Item> getItemWithId(String id) async {
|
|||
}
|
||||
|
||||
Future<Item> loadChildrenItems(Item item) async {
|
||||
print("getChildrenItems " + item.Discriminator);
|
||||
if (item.Discriminator.endsWith("Items")) {
|
||||
String discriminator =
|
||||
item.Discriminator.substring(0, item.Discriminator.length - 1);
|
||||
print("getChildrenItems " + item.ItemType);
|
||||
if (item.ItemType.endsWith("Items")) {
|
||||
String itemType =
|
||||
item.ItemType.substring(0, item.ItemType.length - 1);
|
||||
String family = "";
|
||||
if (item is MonsterItems) {
|
||||
family = (item as MonsterItems)?.Family ?? "";
|
||||
}
|
||||
final db = await database;
|
||||
var response = await db
|
||||
.query("Items", where: "Discriminator = ? AND MonsterItem_Family = ?",
|
||||
whereArgs: [discriminator, family],
|
||||
.query("Items", where: "ItemType = ? AND Family = ?",
|
||||
whereArgs: [itemType, family],
|
||||
orderBy: "NormalizedName");
|
||||
if (response.isEmpty) {
|
||||
print("Id not found");
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ class Item {
|
|||
String Source;
|
||||
String Markdown;
|
||||
String FullText;
|
||||
String Discriminator;
|
||||
String ItemType;
|
||||
List<Item> Children;
|
||||
|
||||
Item({this.Id, this.Name, this.Alias, this.Markdown, this.Discriminator});
|
||||
Item({this.Id, this.Name, this.Alias, this.Markdown, this.ItemType});
|
||||
|
||||
Item.fromMap(Map<String, dynamic> map) {
|
||||
this.Id = map["Id"];
|
||||
|
|
@ -23,7 +23,7 @@ class Item {
|
|||
this.Alias = map["AltName"];
|
||||
this.AliasText = map["AltNameText"];
|
||||
this.Markdown = map["Markdown"];
|
||||
this.Discriminator = map["Discriminator"];
|
||||
this.ItemType = map["ItemType"];
|
||||
}
|
||||
|
||||
/*factory Item.fromMap(Map<String, dynamic> json) => new Item(
|
||||
|
|
@ -41,7 +41,7 @@ class Item {
|
|||
"AltName": Alias,
|
||||
"AltNameText": AliasText,
|
||||
"Markdown": Markdown,
|
||||
"Discriminator": Discriminator,
|
||||
"ItemType": ItemType,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ class MonsterItems extends Item {
|
|||
|
||||
MonsterItems.fromMap(Map<String, dynamic> map)
|
||||
: super.fromMap(map) {
|
||||
this.Family = map["MonsterItems_Family"];
|
||||
this.Family = map["Family"];
|
||||
this.Type = map["Type"];
|
||||
this.Size = map["Size"];
|
||||
this.Alignment = map["Alignment"];
|
||||
|
|
@ -162,7 +162,7 @@ class MonsterItems extends Item {
|
|||
}
|
||||
|
||||
Item itemFromMap(Map<String, dynamic> map) {
|
||||
switch(map["Discriminator"]) {
|
||||
switch(map["ItemType"]) {
|
||||
case "MonsterItem": return MonsterItem.fromMap(map);
|
||||
case "MonsterItems": return MonsterItems.fromMap(map);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue