Exemplo n.º 1
0
 /// <summary>
 /// equals override, checks if players are equal
 /// </summary>
 public override bool Equals(object obj)
 {
     if (obj is SimplePlayer)
     {
         SimplePlayer other = (SimplePlayer)obj;
         return(other.player.Equals(this.player));
     }
     return(false);
 }
Exemplo n.º 2
0
 /// <summary>
 /// finds and returns the simple player in the player list, equal to player
 /// </summary>
 private SimplePlayer FindSimplePlayer(SimplePlayer player)
 {
     foreach (SimplePlayer pl in players)
     {
         if (pl.Equals(player))
         {
             return(pl);
         }
     }
     return(null);
 }
Exemplo n.º 3
0
 /// <summary>
 /// subtracts a card to a simple player
 /// </summary>
 internal void SubtractACardFromSimplePlayer(SimplePlayer player)
 {
     FindSimplePlayer(player).NumberOfCards--;
 }
Exemplo n.º 4
0
 /// <summary>
 /// adds a card to a simple player
 /// </summary>
 internal void AddACardToSimplePlayer(SimplePlayer player)
 {
     FindSimplePlayer(player).NumberOfCards++;
 }