/// <summary> /// Updates the action over time. /// </summary> public virtual void Update(GameTime gameTime) { // update the current stage UpdateCurrentStage(gameTime); // if the action is ready for the next stage, then advance if ((stage != CombatActionStage.NotStarted) && (stage != CombatActionStage.Complete) && IsReadyForNextStage) { switch (stage) { case CombatActionStage.Preparing: stage = CombatActionStage.Advancing; break; case CombatActionStage.Advancing: stage = CombatActionStage.Executing; break; case CombatActionStage.Executing: stage = CombatActionStage.Returning; break; case CombatActionStage.Returning: stage = CombatActionStage.Finishing; break; case CombatActionStage.Finishing: stage = CombatActionStage.Complete; break; } StartStage(); } }
/// <summary> /// Start executing the combat action. /// </summary> public virtual void Start() { // set the state to the first step stage = CombatActionStage.Preparing; StartStage(); }
/// <summary> /// Reset the action so that it may be started again. /// </summary> public virtual void Reset() { // set the state to not-started stage = CombatActionStage.NotStarted; }