Tree TryToUpgrade Method Delta Engine Documentation

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

public void TryToUpgrade()
Remarks

Tests: GhostWars.Tests.TreeTests
Examples

2 unit tests call GhostWars.Tree.TryToUpgrade
[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