public GameState() { backgroundColor = new Color(0, 100, 30); nextstate = States.NONE; stateaction = StateActions.NONE; mouseInteractionList = new List <IMouseInteraction>(); }
private void InitializeActions() { AccountControllerTest accountTest = new AccountControllerTest(); stateActions = new StateActions(); AutorizationCheck(AutorizationType); if (AutorizationType == AutorizationType.Authorize) { stateActions.CreateHeaders(AutorizationType, LoginResult); } }
// Use this for initialization void Start() { // currentGen is used to kee track of each generation of player character currentGen = 0; // Array of players characters. Set at 10. player = new Player[10]; player[currentGen] = new Player(currentGen); // Inital state is set here. state = startingState; // actions object allows certain states to alter UI and game values actions = new StateActions(); // Update UI elements for initial state. textNarrative.text = state.GetStateStory(); textStatsAndInv.text = player[currentGen].GetPlayerText(); }
public void Step() { //Search For State And Condition: var state = StateActions.First(f => f.State == CurrentState && f.Condition == CurrentNode.Value); //Write Value CurrentNode.Value = state.WriteValue; //Move One Slot if (state.MovementType == Day25MovementTypeEnum.Right) { CurrentNode = CurrentNode.Next ?? CurrentNode.List.AddAfter(CurrentNode, 0); } else { CurrentNode = CurrentNode.Previous ?? CurrentNode.List.AddBefore(CurrentNode, 0); } //Continue with new state CurrentState = state.MoveToState; }
public void MainLoop(RenderWindow window) { StateActions peekedState = statesqueue.Peek().stateaction; switch (peekedState) { case StateActions.PUSH: statesqueue.Peek().ReleaseGui(); PushState(); break; case StateActions.POP: PopState(); break; case StateActions.POPNPUSH: statesqueue.Peek().ReleaseGui(); PopState(); PushState(); break; case StateActions.NONE: break; default: break; } if (statesqueue.Count == 0) { Program.exit = true; return; } statesqueue.Peek().Update(); statesqueue.Peek().Render(window); }