Example #1
0
        private IPage _goToPage(GameState.PageType mainType, GameState.PageSubType subType)
        {
            //Get Page from Interface Factory
            _context.SetPage(mainType, subType);
            Activity autoActivity = _foundry.AutomaticActivity(_context);

            if (null != autoActivity)
            {
                _context.ApplyOption(autoActivity);
            }
            return(GetCurrentPage());
        }
Example #2
0
        public bool GetNextGameState(GameState CurrentState,
                                     IGameOption selectedOpt,
                                     out GameState.PageType nextType,
                                     out GameState.PageSubType nextSubType
                                     )
        {
            nextType    = CurrentState.CurrentPage.MainType;
            nextSubType = CurrentState.CurrentPage.SubType;

            switch (CurrentState.CurrentPage.MainType)
            {
            case GameState.PageType.Start:
                // TODO: Actual Switch
                //nextType = GameState.PageType.Char_Creation;
                //nextSubType = GameState.PageSubType.Setup;
                nextType    = GameState.PageType.Day_Intro;
                nextSubType = GameState.PageSubType.Daily;
                return(true);

            case GameState.PageType.Char_Creation:
                nextType    = GameState.PageType.Day_Intro;
                nextSubType = GameState.PageSubType.Daily;
                return(true);

            case GameState.PageType.Day_Intro:
                nextType    = GameState.PageType.Select_Meal;
                nextSubType = GameState.PageSubType.Breakfast;
                return(true);

            case GameState.PageType.Select_Meal:
                nextType = GameState.PageType.Summarize_Meal;
                return(true);

            case GameState.PageType.Summarize_Meal:
                nextType = GameState.PageType.Summarize_Activity;
                //if (CurrentState.CurrentPage.SubType == GameState.PageSubType.Dinner)
                //{
                //    nextType = GameState.PageType.Select_Activity;
                //    nextSubType = GameState.PageSubType.Daily;
                //}
                return(true);

            case GameState.PageType.Select_Activity:
                if (selectedOpt == null ||
                    selectedOpt.SubOptions.Count == 0 ||
                    selectedOpt.SubOptions[0].OptionName == "Home")
                {
                    nextType    = GameState.PageType.Select_Meal;
                    nextSubType = GameState.PageSubType.Dinner;
                }
                else
                {
                    nextType    = GameState.PageType.Summarize_Activity;
                    nextSubType = GameState.PageSubType.Daily;
                }
                return(true);

            case GameState.PageType.Summarize_Activity:
                switch (CurrentState.CurrentPage.SubType)
                {
                case GameState.PageSubType.Breakfast:
                    nextType    = GameState.PageType.Select_Meal;
                    nextSubType = GameState.PageSubType.Lunch;
                    return(true);

                case GameState.PageSubType.Dinner:
                    nextType    = GameState.PageType.Day_Intro;
                    nextSubType = GameState.PageSubType.Daily;
                    return(true);

                case GameState.PageSubType.Lunch:
                    nextType    = GameState.PageType.Select_Activity;
                    nextSubType = GameState.PageSubType.Daily;

                    return(true);

                case GameState.PageSubType.Daily:
                    // Loop if possible
                    if (
                        false == CurrentState.Player.ReadyToEndDay
                        )
                    {
                        nextType    = GameState.PageType.Select_Activity;
                        nextSubType = GameState.PageSubType.Daily;
                        return(true);
                    }
                    nextType    = GameState.PageType.Select_Meal;
                    nextSubType = GameState.PageSubType.Dinner;

                    return(true);
                }
                break;

            case GameState.PageType.Summarize_Day:
                nextType    = GameState.PageType.Day_Intro;
                nextSubType = GameState.PageSubType.Daily;
                return(true);
            }
            return(false);
        }