示例#1
0
        private void addDummiesIfNeeded()
        {
            while (AttackerBattleParticipants.Count < 5)
            {
                AttackerBattleParticipants.Add(new ShortEmptyBattleParticipantViewModel());
            }

            while (DefenderBattleParticipants.Count < 5)
            {
                DefenderBattleParticipants.Add(new ShortEmptyBattleParticipantViewModel());
            }
        }
示例#2
0
        private void addRealLastParticipants(Entities.Battle battle)
        {
            var lastAttackers = battle.BattleParticipants.Where(p => p.IsAttacker).OrderByDescending(p => p.ID).Take(5).ToList();
            var lastDefenders = battle.BattleParticipants.Where(p => p.IsAttacker == false).OrderByDescending(p => p.ID).Take(5).ToList();

            foreach (var attacker in lastAttackers)
            {
                AttackerBattleParticipants.Add(new ShortBattleParticipantViewModel(attacker));
            }

            foreach (var defender in lastDefenders)
            {
                DefenderBattleParticipants.Add(new ShortBattleParticipantViewModel(defender));
            }

            // AttackerBattleParticipants.Reverse();
            //DefenderBattleParticipants.Reverse();
        }