Simple 2D map of TileType data to be used for 2D tile games or for game logic tests.
View code on GitHub
Inheritance Hierarchy
DeltaEngine.Content ContentData
DeltaEngine.GameLogic Level
CreepyTowers.Levels GameLevel
DeltaEngine.GameLogic.Tests MockLevel
DeltaEngine.Rendering3D.Shapes.Tests MockLevel
Namespace: DeltaEngine.GameLogic
Assembly: DeltaEngine.GameLogic (in DeltaEngine.GameLogic.dll) Version: 1.1.1.0 (1.1.1)
Syntax
The Level type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Level(String) | Initializes a new instance of the Level class | |
Level(Size) | Initializes a new instance of the Level class |
Methods
Name | Description | |
---|---|---|
AddWave | ||
CreateDefault | (Inherited from ContentData.) | |
Dispose | (Inherited from ContentData.) | |
DisposeData | (Overrides ContentData DisposeData .) | |
GetAllTilesOfType | ||
GetColor | ||
GetIndexForMapData | ||
GetIntersectionWithFloor | ||
GetMapCoordinates | ||
GetTileIndex | ||
GetWorldCoordinates | ||
InitializeData | ||
InternalCreateDefault | (Inherited from ContentData.) | |
IsInsideLevelGrid | ||
IsTileInteractable | ||
LoadData | (Overrides ContentData LoadData(Stream).) | |
SetTile | ||
SetTileWithScreenPosition | ||
StoreGameTriggers | ||
ToString | (Inherited from ContentData.) | |
ToTextForXml | ||
UpdateLevelData |
Fields
Name | Description | |
---|---|---|
ContentChanged | (Inherited from ContentData.) | |
data |
Properties
Name | Description | |
---|---|---|
AllowCreationIfContentNotFound | (Inherited from ContentData.) | |
Current | ||
GoalPoints | ||
IsDisposed | (Inherited from ContentData.) | |
MapData | ||
MetaData | (Inherited from ContentData.) | |
ModelName | ||
Name | (Inherited from ContentData.) | |
RenderIn3D | ||
Size | ||
SpawnPoints | ||
Triggers | ||
Waves |
Events
Name | Description | |
---|---|---|
TileChanged |
Remarks
Examples
[Test, CloseAfterFirstFrame] public void Start() { TileMap map = CreateSimple2X3TileMap(); Assert.AreEqual(2, map.Width); Assert.AreEqual(3, map.Height); }
[Test, CloseAfterFirstFrame] public void SaveAndLoadMapData() { TileMap map = CreateSimple2X3TileMap(); string mapData = map.Save(); string newLine = Environment.NewLine; string expectedData = "E." + newLine + "X." + newLine + "S." + newLine; Assert.AreEqual(expectedData, mapData); var loadedMap = new TileMap(mapData); Assert.AreEqual(expectedData, loadedMap.Save()); }
[Test, CloseAfterFirstFrame] public void CanNotCreateTileMapWithoutData() { const string MapData = ""; Assert.Throws<TileMap.NoTileMapData>(() => new TileMap(MapData)); }
See Also