// Update is called once per frame void Update() { switch (state) { case PrimaryState.Pop: state = PrimaryState.Dead; break; } transform.rotation = Quaternion.Euler(new Vector3(0, 0, transform.rotation.eulerAngles.z)); transform.position = new Vector3(transform.position.x, transform.position.y, originalLocation.z); }
public bool IsActiveState(TerrainType type, ref IState successorState) { switch (type) { case TerrainType.Standard: throw new Exception("Illegal Terrain"); case TerrainType.Convex: successorState = new PrimaryState(); return(true); case TerrainType.Wall: return(true); case TerrainType.Concave: successorState = new SecondaryState(); return(true); } return(false); }
public State(State oldState, State newState) { FreshOrderbooksState = newState.FreshOrderbooksState ?? oldState.FreshOrderbooksState; PrimaryState = newState.PrimaryState ?? oldState.PrimaryState; }
public State(FreshOrderbooksState freshOrderbooksState = null, PrimaryState primaryState = null) { FreshOrderbooksState = freshOrderbooksState; PrimaryState = primaryState; }
/// <summary> /// Given a PrimaryState pState, this function will set the primary state to pState. /// </summary> /// <param name="pState">The new PrimaryState.</param> public void setPrimaryState(PrimaryState pState) { this.primary = pState; }
/// <summary> /// Creates a new State with the primary state being set to Idle and the secondary state list being empty. /// </summary> public State() { this.primary = PrimaryState.Idle; secondaryStates = new List <SecondaryState>(); }
/// <summary> /// </summary> /// <param name="state"></param> /// <returns>Returns true if the PrimaryState state of State is equal to "state"</returns> public bool inState(PrimaryState state) { return(this.primary == state); }
/// <summary> /// Creates a new State with the primary state being set to Idle and the secondary state list being empty. /// </summary> public State() { this.primary = PrimaryState.Idle; secondaryStates = new List<SecondaryState>(); }
/// <summary> /// </summary> /// <param name="state"></param> /// <returns>Returns true if the PrimaryState state of State is equal to "state"</returns> public bool inState(PrimaryState state) { return this.primary == state; }
public void Pop() { state = PrimaryState.Dead; }