private static Unit CreateUnit(Selection selection) { if(selection.Selections.Count == 0) return selection.MapTo<Unit>(); return new Unit { Name = selection.Name, ModelCount = Convert.ToUInt32(selection.Selections.First(x => x.Number > 1).Number), HasMusician = selection.Selections.Any(x => x.Name == "Musician"), HasStandard = selection.Selections.Any(x => x.Name == "Standard Bearer"), Points = Convert.ToUInt32(selection.Selections.First(x => x.Number > 1).Points / selection.Selections.First(x => x.Number > 1).Number) }; }
private void AddSpecial(Selection selection, Army army) { var unit = CreateUnit(selection); army.Special.Add(unit); }
private void AddRare(Selection selection, Army army) { var unit = CreateUnit(selection); army.Rare.Add(unit); }
private void AddLord(Selection selection, Army army) { var lord = selection.MapTo<Character>(); army.Lords.Add(lord); }
private void AddHero(Selection selection, Army army) { var hero = selection.MapTo<Character>(); army.Heroes.Add(hero); }