Пример #1
0
        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)
                           };
        }
Пример #2
0
 private void AddSpecial(Selection selection, Army army)
 {
     var unit = CreateUnit(selection);
     army.Special.Add(unit);
 }
Пример #3
0
 private void AddRare(Selection selection, Army army)
 {
     var unit = CreateUnit(selection);
     army.Rare.Add(unit);
 }
Пример #4
0
 private void AddLord(Selection selection, Army army)
 {
     var lord = selection.MapTo<Character>();
     army.Lords.Add(lord);
 }
Пример #5
0
 private void AddHero(Selection selection, Army army)
 {
     var hero = selection.MapTo<Character>();
     army.Heroes.Add(hero);
 }