From 90b643e216d642f4a1b9079c7e3da1247720c1c6 Mon Sep 17 00:00:00 2001 From: Yan Maniez Date: Tue, 25 Feb 2020 17:51:11 +0100 Subject: [PATCH] =?UTF-8?q?D=C3=A9but=20filtres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aidedejeu_flutter/lib/models/items.dart | 75 +++++++++---------------- 1 file changed, 25 insertions(+), 50 deletions(-) diff --git a/aidedejeu_flutter/lib/models/items.dart b/aidedejeu_flutter/lib/models/items.dart index 8c5eaa3d..72d614e6 100644 --- a/aidedejeu_flutter/lib/models/items.dart +++ b/aidedejeu_flutter/lib/models/items.dart @@ -99,7 +99,6 @@ class MonsterItem extends Item { this.Languages = map["Languages"]; this.Challenge = map["Challenge"]; this.XP = map["XP"]; - } } @@ -117,62 +116,38 @@ class FilteredItems extends Items { : super.fromMap(map) { this.Family = map["Family"]; } + + Map toFilterMap() { + + } } class MonsterItems extends FilteredItems { - String Type; - String Size; - String Alignment; - String Terrain; - String Legendary; - String ArmorClass; - String HitPoints; - String Speed; - String Strength; - String Dexterity; - String Constitution; - String Intelligence; - String Wisdom; - String Charisma; - String SavingThrows; - String Skills; - String DamageVulnerabilities; - String DamageImmunities; - String ConditionImmunities; - String DamageResistances; - String Senses; - String Languages; - String Challenge; - int XP; + String Types; + String Challenges; + String Sizes; + String Sources; + String Terrains; MonsterItems.fromMap(Map map) : super.fromMap(map) { - this.Type = map["Type"]; - this.Size = map["Size"]; - this.Alignment = map["Alignment"]; - this.Terrain = map["Terrain"]; - this.Legendary = map["Legendary"]; - this.ArmorClass = map["ArmorClass"]; - this.HitPoints = map["HitPoints"]; - this.Speed = map["Speed"]; - this.Strength = map["Strength"]; - this.Dexterity = map["Dexterity"]; - this.Constitution = map["Constitution"]; - this.Intelligence = map["Intelligence"]; - this.Wisdom = map["Wisdom"]; - this.Charisma = map["Charisma"]; - this.SavingThrows = map["SavingThrows"]; - this.Skills = map["Skills"]; - this.DamageVulnerabilities = map["DamageVulnerabilities"]; - this.DamageImmunities = map["DamageImmunities"]; - this.ConditionImmunities = map["ConditionImmunities"]; - this.DamageResistances = map["DamageResistances"]; - this.Senses = map["Senses"]; - this.Languages = map["Languages"]; - this.Challenge = map["Challenge"]; - this.XP = map["XP"]; - + this.Types = map["Types"]; + this.Challenges = map["Challenges"]; + this.Sizes = map["Sizes"]; + this.Sources = map["Sources"]; + this.Terrains = map["Terrains"]; } + +// Map toMap() => { + //"Id": Id, + Map toFilterMap() => { + "Types": Types, + "Challenges": Challenges, + "Sizes": Sizes, + "Sources": Sources, + "Terrains": Terrains, + }; + } Item itemFromMap(Map map) {