Agent GetStatPercentage Method Delta Engine Documentation

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

public float GetStatPercentage(
	string attribute
)

Return Value

Type: Single
Remarks

Tests: CreepyTowers.Tests.AgentTests
Remarks

Tests: CreepyTowers.Tests.Towers.TowerTests
Examples

2 unit tests call CreepyTowers.Agent.GetStatPercentage(System.String)
[Test]
public void InitialValues()
{
    Assert.AreEqual(100.0, creep.GetStatValue("Hp"));
    Assert.AreEqual(1.0, creep.GetStatPercentage("Hp"));
}
[Test]
public void ApplyBuff()
{
    creep.ApplyBuff(new BuffEffect("TestHpBuff"));
    Assert.AreEqual(304.0, creep.GetStatValue("Hp"));
    Assert.AreEqual(100.0, creep.GetStatBaseValue("Hp"));
    Assert.AreEqual(1.0, creep.GetStatPercentage("Hp"));
}
Examples

1 unit tests call CreepyTowers.Agent.GetStatPercentage(System.String)
[Test, CloseAfterFirstFrame]
public void CheckForCreepUnderAttack()
{
    var tower = new Tower(TowerType.Slice, new Vector2D(0, 0));
    tower.RenderModel();
    var creep = new Creep(CreepType.Cloth, new Vector2D(1, 0));
    new TowerTargetFinder();
    AdvanceTimeAndUpdateEntities(2.1f);
    Assert.Less(creep.GetStatPercentage("Hp"), 1);
}
See Also