예제 #1
0
 internal void OnStateChanged(EnumEntityState beforeState)
 {
     foreach (IAiTask task in Tasks)
     {
         task.OnStateChanged(beforeState);
     }
 }
예제 #2
0
 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);
     }
 }
예제 #3
0
 public override void OnStateChanged(EnumEntityState beforeState, ref EnumHandling handled)
 {
     taskManager.OnStateChanged(beforeState);
 }
예제 #4
0
 /// <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)
 {
 }