Namespace: Blocks
Assembly: Blocks (in Blocks.exe) Version: 1.1.1.0 (1.1.1)
Tests: Blocks.Tests.GridTests
2 unit tests call Blocks.Grid.IsValidPosition(Blocks.Block)
Assembly: Blocks (in Blocks.exe) Version: 1.1.1.0 (1.1.1)
Syntax
Parameters
- block
- Type: Blocks Block
Return Value
Type: BooleanRemarks
Examples
[Test, Ignore] public void IsValidPositionInEmptyGrid() { Assert.IsFalse(grid.IsValidPosition(new Block(displayMode, content, new Vector2D(-1, 1)))); Assert.IsFalse(grid.IsValidPosition(new Block(displayMode, content, new Vector2D(9, 1)))); Assert.IsFalse(grid.IsValidPosition(new Block(displayMode, content, new Vector2D(0, 0)))); //using (NUnit.Framework.Randomizer.Use(new FixedRandom(IBlock))) Assert.IsFalse(grid.IsValidPosition(new Block(displayMode, content, new Vector2D(0, 17)))); Assert.IsTrue(grid.IsValidPosition(new Block(displayMode, content, new Vector2D(2, 2)))); }
[Test, Ignore] public void IsValidPositionInOccupiedGrid() { grid.AffixBlock(new Block(displayMode, content, new Vector2D(5, 1))); Assert.IsFalse(grid.IsValidPosition(new Block(displayMode, content, new Vector2D(3, 0)))); Assert.IsTrue(grid.IsValidPosition(new Block(displayMode, content, new Vector2D(5, 2)))); }
See Also