GameState GetNext(StateCommands command) { //construct transition based on machine current state and the command ScriptPhaseTransition newTransition = new ScriptPhaseTransition(CurrentState, command); //store the location to got to here GameState newState; if (!allTransitions.TryGetValue(newTransition, out newState)) { throw new UnityException("Invalid Game State transition " + CurrentState + " -> " + command); } //return the new state return(newState); }
GameState GetNext(StateCommands command) { //construct transition based on machine current state and the command ScriptPhaseTransition newTransition = new ScriptPhaseTransition(CurrentState, command); //store the location to got to here GameState newState; if (!allTransitions.TryGetValue(newTransition, out newState)) throw new UnityException("Invalid Game State transition " + CurrentState + " -> " + command); //return the new state return newState; }
public override bool Equals(object obj) { ScriptPhaseTransition other = obj as ScriptPhaseTransition; return(other != null && this.currentPhase == other.currentPhase && this.command == other.command); }