BallInLevel Level Property Delta Engine Documentation

Namespace: Breakout
Assembly: Breakout (in Breakout.exe) Version: 1.1.1.0 (1.1.1)
Syntax

public Level Level { get; }

Property Value

Type: Level
Remarks

Tests: Breakout.Tests.BallInLevelTests
Examples

1 unit tests call Breakout.BallInLevel.Level
[Test, CloseAfterFirstFrame]
public void BallUpdateStartsNewLevel()
{
    if (!IsMockResolver)
        return; //ncrunch: no coverage
    Resolve<BallInLevel>();
    var level = Resolve<Level>();
    level.GetBrickAt(0.25f, 0.125f).IsVisible = false;
    level.GetBrickAt(0.75f, 0.125f).IsVisible = false;
    level.GetBrickAt(0.25f, 0.375f).IsVisible = false;
    level.GetBrickAt(0.75f, 0.375f).IsVisible = false;
    Assert.AreEqual(0, level.BricksLeft);
    Resolve<MockKeyboard>().SetKeyboardState(Key.Space, State.Pressing);
    AdvanceTimeAndUpdateEntities();
    Assert.AreNotEqual(0, level.BricksLeft);
}
See Also