/// <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"; }
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); }
public void Update() { // Очистка завершённых игар BattleList.RemoveAll(battle => battle.Status == BattleStatus.BATTLE_STATUS_DONE); }
public Battle GetBattle(int id) { return(BattleList.Find(x => x.Id == id)); }
public void RemoveBattle(Battle battle) { BattleList.Remove(battle); }