private bool TryChange(int i) { if (i == -1 || (Equipments[i].IsAvailable() && !Equipments[i].IsEquipped())) { if (CurrentShown > -1) { Equipments[CurrentShown].TriggerStored(); } if (i > -1) { Equipments[i].TriggerStored(); } CurrentShown = i; if (State == HelpState.ShowHelp) { State = HelpState.HideHelp; SetButtonsOnAllSERVERONLY(""); } return(true); } return(false); }
public GameWorld() { random = new Random(); gameState = GameState.GameOverScreen; // Load in the Fonts font = TetrisGame.ContentManager.Load <SpriteFont>("Fonts/8-BitFontSmall"); fontBig = TetrisGame.ContentManager.Load <SpriteFont>("fonts/8-BitFontBig"); // Load in the Sounds selectSound = TetrisGame.ContentManager.Load <SoundEffect>("Sounds/Select"); gameOverSound = TetrisGame.ContentManager.Load <SoundEffect>("Sounds/GameOver"); nextBlock = new NextBlock(); grid = new TetrisGrid(); block = new Block(); score = new Score(); hold = new Hold(); //States title = new TitleScreenState(); over = new GameOverState(); help = new HelpState(); over.grid = grid; over.score = score; block.Grid = grid; grid.Gblock = block; score.grid = grid; score.font = font; hold.font = font; title.fontBig = fontBig; over.fontBig = fontBig; help.fontBig = fontBig; }
private static GameState ResolveState(GameStateEnum state, GameController controller, GameState previous) { GameState result; switch (state) { case GameStateEnum.Help: result = new HelpState(controller, previous); break; case GameStateEnum.HighScores: throw new NotImplementedException(); case GameStateEnum.InGame: result = new InGameState(controller, previous); break; case GameStateEnum.MainMenu: result = new MainMenuState(controller, previous); break; case GameStateEnum.MapSelection: throw new NotImplementedException(); case GameStateEnum.PlaceUnits: throw new NotImplementedException(); default: throw new InvalidProgramException("Unreacheable path."); } return(result); }
private void MainMenu_ButtonClicked(object sender, ButtonClickedEventArgs eventargs) { switch (eventargs.Button) { case ButtonNames.Play: var newGameState = new GameState(StateManager.CurrentState, eventargs.Time); newGameState.LoadButtons(); StateManager.CurrentState = newGameState; break; case ButtonNames.Solve: var newSolveState = new SolveState(StateManager.CurrentState); newSolveState.LoadButtons(); StateManager.CurrentState = newSolveState; break; case ButtonNames.Help: var newHelpState = new HelpState(StateManager.CurrentState); newHelpState.LoadButtons(); StateManager.CurrentState = newHelpState; break; case ButtonNames.About: var newAboutState = new AboutState(StateManager.CurrentState); newAboutState.LoadButtons(); StateManager.CurrentState = newAboutState; break; } }
internal void SerializeAlfaChat() { if (this.helpState != HelpState.TALKING) { return; } GameClient _Reporter = Reporter; if (_Reporter == null) { this.helpState = HelpState.FINISHED; return; } GameClient _Alfa = Alfa; if (_Alfa == null) { this.helpState = HelpState.FINISHED; return; } ServerMessage onGuideSessionStarted = new ServerMessage(Outgoing.onGuideSessionStarted); onGuideSessionStarted.AppendUInt(_Reporter.GetHabbo().Id); onGuideSessionStarted.AppendString(_Reporter.GetHabbo().Username); onGuideSessionStarted.AppendString(_Reporter.GetHabbo().Look); onGuideSessionStarted.AppendUInt(_Alfa.GetHabbo().Id); onGuideSessionStarted.AppendString(_Alfa.GetHabbo().Username); onGuideSessionStarted.AppendString(_Alfa.GetHabbo().Look); _Reporter.SendMessage(onGuideSessionStarted); _Alfa.SendMessage(onGuideSessionStarted); }
private void StateEnter(HelpState stateEnter) { if (OnStateEnter != null) { OnStateEnter(stateEnter); } ActiveItem((int)stateEnter); }
private void OnEnable() { m_MenuSM.OnStateEnter += HandleMenuStateEnter; currentState = HelpState.Page_0; this.State = currentState; HI5_Calibration.ResetCalibration(); }
public void Off(bool isFade) { if (isFade) { helpState = HelpState.FadeOut; } else { helpState = HelpState.Off; helpAlpha = 0; } }
public void HelpOpen(Action goTitle, Action helpTuto, Action enemyUIChecnge) { switch (nowHelpState) { case HelpState.CLOSE: if (input.InputKey((int)KeysNum.H)) { se.Play(); nowHelpState = HelpState.OPEN; } break; case HelpState.OPEN: if (input.InputKey((int)KeysNum.H)) { se.Play(); nowHelpState = HelpState.CLOSE; } else if (input.InputKey((int)KeysNum.Y)) { se.Play(); helpTuto(); nowHelpState = HelpState.TUTO; } else if (input.InputKey((int)KeysNum.N)) { se.Play(); goTitle(); } else if (input.InputKey((int)KeysNum.U)) { se.Play(); nowHelpState = HelpState.KEY; } else if (input.InputKey((int)KeysNum.J)) { //切り替え } break; case HelpState.TUTO: break; case HelpState.KEY: KeyConf(); enemyUIChecnge(); //プレイヤーが動かないと変わらないので強制呼び出し break; default: break; } }
internal Help(UInt32 reporterId, String reportMessage) { this.ReporterId = reporterId; this.reportMessage = reportMessage; this.HelperId = 0; this.nullAlfas = new List <UInt32>(); this.helpState = HelpState.SEARCHING_USER; this.NeedUpdate = false; this.chatQueueMessage = new List <HelpChatMessage>(); this.addChatMessage = new Queue(); this.AlfaChatLog = ""; }
private void HandleMenuStateEnter(MenuState state) { if (state == MenuState.Help) { currentState = HelpState.Page_0; } if (state != MenuState.Help) { currentState = HelpState.Exit; } }
//キー設定 void KeyConf() { if (input.InputKey((int)KeysNum.U)) { se.Play(); nowHelpState = HelpState.OPEN; } else if (input.InputKey((int)KeysNum.KC)) { ButtonChenge((int)KeysNum.KC); } else if (input.InputKey((int)KeysNum.DC)) { ButtonChenge((int)KeysNum.DC); } }
void HelpCommand(string[] _args) { HelpState helpState = null; if (_args.Length == 1) { helpState = new HelpState(_args[0]); helpState.TerminalEnterState(); } else if (_args.Length == 0) { //HELP helpState = new HelpState(""); helpState.TerminalEnterState(); } }
public void Update(GameTime gameTime) { switch (helpState) { case HelpState.FadeOut: if (helpAlpha == 0) { helpState = HelpState.Off; return; } helpAlpha -= ALPHA_STEP; if (helpAlpha <= 0) { helpAlpha = 0; helpState = HelpState.Off; } break; case HelpState.Off: break; case HelpState.FadeIn: if (helpAlpha == 1) { helpState = HelpState.On; return; } helpAlpha += ALPHA_STEP; if (helpAlpha >= 1) { helpAlpha = 1; helpState = HelpState.On; } break; case HelpState.On: break; } }
internal void sendMessage(ServerMessage Message) { GameClient _Reporter = Reporter; if (_Reporter == null) { this.helpState = HelpState.FINISHED; return; } GameClient _Alfa = Alfa; if (_Alfa == null) { this.helpState = HelpState.FINISHED; return; } _Reporter.SendMessage(Message); _Alfa.SendMessage(Message); }
// ============================================================================= // ============================================================================= // METHODS -------------------------------------------------------------------- public void Take( Equipment equipment ) { Debug.Log ("----- is in EquipmentManager -> Take (Equipment equipment):"+equipment); if ( !equipment ) { return; } equipment.SetAvailable ( true ); // see also EquipmentAtMercy if ( equipment.IsAvailable () ) { // important for EquipmentAtMercy for ( int i = 0; i < Equipments.Length; i++ ) { if ( Equipments[i] == equipment ) { Equipments[i].TriggerStored (); if ( !( Equipments[i] as EquipmentAsGui ) ) { if ( CurrentShown >= 0 ) { Equipments[CurrentShown].TriggerStored (); } CurrentShown = i; if ( State == HelpState.NoEquipment ) { State = HelpState.ShowHelp; SetButtonsOnAllSERVERONLY ( GetButtonString () ); } } continue; } } } }
// ============================================================================= // ============================================================================= // METHODS -------------------------------------------------------------------- public void Take(Equipment equipment) { Debug.Log("----- is in EquipmentManager -> Take (Equipment equipment):" + equipment); if (!equipment) { return; } equipment.SetAvailable(true); // see also EquipmentAtMercy if (equipment.IsAvailable()) { // important for EquipmentAtMercy for (int i = 0; i < Equipments.Length; i++) { if (Equipments[i] == equipment) { Equipments[i].TriggerStored(); if (!(Equipments[i] as EquipmentAsGui)) { if (CurrentShown >= 0) { Equipments[CurrentShown].TriggerStored(); } CurrentShown = i; if (State == HelpState.NoEquipment) { State = HelpState.ShowHelp; SetButtonsOnAllSERVERONLY(GetButtonString()); } } continue; } } } }
public void On() { helpState = HelpState.FadeIn; }
private bool TryChange( int i ) { if ( i == -1 || ( Equipments[i].IsAvailable () && !Equipments[i].IsEquipped () ) ) { if ( CurrentShown > -1 ) { Equipments[CurrentShown].TriggerStored (); } if ( i > -1 ) { Equipments[i].TriggerStored (); } CurrentShown = i; if ( State == HelpState.ShowHelp ) { State = HelpState.HideHelp; SetButtonsOnAllSERVERONLY ( "" ); } return true; } return false; }
private void StateExit(HelpState stateExit) { }
public void Init(SoundEffect se) { nowHelpState = HelpState.CLOSE; this.se = se; }
public void TotuEnd() { nowHelpState = HelpState.OPEN; }