From 7009f82efc773b08f328b75263ce67ef3e3a0e4d Mon Sep 17 00:00:00 2001 From: Chris Marabate Date: Tue, 13 Feb 2024 13:17:33 -0500 Subject: [PATCH] Adjusted to be an Array --- Account/ModelExtensions.cs | 31 ++++++++++++++++--------------- Client/Node/src/Types/HeroType.ts | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Account/ModelExtensions.cs b/Account/ModelExtensions.cs index bc122e8..15fee63 100644 --- a/Account/ModelExtensions.cs +++ b/Account/ModelExtensions.cs @@ -284,21 +284,22 @@ public static HeroForm ToModel(this SharedModel.Meta.Heroes.HeroForm form) } public static HeroType ToModel(this SharedModel.Meta.Heroes.HeroType type) - { - SharedModel.Meta.Heroes.HeroVisualInfo? firstAvatar = type.VisualInfosBySkinId?.FirstOrDefault().Value; - return new HeroType() - { - Affinity = (Enums.Element)type.Element, - Ascended = type.Id % 10, - Faction = (Enums.HeroFraction)type.Fraction, - Name = type.Name.ToModel(), - ShortName = type.ShortName?.ToModel() ?? type.Name.ToModel(), - Rarity = (Enums.HeroRarity)type.Rarity, - LeaderSkill = type.LeaderSkill?.ToModel(), - TypeId = type.Id, - Forms = type.Forms.Select(ToModel).ToArray() - }; - } +{ + SharedModel.Meta.Heroes.HeroVisualInfo? firstAvatar = type.VisualInfosBySkinId?.FirstOrDefault().Value; + return new HeroType() + { + Affinity = (Enums.Element)type.Element, + Ascended = type.Id % 10, + Faction = (Enums.HeroFraction)type.Fraction, + Name = type.Name.ToModel(), + ShortName = type.ShortName?.ToModel() ?? type.Name.ToModel(), + Rarity = (Enums.HeroRarity)type.Rarity, + LeaderSkill = type.LeaderSkill?.Select(ls => ls.ToModel()).ToArray() ?? Array.Empty(), + TypeId = type.Id, + Forms = type.Forms.Select(f => f.ToModel()).ToArray() + }; +} + public static LeaderStatBonus ToModel(this SharedModel.Meta.Skills.LeaderSkill skill) { diff --git a/Client/Node/src/Types/HeroType.ts b/Client/Node/src/Types/HeroType.ts index 2d1f59b..8810857 100644 --- a/Client/Node/src/Types/HeroType.ts +++ b/Client/Node/src/Types/HeroType.ts @@ -37,7 +37,7 @@ export interface HeroType { faction: Faction; rarity: Rarity; ascended: number; - leaderSkill: LeaderStatBonus; + leaderSkill: LeaderStatBonus[]; brain: string; forms: HeroForm[]; }