TwoHumanNetworkGame ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    Drench.Games Game
      Drench.Games TwoPlayerGame
        Drench.Games TwoHumanNetworkGame

Namespace: Drench.Games
Assembly: Drench (in Drench.exe) Version: 1.1.1.0 (1.1.1)
Syntax

public class TwoHumanNetworkGame : TwoPlayerGame, 
	Updateable

The TwoHumanNetworkGame type exposes the following members.

Constructors

  NameDescription
Public methodTwoHumanNetworkGame
Initializes a new instance of the TwoHumanNetworkGame class
Top
Methods

  NameDescription
Public methodAdd T  (Inherited from Entity.)
Public methodAddTag (Inherited from Entity.)
Protected methodArrangeScene (Inherited from Game.)
Protected methodButtonClicked (Overrides Game ButtonClicked(Int32, Int32).)
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodCreateButtonTheme (Inherited from Game.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from Entity.)
Protected methodGameOver (Inherited from TwoPlayerGame.)
Public methodGet T 
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D) View code on GitHub
(Inherited from Entity.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Protected methodGetComponentsForSaving (Inherited from Entity.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Protected methodProcessDesiredMove (Overrides Game ProcessDesiredMove(Int32, Int32).)
Public methodRemove T  (Inherited from Entity.)
Public methodRemoveTag (Inherited from Entity.)
Public methodSet (Inherited from Entity.)
Public methodSetComponents (Inherited from Entity.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToString (Inherited from Entity.)
Public methodUpdate
Protected methodUpdateText (Inherited from TwoPlayerGame.)
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Protected fieldlogic (Inherited from Game.)
Top
Properties

  NameDescription
Public propertyIsActive (Inherited from Entity.)
Public propertyIsPauseable (Overrides Entity IsPauseable.)
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyUpdatePriority (Inherited from Entity.)
Top
Events

  NameDescription
Public eventExited (Inherited from Game.)
Top
Remarks

Tests: Drench.Tests.Games.TwoHumanNetworkGameTests
Examples

3 unit tests call Drench.Games.TwoHumanNetworkGame
[Test]
public void NewGameInstructions()
{
    Assert.AreEqual("*** Player 1: 1  (Your turn) ***", game1.upperText.Text);
    Assert.AreEqual("Player 2: 1  ", game1.lowerText.Text);
    Assert.AreEqual("*** Player 1: 1  (Waiting for other player's turn) ***",
        game2.upperText.Text);
    Assert.AreEqual("Player 2: 1  ", game2.lowerText.Text);
}
[Test]
public void ClickInvalidSquare()
{
    var firstSquare = new Vector2D(ScreenSpace.Current.Left + Game.Border + 0.01f,
        ScreenSpace.Current.Top + Game.Border + 0.01f);
    ClickMouse(firstSquare);
    Assert.AreEqual("*** Player 1: 1 - Invalid Move! ***", game1.upperText.Text);
    Assert.AreEqual("*** Player 1: 1 (Waiting for other player's turn) ***",
        game2.upperText.Text);
}
[Test]
public void ClickValidSquare()
{
    ClickMouse(Vector2D.Half);
    Assert.AreEqual(" Player 1: 3 Game Over! Player 1 wins! ", game1.upperText.Text);
}
See Also