RabbitGrid ClassDelta Engine Documentation
Derived from the GameOfLife and handles the rabbit logic. View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    GameOfDeath GameOfDeath
      GameOfDeath RabbitGrid

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

public class RabbitGrid : GameOfDeath

The RabbitGrid type exposes the following members.

Constructors

  NameDescription
Public methodRabbitGrid
Initializes a new instance of the RabbitGrid class
Top
Methods

  NameDescription
Public methodAdd T  (Inherited from Entity.)
Public methodAddTag (Inherited from Entity.)
Protected methodBaseUpdate (Overrides GameOfDeath BaseUpdate .)
Public methodCalculatePositionOfMatrixRabbit
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Inherited from Entity.)
Public methodDoDamage
Public methodGet T 
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D) View code on GitHub
(Inherited from Entity.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Protected methodGetComponentsForSaving (Inherited from Entity.)
Public methodGetNumberOfNeighbours (Inherited from GameOfDeath.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetTags (Inherited from Entity.)
Public methodIsGameOver
Public methodIsOverPopulated
Public methodRandomize (Inherited from GameOfDeath.)
Public methodRecalculateRabbitPositionsAndSizes
Public methodRemove T  (Inherited from Entity.)
Public methodRemoveTag (Inherited from Entity.)
Public methodSet (Inherited from Entity.)
Public methodSetComponents (Inherited from Entity.)
Public methodShouldSurvive (Inherited from GameOfDeath.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToString (Inherited from Entity.)
Public methodUpdate (Inherited from GameOfDeath.)
Top
Fields

  NameDescription
Protected fieldcomponents (Inherited from Entity.)
Public fieldCurrentWorld (Inherited from GameOfDeath.)
Public fieldheight (Inherited from GameOfDeath.)
Public fieldNextGeneration (Inherited from GameOfDeath.)
Public fieldwidth (Inherited from GameOfDeath.)
Top
Properties

  NameDescription
Public propertyGenerationCount (Inherited from GameOfDeath.)
Public propertyIsActive (Inherited from Entity.)
Public propertyIsPauseable (Inherited from GameOfDeath.)
Public propertyItem (Inherited from GameOfDeath.)
Public propertyMatrixSize (Inherited from GameOfDeath.)
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyRabbits
Public propertyUpdatePriority (Inherited from Entity.)
Top
Events

  NameDescription
Public eventGameOver
Public eventMoneyEarned
Public eventRabbitKilled
Top
Remarks

Tests: GameOfDeath.Tests.RabbitGridTests
Examples

4 unit tests call GameOfDeath.RabbitGrid
[Test]
public void CellHavingTwoNeighborsShallSurvive()
{
    var rabbitGrid = CreateRabbitGrid();
    AdvanceTimeAndUpdateEntities();
    Assert.IsTrue(rabbitGrid.ShouldSurvive(1, 1));
}
[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);
}
See Also