Пример #1
0
 public void AddPlayer(Player player)
 {
     if (listPlayer.SingleOrDefault(q => q.Id == player.Id) == null)
     {
         listPlayer.Add(player);
     }
 }
Пример #2
0
 private void joinEvent(Game game, string[] words)
 {
     Player player = new Player() { Id = words[1], Name = words[3] };
     game.AddPlayer(player);
 }
Пример #3
0
 public object Clone()
 {
     Player softClone = new Player()
     { 
         Army = this.Army, 
         Headshots = this.Headshots, 
         HeadshotsTaken = this.HeadshotsTaken, 
         Id = this.Id, 
         Name = this.Name, 
         Stabs = this.Stabs, 
         listAction = this.listAction 
     };
     softClone.CreateStatisctics();
     return softClone;
 }
Пример #4
0
 private void AddUpdateNightPlayer(Player player)
 {
     Player onList = listAllPlayers.SingleOrDefault(p => p.Id == player.Id);
     if (onList != null)
     {
         onList.AddAction(player.GetActions());
         onList.BestPlayerCount = onList.BestPlayerCount + player.BestPlayerCount;
         onList.WorstPlayerCount = onList.WorstPlayerCount + player.WorstPlayerCount;
     }
     else
     {
         listAllPlayers.Add((Player)player.Clone());
     }
 }
Пример #5
0
 public void AddAction(Player playerTo, ActionType actionType, ModifierType modifier, Weapon weapon, WhereType where)
 {
     listAction.Add(new Action() { PlayerTo = playerTo, ActionType = actionType, Modifier = modifier, Weapon = weapon, Where = where}); 
 }