Buff ClassDelta Engine Documentation
This is used to increase or decrease the value of a creep/tower statistic - either by multiplying the base value or by adding to it View code on GitHub
Inheritance Hierarchy

System Object
  CreepyTowers.Stats Buff

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

public class Buff

The Buff type exposes the following members.

Constructors

  NameDescription
Public methodBuff
Initializes a new instance of the Buff class
Top
Properties

  NameDescription
Public propertyEffect
Public propertyElapsed
Public propertyIsExpired
Public propertyStat
Top
Remarks

Tests: CreepyTowers.Tests.Stats.BuffEffectTests
Examples

6 unit tests call CreepyTowers.Stats.Buff
[Test]
public void SettingsConstructor()
{
    var goldBuff = new BuffEffect("TestGoldBuff");
    Assert.AreEqual("Gold", goldBuff.Attribute);
    Assert.AreEqual(2.0f, goldBuff.Multiplier);
    Assert.AreEqual(-3.0f, goldBuff.Addition);
    Assert.AreEqual(5.0f, goldBuff.Duration);
}
[Test]
public void Constructor()
{
    var stat = new Stat(100.0f);
    var effect = new BuffEffect("TestGoldBuff");
    var buff = new Buff(stat, effect);
    Assert.AreEqual(stat, buff.Stat);
    Assert.AreEqual(effect, buff.Effect);
    Assert.AreEqual(0, buff.Elapsed);
}
[Test]
public void Properties()
{
    var stat = new Stat(100.0f);
    const float Elapsed = 4.0f;
    var effect = new BuffEffect("TestGoldBuff");
    var buff = new Buff(new Stat(0.0f), new BuffEffect("TestHpBuff"))
    {
        Stat = stat,
        Effect = effect,
        Elapsed = Elapsed
    };
    Assert.AreEqual(stat, buff.Stat);
    Assert.AreEqual(effect, buff.Effect);
    Assert.AreEqual(Elapsed, buff.Elapsed);
}
See Also