Block Top Property Delta Engine Documentation

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

public float Top { get; set; }

Property Value

Type: Single
Remarks

Tests: Blocks.Tests.BlockTests
Examples

2 unit tests call Blocks.Block.Top
[Test, CloseAfterFirstFrame]
public void ConstructorTopLeft()
{
    var block = new Block(displayMode, content, new Vector2D(1, 2));
    Assert.AreEqual(1, block.Left);
    Assert.AreEqual(2, block.Top);
}
[Test, CloseAfterFirstFrame]
public void Top()
{
    var shape = new Block(displayMode, content, Vector2D.Zero) { Top = 1 };
    Assert.AreEqual(1, shape.Top);
    Assert.AreEqual(1, shape.Bricks[0].TopLeftGridCoord.Y);
    Assert.AreEqual(1, shape.Bricks[1].TopLeftGridCoord.Y);
    Assert.AreEqual(1, shape.Bricks[2].TopLeftGridCoord.Y);
    Assert.AreEqual(1, shape.Bricks[3].TopLeftGridCoord.Y);
}
See Also