Exemple #1
0
 public int GetWar(Player player)
 {
     if (player == null)
     {
         return(WarWithNoOwner);
     }
     if (player == this)
     {
         return(0);
     }
     if (Wars.ContainsKey(player))
     {
         return(Wars[player]);
     }
     return(0);
 }
Exemple #2
0
        public void UpdateWar(Player player, int days)
        {
            if (player == this)
            {
                return;
            }

            if (player == null)
            {
                WarWithNoOwner = days;
                return;
            }

            if (Wars.ContainsKey(player))
            {
                Wars[player] = days;
            }
            else
            {
                Wars.Add(player, days);
            }
        }