Board Clone Method Delta Engine Documentation

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

public Board Clone()

Return Value

Type: Board
Remarks

Tests: Drench.Tests.BoardTests
Examples

2 unit tests call Drench.Board.Clone
[Test]
public void CloneMatchesOriginal()
{
    board.SetColor(0, 0, Color.Red);
    Board clone = board.Clone();
    Assert.AreEqual(Color.Red, clone.GetColor(0, 0));
}
[Test]
public void ChangingOriginalAfterCloningDoesntAffectClone()
{
    Board clone = board.Clone();
    board.SetColor(0, 0, Color.Red);
    Assert.AreNotEqual(Color.Red, clone.GetColor(0, 0));
}
See Also