Exemplo n.º 1
0
 internal void OnStateChanged(EnumEntityState beforeState)
 {
     foreach (IAiTask task in Tasks)
     {
         task.OnStateChanged(beforeState);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 3
0
 public override void OnStateChanged(EnumEntityState beforeState, ref EnumHandling handled)
 {
     taskManager.OnStateChanged(beforeState);
 }
Exemplo n.º 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)
 {
 }