Beispiel #1
0
        public MenuRecordState(IGameAction gameAction, FDPosition position) : base(gameAction, position)
        {
            // Save Game
            this.SetMenu(0, MenuItemId.RecordSave, gameAction.CanSaveGame(), () =>
            {
                PromptPack prompt = new PromptPack(0, "");
                SendPack(prompt);
                this.subState = SubRecordState.SaveGame;

                return(StateOperationResult.None());
            });

            // Game Info
            this.SetMenu(1, MenuItemId.RecordInfo, true, () =>
            {
                int turnId         = gameAction.TurnId();
                int chapterId      = gameAction.ChapterId();
                ShowBriefPack pack = new ShowBriefPack();
                SendPack(pack);

                return(StateOperationResult.None());
            });

            // Load Game
            this.SetMenu(2, MenuItemId.RecordLoad, true, () =>
            {
                PromptPack prompt = new PromptPack(0, "");
                SendPack(prompt);
                this.subState = SubRecordState.LoadGame;

                return(StateOperationResult.None());
            });

            // Quit Game
            this.SetMenu(3, MenuItemId.RecordQuit, true, () =>
            {
                PromptPack prompt = new PromptPack(0, "");
                SendPack(prompt);
                this.subState = SubRecordState.QuitGame;

                return(StateOperationResult.None());
            });
        }
 public override bool IsMatched(IGameAction gameAction)
 {
     return(gameAction.TurnId() == TurnId && gameAction.TurnPhase() == TurnPhase);
 }