Logic IsGameOver Property Delta Engine Documentation

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

public bool IsGameOver { get; }

Property Value

Type: Boolean
Remarks

Tests: Drench.Tests.Logics.SinglePlayerLogicTests
Examples

2 unit tests call Drench.Logics.Logic.IsGameOver
[Test]
public void GameIsNotFinishedAfterFirstMove()
{
    bool isGameFinished = false;
    logic.GameFinished += () => isGameFinished = true;
    logic.MakeMove(Color.Red);
    Assert.IsFalse(logic.IsGameOver);
    Assert.IsFalse(isGameFinished);
    Assert.AreEqual(1, logic.GetPlayerScore(0));
}
[Test]
public void WhenBoardIsAllTheSameColorGameIsFinished()
{
    bool isGameFinished = false;
    logic.GameFinished += () => isGameFinished = true;
    MakeWinningMove();
    Assert.IsTrue(logic.IsGameOver);
    Assert.IsTrue(isGameFinished);
    Assert.AreEqual(BoardTests.Width * BoardTests.Height, logic.GetPlayerScore(0));
}
See Also