/// <summary> /// This state changing function is used for the SEARCH state. The location is where the zombie will be heading. /// </summary> /// <param name="state">This will be "Search", otherwise the destination is ignored.</param> /// <param name="destination">The destination for the search.</param> public void ChangeStateTo(string state, MapBlock destination) { currentState = stateList[state]; if (state.Equals(ZombieStateNames.SEARCH_STATE)) { ((SearchState)currentState).Destination = destination; } }
/// <summary> /// State-changing function for any state except SEARCH. Uses state names from ZombieStateNames.cs. /// </summary> /// <param name="state">Name of state to switch to</param> public void ChangeStateTo(string state) { currentState = stateList[state]; }
public void ChangeStateTo(ZombieState state) { state.player = currentState.player; state.zombie = this; currentState = state; }