From 7d41c496a908d216140827a88c05108278ad67ed Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Wed, 8 Mar 2023 10:23:21 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20d'un=20id=20=C3=A0=20la=20classe=20Cham?= =?UTF-8?q?pion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/DataManagers/ChampChanger.cs | 4 ++-- Sources/EFLib/oiseaux.db-shm | Bin 0 -> 32768 bytes Sources/EFLib/oiseaux.db-wal | 0 Sources/Model/Champion.cs | 23 +++++++++++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 Sources/EFLib/oiseaux.db-shm create mode 100644 Sources/EFLib/oiseaux.db-wal diff --git a/Sources/DataManagers/ChampChanger.cs b/Sources/DataManagers/ChampChanger.cs index 916c90f..6f9d3f4 100644 --- a/Sources/DataManagers/ChampChanger.cs +++ b/Sources/DataManagers/ChampChanger.cs @@ -8,16 +8,16 @@ namespace DataManagers { public static Champion ToPoco(this ChampionEntity champion) { - return new Champion(name: champion.Name, champClass: champion.ChampClass, icon: champion.Icon, bio: champion.Bio); + return new Champion(id: champion.Id, name: champion.Name, champClass: champion.ChampClass, icon: champion.Icon, bio: champion.Bio); } public static ChampionEntity ToEntity(this Champion champion) => new ChampionEntity { + Id = champion.Id, Name = champion.Name, Bio = champion.Bio, Icon = champion.Icon, ChampClass = champion.Class, - //Characteristics = champion.Characteristics.Select(dict => dict).ToDictionary(pair => pair.Key, pair => pair.Value) }; public static IEnumerable ToPocos(this IEnumerable champs) diff --git a/Sources/EFLib/oiseaux.db-shm b/Sources/EFLib/oiseaux.db-shm new file mode 100644 index 0000000000000000000000000000000000000000..fe9ac2845eca6fe6da8a63cd096d9cf9e24ece10 GIT binary patch literal 32768 zcmeIuAr62r3 { + + public int Id + { + get => id; + private init + { + id = value; + } + } + private readonly int id; + public string Name { get => name; @@ -42,6 +53,18 @@ public class Champion : IEquatable public LargeImage Image { get; set; } + public Champion(int id, string name, ChampionClass champClass = ChampionClass.Unknown, string icon = "", string image = "", string bio = "") + { + Id = id; + Name = name; + Class = champClass; + Icon = icon; + Image = new LargeImage(image); + Bio = bio; + Characteristics = new ReadOnlyDictionary(characteristics); + Skins = new ReadOnlyCollection(skins); + } + public Champion(string name, ChampionClass champClass = ChampionClass.Unknown, string icon = "", string image = "", string bio = "") { Name = name;