Skip to main content

EnchantmentTriggerApplication<T>

An abstract class in Root.Township, Alta.Enchantments.

Runtime part of an EnchantmentTrigger on one item: hooks game events when applied and fires Invoked when the trigger condition is met.

Constructors​

MemberWhat it is
EnchantmentTriggerApplication(EnchantmentApplication enchantment, T settings)Creates an EnchantmentTriggerApplication from enchantment and settings.

Fields​

2 private and internal fields
MemberWhat it is
private uint effectTypeLast effect type (charged, cancelled, executed and so on), sent to clients in 6 bits.
private bool isAppliedWhether ApplyInternal has run, so Apply and Remove only act once.

Properties​

MemberWhat it is
EnchantmentApplication EnchantmentApp { get; private set; }The enchantment this trigger belongs to.
T Settings { get; private set; }The trigger asset.
1 private and internal property
MemberWhat it is
private EnchantmentTrigger Alta.Enchantments.IEnchantmentTriggerApplication.Settings { get; }The settings as a plain EnchantmentTrigger, for the interface.

Events​

MemberWhat it is
event Action<object> InvokedFired when the trigger goes off.

Methods​

MemberWhat it is
void Apply()Hooks the trigger, once.
void CallEvents(EnchantmentTrigger.EffectType effectType)Plays the trigger's effect events (charged, executed, cancelled). The server also sends them to clients.
void Remove()Unhooks the trigger, once.
virtual void SendMessage(Stream stream)Writes or reads the effect type. Clients play the events on reading.
protected abstract void ApplyInternal()Subclass hook for Apply.
protected void Invoke(object data)Fires Invoked with data such as the hit.
protected abstract void RemoveInternal()Subclass hook for Remove.
1 private and internal method
MemberWhat it is
private Transform GetTransformToCallAt(NetworkEntity entity)Returns the entity's transform. Not called in this file.