Interaction ClassDelta Engine Documentation
This is created when one thing interacts with another and carries information on how much to adjust its stats and/or buffs (eg. a tower's bullet hitting a creep) View code on GitHub
Inheritance Hierarchy

System Object
  CreepyTowers.Stats Interaction

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

public class Interaction

The Interaction type exposes the following members.

Constructors

  NameDescription
Public methodInteraction
Initializes a new instance of the Interaction class
Top
Methods

  NameDescription
Public methodApply
Top
Properties

  NameDescription
Public propertySource
Public propertyTarget
Top
Remarks

Tests: CreepyTowers.Tests.Stats.InteractionTests
Examples

3 unit tests call CreepyTowers.Stats.Interaction
[Test]
public void Constructor()
{
    var effect = new BuffEffect("TestHpBuff");
    var interaction = new Interaction(tower, creep, adjustment, effect);
    Assert.AreEqual(tower, interaction.Source);
    Assert.AreEqual(creep, interaction.Target);
}
[Test]
public void PerformAdjustment()
{
    var interaction = new Interaction(tower, creep, adjustment);
    interaction.Apply();
    Assert.AreEqual(0.0f, creep.GetStatValue("Hp"));
}
[Test]
public void PerformBuff()
{
    var effect = new BuffEffect("TestHpBuff");
    var interaction = new Interaction(tower, creep, adjustment, effect);
    interaction.Apply();
    Assert.AreEqual(204.0f, creep.GetStatValue("Hp"));
}
See Also