コード例 #1
0
    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);
    }
コード例 #2
0
ファイル: GameWorld.cs プロジェクト: Yvorcer/Tetris
    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;
    }
コード例 #3
0
    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);
    }
コード例 #4
0
ファイル: GameEngine.cs プロジェクト: psdimitrov/Sudoku
        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;
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        private void StateEnter(HelpState stateEnter)
        {
            if (OnStateEnter != null)
            {
                OnStateEnter(stateEnter);
            }

            ActiveItem((int)stateEnter);
        }
コード例 #7
0
        private void OnEnable()
        {
            m_MenuSM.OnStateEnter += HandleMenuStateEnter;

            currentState = HelpState.Page_0;
            this.State   = currentState;

            HI5_Calibration.ResetCalibration();
        }
コード例 #8
0
ファイル: HelpPanel.cs プロジェクト: matthewnauman/shape-shop
 public void Off(bool isFade)
 {
     if (isFade)
     {
         helpState = HelpState.FadeOut;
     }
     else
     {
         helpState = HelpState.Off;
         helpAlpha = 0;
     }
 }
コード例 #9
0
ファイル: Help.cs プロジェクト: inTester/DreaMimic
        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;
            }
        }
コード例 #10
0
 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      = "";
 }
コード例 #11
0
        private void HandleMenuStateEnter(MenuState state)
        {
            if (state == MenuState.Help)
            {
                currentState = HelpState.Page_0;
            }

            if (state != MenuState.Help)
            {
                currentState = HelpState.Exit;
            }
        }
コード例 #12
0
ファイル: Help.cs プロジェクト: inTester/DreaMimic
 //キー設定
 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);
     }
 }
コード例 #13
0
    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();
        }
    }
コード例 #14
0
ファイル: HelpPanel.cs プロジェクト: matthewnauman/shape-shop
        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;
            }
        }
コード例 #15
0
        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);
        }
コード例 #16
0
ファイル: EquipmentManager.cs プロジェクト: Jonas90/iss
    // =============================================================================
    // =============================================================================
    // 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;
                }
            }
        }
    }
コード例 #17
0
    // =============================================================================



    // =============================================================================
    // 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;
                }
            }
        }
    }
コード例 #18
0
ファイル: HelpPanel.cs プロジェクト: matthewnauman/shape-shop
 public void On()
 {
     helpState = HelpState.FadeIn;
 }
コード例 #19
0
ファイル: EquipmentManager.cs プロジェクト: Jonas90/iss
    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;
    }
コード例 #20
0
 private void StateExit(HelpState stateExit)
 {
 }
コード例 #21
0
ファイル: Help.cs プロジェクト: inTester/DreaMimic
 public void Init(SoundEffect se)
 {
     nowHelpState = HelpState.CLOSE;
     this.se      = se;
 }
コード例 #22
0
ファイル: Help.cs プロジェクト: inTester/DreaMimic
 public void TotuEnd()
 {
     nowHelpState = HelpState.OPEN;
 }