Level ToTextForXml Method Delta Engine Documentation

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

public string ToTextForXml()

Return Value

Type: String
Remarks

Tests: DeltaEngine.GameLogic.Tests.LevelTests
Examples

1 unit tests call DeltaEngine.GameLogic.Level.ToTextForXml
[Test, CloseAfterFirstFrame]
public void TestToTextForXml()
{
    var level = new MockLevel(new Size(3, 4));
    level.SetTile(new Vector2D(0, 0), LevelTileType.Nothing);
    level.SetTile(new Vector2D(1, 0), LevelTileType.Blocked);
    level.SetTile(new Vector2D(2, 0), LevelTileType.Placeable);
    level.SetTile(new Vector2D(0, 1), LevelTileType.BlockedPlaceable);
    level.SetTile(new Vector2D(1, 1), LevelTileType.Red);
    level.SetTile(new Vector2D(2, 1), LevelTileType.Green);
    level.SetTile(new Vector2D(0, 2), LevelTileType.Blue);
    level.SetTile(new Vector2D(1, 2), LevelTileType.Yellow);
    level.SetTile(new Vector2D(2, 2), LevelTileType.Brown);
    level.SetTile(new Vector2D(0, 3), LevelTileType.Gray);
    level.SetTile(new Vector2D(1, 3), LevelTileType.SpawnPoint);
    level.SetTile(new Vector2D(2, 3), LevelTileType.ExitPoint);
    string text = level.ToTextForXml();
    Assert.AreEqual("\r\n.XP\r\nLRG\r\nBYO\r\nASE\r\n", text);
}
See Also