Ejemplo n.º 1
0
 public static Team Create(Player p1, Player p2)
 {
     if (p1.id <= p2.id)
     {
         return new Team
         {
             player1 = p1,
             player2 = p2
         };
     }
     return new Team
     {
         player1 = p2,
         player2 = p1
     };
 }
Ejemplo n.º 2
0
            public bool Equals(Player p1, Player p2)
            {
                if (player1 == null || player2 == null)
                {
                    return false;
                }

                if (p1.id <= p2.id)
                {
                    return player1.id == p1.id && player2.id == p2.id;
                }
                return player2.id == p1.id && player1.id == p2.id;
            }