예제 #1
0
 /// <summary>
 /// Loads the players.
 /// </summary>
 private void LoadPlayers()
 {
     var blist = new BattleList(TibiaClient.Connection, new Tibia.Features.Structures.Range(Tibia.Features.RangeType.Screen, 3));
     var creatures = blist.GetAll();
     lstPlayers.DataSource = creatures;
     lstPlayers.DisplayMember = "Name";
 }
예제 #2
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);
        }
예제 #3
0
 public void Update()
 {
     // Очистка завершённых игар
     BattleList.RemoveAll(battle => battle.Status == BattleStatus.BATTLE_STATUS_DONE);
 }
예제 #4
0
 public Battle GetBattle(int id)
 {
     return(BattleList.Find(x => x.Id == id));
 }
예제 #5
0
 public void RemoveBattle(Battle battle)
 {
     BattleList.Remove(battle);
 }