internal void OnStateChanged(EnumEntityState beforeState) { foreach (IAiTask task in Tasks) { task.OnStateChanged(beforeState); } }
public virtual void OnStateChanged(EnumEntityState beforeState) { // Reset timer because otherwise the tasks will always be executed upon entering active state if (entity.State == EnumEntityState.Active) { cooldownUntilMs = entity.World.ElapsedMilliseconds + mincooldown + entity.World.Rand.Next(maxcooldown - mincooldown); } }
public override void OnStateChanged(EnumEntityState beforeState, ref EnumHandling handled) { taskManager.OnStateChanged(beforeState); }
/// <summary> /// The event fired when the state of the entity is changed. /// </summary> /// <param name="beforeState">The previous state.</param> /// <param name="handling">How this event was handled.</param> public virtual void OnStateChanged(EnumEntityState beforeState, ref EnumHandling handling) { }