DrawableEntity IsVisible Property Delta Engine Documentation

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

public bool IsVisible { get; set; }

Property Value

Type: Boolean
Remarks

Tests: GameOfDeath.Tests.RabbitGridTests
Examples

3 unit tests call DeltaEngine.Entities.DrawableEntity.IsVisible
[Test]
public void CellAliveCausesRabbitToBeVisibleInNextFrame()
{
    var rabbitGrid = CreateRabbitGrid();
    AdvanceTimeAndUpdateEntities();
    Assert.IsTrue(rabbitGrid.Rabbits[1,1].IsVisible);
}
[Test]
public void HealthBarShownOnHit()
{
    var rabbitGrid = CreateRabbitGrid();
    AdvanceTimeAndUpdateEntities();
    rabbitGrid.DoDamage(rabbitGrid.CalculatePositionOfMatrixRabbit(1,1),0.1f, 0.7f);
    Assert.IsTrue(rabbitGrid.Rabbits[1,1].RabbitHealthBar.IsVisible);
}
[Test]
public void DamagingRabbitsTillDeathMakesThemInvisibleAgain()
{
    var rabbitGrid = CreateRabbitGrid();
    AdvanceTimeAndUpdateEntities();
    rabbitGrid.DoDamage(rabbitGrid.CalculatePositionOfMatrixRabbit(1, 1), 0.1f, 10.0f);
    Assert.IsFalse(rabbitGrid.Rabbits[1,1].IsVisible);
    Assert.IsFalse(rabbitGrid.Rabbits[1,1].RabbitHealthBar.IsVisible);
}
See Also