private void UpdateInternal(EntityUpdateContext context, int updateSlot) { EntityThinkingEventArgs args = new EntityThinkingEventArgs(context, updateSlot); this.OnThinking(args); this.Think(context, updateSlot); this.OnDecided(args); }
/// <summary> /// When implemented in derived class, lets the entity decide how to update its /// logical state. /// </summary> /// <param name="context"> /// The object that describes the situation in the game during thinking. /// </param> /// <param name="updateSlot"> /// Identifier of the entity slot that requires an update. /// </param> public abstract void Think(EntityUpdateContext context, int updateSlot);
/// <summary> /// Creates a new instance of this type. /// </summary> /// <param name="context">The object that describes the context of entity's thinking.</param> /// <param name="updateSlot">The identifier of the slot that is updated.</param> public EntityThinkingEventArgs(EntityUpdateContext context, int updateSlot) { this.Context = context; this.UpdateSlot = updateSlot; }