Tree Level Property Delta Engine Documentation

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

public int Level { get; set; }

Property Value

Type: Int32
Remarks

Tests: GhostWars.Tests.TreeTests
Examples

4 unit tests call GhostWars.Tree.Level
[Test]
public void AttackEnemyCountered()
{
    var tree = GiveTreeOfTeam(Team.HumanYellow);
    tree.Level = 2;
    const int OriginalCount = 60;
    tree.NumberOfGhosts = OriginalCount;
    const int WaveCount = 5;
    tree.Attack(Team.ComputerTeal, WaveCount);
    Assert.AreEqual(Team.HumanYellow, tree.CurrentTeam);
}
[Test]
public void UpgradePlayerTree()
{
    var tree = GiveTreeOfTeam(Team.HumanYellow);
    tree.NumberOfGhosts = GameLogic.GhostsToUpgrade;
    tree.TryToUpgrade();
    Assert.AreEqual(2, tree.Level);
}
[Test]
public void CannotUpgradeWithoutRequiredGhostCount()
{
    var tree = GiveTreeOfTeam(Team.HumanYellow);
    tree.NumberOfGhosts = GameLogic.GhostsToUpgrade / 2;
    tree.TryToUpgrade();
    Assert.AreEqual(1, tree.Level);
}
See Also