Stat ClassDelta Engine Documentation
This holds the value of a creep/tower statistic - eg. creep health, tower firing rate etc. It can be adjusted (eg a creep loses health on being shot) or buffed/debuffed (eg a tower increases firing rate due to being close to a booster tower) View code on GitHub
Inheritance Hierarchy

System Object
  CreepyTowers.Stats Stat

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

public class Stat

The Stat type exposes the following members.

Constructors

  NameDescription
Public methodStat
Initializes a new instance of the Stat class
Top
Methods

  NameDescription
Public methodAdjust
Public methodApplyBuff
Public methodRemoveBuff
Public methodToString (Overrides Object ToString .)
Top
Properties

  NameDescription
Public propertyBaseValue
Public propertyMaxValue
Public propertyPercentage
Public propertyValue
Top
Remarks

Tests: CreepyTowers.Tests.Stats.StatAdjustmentTests
Examples

10 unit tests call CreepyTowers.Stats.Stat
[Test]
public void Constructor()
{
    var effect = new StatAdjustment("Hp", "Armor", -50);
    Assert.AreEqual("Hp", effect.Attribute);
    Assert.AreEqual("Armor", effect.Resist);
    Assert.AreEqual(-50.0f, effect.Adjustment);
}
[Test]
public void ConstructedFromXml()
{
    var effect = new StatAdjustment("TestAdjustment");
    Assert.AreEqual("Hp", effect.Attribute);
    Assert.AreEqual("", effect.Resist);
    Assert.AreEqual(-100.0f, effect.Adjustment);
}
[Test]
public void Constructor()
{
    Assert.AreEqual(100.0f, stat.BaseValue);
}
See Also