Class EntityTemplate
An immutable template with nullable definition slots; null inherits its parent's slot.
public sealed class EntityTemplate
- Inheritance
-
EntityTemplate
- Inherited Members
Constructors
EntityTemplate(string, string, HealthDef, ArmorDef, MotionDef, PathFollowDef, BountyDef, MeleeDef, RangedDef, TowerDef, BarracksDef, SoldierDef, HeroDef, ProjectileDef, AuraDef, StatusImmunityDef, FlyingDef, RenderDef)
Creates template data; resolution happens when a registry is constructed.
public EntityTemplate(string id, string baseId = null, HealthDef health = null, ArmorDef armor = null, MotionDef motion = null, PathFollowDef pathFollow = null, BountyDef bounty = null, MeleeDef melee = null, RangedDef ranged = null, TowerDef tower = null, BarracksDef barracks = null, SoldierDef soldier = null, HeroDef hero = null, ProjectileDef projectile = null, AuraDef aura = null, StatusImmunityDef statusImmunity = null, FlyingDef flying = null, RenderDef render = null)
Parameters
idstringbaseIdstringhealthHealthDefarmorArmorDefmotionMotionDefpathFollowPathFollowDefbountyBountyDefmeleeMeleeDefrangedRangedDeftowerTowerDefbarracksBarracksDefsoldierSoldierDefheroHeroDefprojectileProjectileDefauraAuraDefstatusImmunityStatusImmunityDefflyingFlyingDefrenderRenderDef
Properties
Armor
Defense definition.
public ArmorDef Armor { get; }
Property Value
Aura
Optional region emitter definition.
public AuraDef Aura { get; }
Property Value
Barracks
Barracks definition.
public BarracksDef Barracks { get; }
Property Value
BaseId
Optional parent identifier.
public string BaseId { get; }
Property Value
Bounty
Reward and exit cost definition.
public BountyDef Bounty { get; }
Property Value
CustomData
Immutable custom definition slots, inherited by type with child overrides.
public TemplateData CustomData { get; }
Property Value
Flying
Flying marker.
public FlyingDef Flying { get; }
Property Value
Health
Health definition.
public HealthDef Health { get; }
Property Value
Hero
Independent hero behavior definition.
public HeroDef Hero { get; }
Property Value
Id
Unique template identifier.
public string Id { get; }
Property Value
Melee
Melee definition.
public MeleeDef Melee { get; }
Property Value
Motion
Movement definition.
public MotionDef Motion { get; }
Property Value
PathFollow
Path traversal definition.
public PathFollowDef PathFollow { get; }
Property Value
Projectile
Projectile definition.
public ProjectileDef Projectile { get; }
Property Value
Ranged
Ranged attack definitions.
public RangedDef Ranged { get; }
Property Value
Render
View lookup definition.
public RenderDef Render { get; }
Property Value
Rules
Optional additional behavior slots, inherited as one immutable bundle.
public EntityRulesDef Rules { get; }
Property Value
Soldier
Soldier definition.
public SoldierDef Soldier { get; }
Property Value
StatusImmunity
Effect identity and family immunities.
public StatusImmunityDef StatusImmunity { get; }
Property Value
Tower
Tower economy definition.
public TowerDef Tower { get; }
Property Value
Methods
WithCustomData<T>(T)
Copies the template and adds or replaces one custom definition slot.
public EntityTemplate WithCustomData<T>(T value) where T : class
Parameters
valueT
Returns
Type Parameters
T
Examples
var custom = template.WithCustomData(new ShieldDef(100));
WithRules(EntityRulesDef)
Creates a template copy with additional behavior data.
public EntityTemplate WithRules(EntityRulesDef rules)
Parameters
rulesEntityRulesDef