Example #1
0
        public void AddBattle(Battle battle)
        {
            BattleList.RemoveAll(bt => bt.Id == battle.Id);

            if (BattleList.Count != 0)
            {
                battle.Id = BattleList.Where(bt => bt.Id > 0).OrderByDescending(bt => bt.Id).First().Id + 1;
            }
            else
            {
                battle.Id = 1;
            }

            BattleList.Add(battle);
        }
Example #2
0
 public void Update()
 {
     // Очистка завершённых игар
     BattleList.RemoveAll(battle => battle.Status == BattleStatus.BATTLE_STATUS_DONE);
 }