Tower ClassDelta Engine Documentation
Towers shoot at creeps. Their stats and behavior vary depending on their type View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Entities Entity
    DeltaEngine.Entities DrawableEntity
      DeltaEngine.Rendering3D Entity3D
        DeltaEngine.Rendering3D HierarchyEntity3D
          DeltaEngine.GameLogic Actor3D
            CreepyTowers Agent
              CreepyTowers.Towers Tower

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

public sealed class Tower : Agent

The Tower type exposes the following members.

Constructors

  NameDescription
Public methodTower
Initializes a new instance of the Tower class
Top
Methods

  NameDescription
Public methodAdd(HierarchyObject3D) (Inherited from HierarchyEntity3D.)
Public methodAdd T (T) (Inherited from Entity3D.)
Public methodAddTag (Inherited from Entity.)
Public methodAdjustStat (Inherited from Agent.)
Public methodAimToTarget
Public methodApplyBuff (Inherited from Agent.)
Public methodClearBuffs (Inherited from Agent.)
Public methodClearTags (Inherited from Entity.)
Public methodContains T  (Inherited from Entity3D.)
Public methodContainsBehavior T  (Inherited from Entity.)
Public methodContainsTag (Inherited from Entity.)
Public methodCreateStat (Inherited from Agent.)
Protected methodDeactivate (Inherited from Entity.)
Public methodDispose (Overrides Agent Dispose .)
Public methodFireAtCreep
Public methodGet T  (Inherited from Entity3D.)
Protected methodGetActiveBehaviors (Inherited from Entity.)
Public methodGetBoundingBox (Inherited from Actor3D.)
Public methodGetBoundingSphere (Inherited from Actor3D.)
Protected methodGetComponentsForSaving (Inherited from Entity3D.)
Public methodGetDrawArea (Inherited from Actor3D.)
Protected methodGetDrawBehaviors (Inherited from DrawableEntity.)
Public methodGetFirstChildOfType T  (Inherited from HierarchyEntity3D.)
Public methodGetInterpolatedArray T  (Inherited from DrawableEntity.)
Public methodGetInterpolatedList T  (Inherited from DrawableEntity.)
Public methodGetOrDefault T  (Inherited from Entity.)
Public methodGetStatBaseValue (Inherited from Agent.)
Public methodGetStatPercentage (Inherited from Agent.)
Public methodGetStatValue (Inherited from Agent.)
Public methodGetTags (Inherited from Entity.)
Protected methodInitializeModel (Overrides Agent InitializeModel .)
Public methodIs2D (Inherited from Actor3D.)
Public methodIsColliding (Inherited from Actor3D.)
Protected methodNextUpdateStarted (Inherited from Entity3D.)
Public methodOnDraw T  (Inherited from DrawableEntity.)
Protected methodOnOrientationChanged (Overrides Actor3D OnOrientationChanged .)
Protected methodOnPositionChanged (Inherited from Actor3D.)
Protected methodOnScaleChanged (Inherited from Actor3D.)
Public methodRemove(HierarchyObject3D) (Inherited from HierarchyEntity3D.)
Public methodRemove T   (Inherited from Entity.)
Public methodRemoveTag (Inherited from Entity.)
Public methodRenderModel (Inherited from Agent.)
Public methodSet (Inherited from Entity3D.)
Public methodSetComponents (Inherited from Entity.)
Public methodSetWithoutInterpolation T  (Inherited from Entity3D.)
Public methodStart T  (Inherited from Entity.)
Public methodStop T  (Inherited from Entity.)
Public methodToggleVisibility (Inherited from DrawableEntity.)
Public methodToString (Inherited from Entity.)
Public methodUpdate (Overrides Agent Update .)
Public methodUpdateGlobalsFromParent (Inherited from HierarchyEntity3D.)
Top
Fields

  NameDescription
Public fieldattackEffect
Protected fieldcomponents (Inherited from Entity.)
Public fieldDebugRange
Protected fieldlastOrientation (Inherited from Entity3D.)
Protected fieldlastPosition (Inherited from Entity3D.)
Protected fieldlastTickLerpComponents
Each element can either be a Lerp, a Lerp List or an array of Lerp objects. View code on GitHub
(Inherited from DrawableEntity.)
Top
Properties

  NameDescription
Public propertyAttackType
Public propertyChildren (Inherited from HierarchyEntity3D.)
Public propertyIsActive (Inherited from HierarchyEntity3D.)
Public propertyIsOnCooldown
Public propertyIsPauseable (Inherited from Entity.)
Public propertyIsVisible (Inherited from DrawableEntity.)
Public propertyModel (Inherited from Agent.)
Public propertyName (Inherited from Agent.)
Public propertyNumberOfComponents (Inherited from Entity.)
Public propertyOrientation (Inherited from Entity3D.)
Public propertyParent (Inherited from HierarchyEntity3D.)
Public propertyPosition (Inherited from Entity3D.)
Public propertyRelativeOrientation (Inherited from HierarchyEntity3D.)
Public propertyRelativePosition (Inherited from HierarchyEntity3D.)
Public propertyRenderLayer (Inherited from DrawableEntity.)
Public propertyRotationZ (Inherited from Actor3D.)
Public propertyScale (Inherited from Entity3D.)
Public propertyScaleFactor (Inherited from Actor3D.)
Protected propertyStats (Inherited from Agent.)
Public propertyTimeOfLastAttack
Public propertyType
Public propertyUpdatePriority (Inherited from Entity.)
Top
Events

  NameDescription
Public eventOrientationChanged (Inherited from Actor3D.)
Public eventPositionChanged (Inherited from Actor3D.)
Public eventScaleChanged (Inherited from Actor3D.)
Public eventStatic memberWasBuilt
Top
Remarks

Tests: CreepyTowers.Tests.Towers.TowerPropertiesXmlTests
Examples

17 unit tests call CreepyTowers.Towers.Tower
[Test, CloseAfterFirstFrame]
public void TestTowerPropertiesXml()
{
    var towerProperties = ContentLoader.Load<TowerPropertiesXml>(Xml.TowerProperties.ToString());
    var towerData = towerProperties.Get(TowerType.Acid);
    Assert.AreEqual(1.0f, towerData.AttackFrequency);
    Assert.AreEqual(4.0f, towerData.Range);
    Assert.AreEqual(35.0f, towerData.BasePower);
    Assert.AreEqual(230, towerData.Cost);
    Assert.AreEqual(AttackType.DirectShot, towerData.AttackType);
}
[Test, CloseAfterFirstFrame]
public void NotInitializingTowerDoesntCreateTowerModel()
{
    new Tower(TowerType.Water, Vector3D.Zero);
    Assert.AreEqual(0, EntitiesRunner.Current.GetEntitiesOfType<Model>().Count);
    Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<Tower>().Count);
}
[Test, CloseAfterFirstFrame]
public void InitializingTowerCreatesTowerModel()
{
    var tower = new Tower(TowerType.Water, Vector3D.Zero);
    tower.RenderModel();
    Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<Model>().Count);
    Assert.AreEqual(1, EntitiesRunner.Current.GetEntitiesOfType<Tower>().Count);
}
See Also