LevelTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Rendering3D.Shapes.Tests LevelTests

Namespace: DeltaEngine.Rendering3D.Shapes.Tests
Assembly: DeltaEngine.Rendering3D.Shapes.Tests (in DeltaEngine.Rendering3D.Shapes.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class LevelTests

The LevelTests type exposes the following members.

Constructors

  NameDescription
Public methodLevelTests
Initializes a new instance of the LevelTests class
Top
Methods

  NameDescription
Public methodBuildXmlData
Public methodCreateALevel
Top
Examples

[Test]
public void CreateALevel()
{
    level = new Level(new Size(5, 5));
    level.SetTile(new Vector2D(0, 0), LevelTileType.SpawnPoint);
    level.SetTile(new Vector2D(1, 1), LevelTileType.ExitPoint);
    level.SetTile(new Vector2D(2, 2), LevelTileType.BlockedPlaceable);
    level.SetTile(new Vector2D(0, 1), LevelTileType.Blue);
    level.SetTile(new Vector2D(0, 2), LevelTileType.Brown);
    level.SetTile(new Vector2D(0, 3), LevelTileType.Green);
    level.SetTile(new Vector2D(0, 4), LevelTileType.Gray);
    level.SetTile(new Vector2D(1, 0), LevelTileType.Placeable);
    level.SetTile(new Vector2D(1, 2), LevelTileType.Yellow);
    level.SetTile(new Vector2D(1, 3), LevelTileType.Blocked);
    level.SetTile(new Vector2D(1, 4), LevelTileType.Red);
    level.AddWave(new Wave(2.0f, 1.0f, "Test", "Test", 20.0f));
    var stream = new XmlFile(BuildXmlData()).ToMemoryStream();
    var loadedLevel = new MockLevel(new Size(0, 0));
    loadedLevel.LoadData(stream);
    Assert.AreEqual(loadedLevel.Size, level.Size);
    Assert.AreEqual(loadedLevel.MapData[0], level.MapData[0]);
    Assert.AreEqual(loadedLevel.Waves[0].MaxTime, level.Waves[0].MaxTime);
    Assert.AreEqual(loadedLevel.Waves[0].SpawnInterval, level.Waves[0].SpawnInterval);
    Assert.AreEqual(loadedLevel.Waves[0].SpawnTypeList, level.Waves[0].SpawnTypeList);
    Assert.AreEqual(loadedLevel.Waves[0].WaitTime, level.Waves[0].WaitTime);
    level.Dispose();
}
See Also