示例#1
0
 internal Champion(ChampionDto dto, GameVersion version)
 {
     Version         = version;
     Id              = Enum.Parse <ChampionId>(dto.Id, true);
     Key             = int.Parse(dto.Key);
     Name            = dto.Name;
     Title           = dto.Title;
     Summary         = dto.Blurb;
     ResourceType    = dto.Partype;
     Information     = new ChampionInformation(dto.Info);
     Image           = new ImageInformation(dto.Image);
     Tags            = dto.Tags;
     Statistics      = new ChampionStatistics(dto.Stats);
     Lore            = dto.Lore;
     Skins           = Array.ConvertAll(dto.Skins, Converter).ToImmutableArray();
     AllyTips        = dto.AllyTips.ToImmutableArray();
     EnemyTips       = dto.EnemyTips.ToImmutableArray();
     Spells          = Array.ConvertAll(dto.Spells, x => new Spell(x)).ToImmutableArray();
     PassiveSpell    = new SpellBase(dto.Passive);
     Recommendations = Array.ConvertAll(dto.Recommendations, x => new Recommendation(x)).ToImmutableArray();
 }
示例#2
0
 private Champion Converter(ChampionDto dto)
 => new Champion(dto, Version);