Example #1
0
 /// <summary>
 /// Contains the player.
 /// </summary>
 /// <param name="player">The player.</param>
 /// <returns>bool if Contains player</returns>
 public bool ContainPlayer(ClientOfServer player)
 {
     if (Guest.Equals(player) || Host.Equals(player))
     {
         return(true);
     }
     return(false);
 }
Example #2
0
 /// <summary>
 /// Contains the player.
 /// </summary>
 /// <param name="player">The player.</param>
 /// <returns>bool if Contains player</returns>
 public bool ContainPlayer(string player)
 {
     if (Guest.Equals(player) || Host.Equals(player))
     {
         return(true);
     }
     return(false);
 }
Example #3
0
        /// <summary>
        /// Gets the other player.
        /// </summary>
        /// <param name="player">The player.</param>
        /// <returns>the tcp client</returns>
        /// <exception cref="System.Exception">the player does not exist</exception>
        public ClientOfServer GetTheOtherPlayer(ClientOfServer player)
        {
            if (Host.Equals(player))
            {
                return(Guest);
            }

            if (Guest.Equals(player))
            {
                return(Host);
            }

            throw new Exception("the player does not exist");
        }
Example #4
0
        /// <summary>
        /// Gets the other player.
        /// </summary>
        /// <param name="player">The player.</param>
        /// <returns>the tcp client</returns>
        /// <exception cref="System.Exception">the player does not exist</exception>
        public string GetTheOtherPlayer(string player)
        {
            if (Host.Equals(player))
            {
                return(Guest);
            }

            if (Guest.Equals(player))
            {
                return(Host);
            }

            throw new Exception("the player does not exist");
        }
Example #5
0
        public void TestEqualsExpectedTrue()
        {
            this.guest.Id = 1;
            Guest test = new Guest
            {
                Id = 1
            };

            Assert.IsTrue(guest.Equals(test));
        }