public override void InitializeStateMachine() { LerpCartridge cart_lerp = new LerpCartridge(); SelectedState s_selected = new SelectedState(ref ItemData, ref c_itemActiveData); PostselectedState s_postSelected = new PostselectedState(ref ItemData, ref c_itemActiveData, ref cart_lerp); UnselectedState s_unselected = new UnselectedState(ref ItemData, ref c_itemActiveData); PreselectedState s_preselected = new PreselectedState(ref ItemData, ref c_itemActiveData, ref cart_lerp); sm_menuItem = new StateMachine(s_unselected, StateRef.ITEM_UNSELECTED); sm_menuItem.AddState(s_postSelected, StateRef.ITEM_POSTSELECTED); sm_menuItem.AddState(s_selected, StateRef.ITEM_SELECTED); sm_menuItem.AddState(s_preselected, StateRef.ITEM_PRESELECTED); }
/// <summary> /// Initialize the menu's state machine and cartridges, by creating new cartridges, /// providing each state with access to the necessary cartridges and organizing the states into the machine /// </summary> private void InitializeStateMachine() { cart_incr = new IncrementCartridge(); cart_lerp = new LerpCartridge(); MenuDisabledState s_disabled = new MenuDisabledState(); MenuHideState s_hidden = new MenuHideState(ref c_activeMenuData, ref ControllerData, ref cart_lerp); MenuShowState s_shown = new MenuShowState(ref c_activeMenuData, ref ControllerData, ref cart_lerp); MenuReadyState s_ready = new MenuReadyState(ref c_activeMenuData); MenuWaitState s_wait = new MenuWaitState(ref ControllerData, ref c_activeMenuData, ref cart_incr); MenuTickState s_tick = new MenuTickState(ref c_activeMenuData); sm_menuInput = new StateMachine(s_disabled, StateRef.MENU_DISABLED); sm_menuInput.AddState(s_ready, StateRef.MENU_READY); sm_menuInput.AddState(s_wait, StateRef.MENU_WAIT); sm_menuInput.AddState(s_tick, StateRef.MENU_TICK); sm_pauseMenu = new StateMachine(s_hidden, StateRef.MENU_HIDDEN); sm_pauseMenu.AddState(s_shown, StateRef.MENU_SHOWN); }
public PostselectedState(ref BasicMenuItemData basicData, ref MenuItemActiveData activeData, ref LerpCartridge lerpcart) { c_basicData = basicData; c_activeData = activeData; c_lerpCart = lerpcart; }
public MenuHideState(ref ActiveMenuData dataIn, ref BasicMenuControllerData basicDataIn, ref LerpCartridge cart_lerp) { this.c_activeData = dataIn; this.c_basicData = basicDataIn; this.cart_lerp = cart_lerp; }