Level IsTileInteractable Method Delta Engine Documentation

Namespace: DeltaEngine.GameLogic
Assembly: DeltaEngine.GameLogic (in DeltaEngine.GameLogic.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public bool IsTileInteractable(
	Vector2D gridPosition
)

Return Value

Type: Boolean
Remarks

Tests: DeltaEngine.GameLogic.Tests.LevelTests
Examples

1 unit tests call DeltaEngine.GameLogic.Level.IsTileInteractable(DeltaEngine.Datatypes.Vector2D)
[Test, CloseAfterFirstFrame]
public void InteractWithOnlyInteractableTiles()
{
    var level = new Level(new Size(2, 2));
    level.RenderIn3D = true;
    level.SetTile(new Vector2D(0, 0), LevelTileType.Blocked);
    level.SetTile(new Vector2D(1, 0), LevelTileType.ExitPoint);
    level.SetTile(new Vector2D(0, 1), LevelTileType.SpawnPoint);
    level.SetTile(new Vector2D(1, 1), LevelTileType.Placeable);
    Assert.IsFalse(level.IsTileInteractable(new Vector2D(0, 0)));
    Assert.IsFalse(level.IsTileInteractable(new Vector2D(1, 0)));
    Assert.IsFalse(level.IsTileInteractable(new Vector2D(0, 1)));
    Assert.IsTrue(level.IsTileInteractable(new Vector2D(1, 1)));
    Assert.IsTrue(level.IsTileInteractable(new Vector2D(2, 2)));
}
See Also