Board GetColor Method (Vector2D)Delta Engine Documentation

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

public Color GetColor(
	Vector2D square
)

Return Value

Type: Color
Remarks

Tests: Drench.Tests.BoardTests
Examples

5 unit tests call Drench.Board.GetColor(DeltaEngine.Datatypes.Vector2D)
[Test]
public void BoardTopLeftColor()
{
    Assert.AreEqual(new Color(0.5f, 1.0f, 1.0f), board.GetColor(0, 0));
}
[Test]
public void Randomize()
{
    board.Randomize();
    Assert.AreEqual(new Color(1.0f, 1.0f, 0.5f), board.GetColor(0, 0));
}
[Test]
public void GetAndSetColor()
{
    board.SetColor(0, 0, Color.Red);
    board.SetColor(Vector2D.One, Color.Green);
    Assert.AreEqual(Color.Red, board.GetColor(0, 0));
    Assert.AreEqual(Color.Green, board.GetColor(Vector2D.One));
}
See Also