Exemple #1
0
        public IPage HardCodedPageFromIPage(IPage generic)
        {
            HardCodedPage hcPage = new HardCodedPage(generic);

            switch (generic.MainType)
            {
            case GameState.PageType.Start:
            /*hcPage.Title = "Florine Game";
             * hcPage.Message = "Welcome to Florine where you will guide a fairy through her daily life.";
             * //hcPage.Background = "Start_Page";
             * hcPage.PrimaryOptions = new HardCodedOptionSet()
             * {
             *  Finalizer = _emptyOption("Start")
             * };
             * break;
             */
            case GameState.PageType.Char_Creation:
                // Cheat
                hcPage.Title = "Character Creation";
                //hcPage.Background = "Char_Creation";
                hcPage.PrimaryOptions = new HardCodedOptionSet()
                {
                    Finalizer = _emptyOption("Continue")
                };
                break;

            case GameState.PageType.Game_Loader:
                //hcPage.Title = "...";
                //hcPage.Message = "Choose up to 2";
                //hcPage.Background = "Start_Page";
                hcPage.PrimaryOptions = new HardCodedOptionSet()
                {
                    Finalizer = _emptyOption("Continue")
                };
                break;

            case GameState.PageType.Day_Intro:
                hcPage.Title = "A New Day!";
                if (Day == 0)
                {
                    hcPage.Message = "Welcome to a new day. Let's see what today holds!";
                }
                else if (_state.Player.Yesterday.Calories > _state.Player.TargetCalories * 1.3)
                {
                    hcPage.Message = "Tip:\n" + _state.Player.Name + " will earn more happiness points if her Calories finish in the green.";
                }
                else if (Iron.RatioRDV(_state.Player.Yesterday.Nutrients["Iron"]) < .5)
                {
                    hcPage.Message = "Tip:\n" + _state.Player.Name + " can get Iron from meat, peas, and fortified grains.";
                }
                else if (Folic_Acid.RatioRDV(_state.Player.Yesterday.Nutrients["Folic Acid"]) < .5)
                {
                    hcPage.Message = "Tip:\n If " + _state.Player.Name + " is having trouble getting enough Folic Acid, try eating more greens.";
                }
                else
                {
                    switch (Day)
                    {
                    default:
                        hcPage.Message = "Welcome to a new day. Let's see what today holds!";
                        break;

                    //case 2:
                    //    hcPage.Message = _state.Player.Name + " doesn’t need to eat a lot to feel full - try eating more Fiber.";
                    //    break;
                    case 1:
                        hcPage.Message = "Tip:\n" + _state.Player.Name + " will earn more happiness points if her Calories finish in the green.";
                        break;

                    case 2:
                        hcPage.Message = "Tip:\n" + _state.Player.Name + " can get Iron from meat, peas, and fortified grains.";
                        break;
                        //case 3:
                        //    hcPage.Message = "Tip:\n If " + _state.Player.Name + " is having trouble getting enough Folic Acid, try eating more greens.";
                        //    break;
                    }
                }
                Day++;
                //hcPage.Background = "Start_Page";
                hcPage.PrimaryOptions = new HardCodedOptionSet()
                {
                    Finalizer = _emptyOption("Start Day")
                };
                break;

            case GameState.PageType.Select_Meal:
                //hcPage.Title = "Load Game";

                HardCodedOptionSet PrimaryOptions = new HardCodedOptionSet()
                {
                    Finalizer      = _emptyOption("Done"),
                    SelectionLimit = 2
                };
                hcPage.Title = generic.SubType.ToString();

                //Background
                switch (generic.SubType)
                {
                case GameState.PageSubType.None:
                    break;

                case GameState.PageSubType.Setup:
                    break;

                case GameState.PageSubType.Daily:
                    hcPage.Title = "Daily Activity";
                    break;

                case GameState.PageSubType.Breakfast:
                    PrimaryOptions.SelectionLimit = 2;
                    if (Day == 1)
                    {
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Eggs, Bacon, and Toast"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["White Toast"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Toaster Pastry"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Fruit"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Pancakes"]].GetOption());
                    }
                    else if (Day == 2)
                    {
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Cereal"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Fruit"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Wheat Toast"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Pancakes"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Eggs"]].GetOption());
                    }
                    break;

                case GameState.PageSubType.Lunch:
                    PrimaryOptions.SelectionLimit = 3;
                    if (Day == 1)
                    {
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Cinnamon Roll"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Hamburger Combo"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Instant Noodles"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Turkey Sandwich"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Tacos"]].GetOption());
                    }
                    else if (Day == 2)
                    {
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Sandwich with Chips"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Hamburger"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Salad"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Fruit Smoothie"]].GetOption());
                        PrimaryOptions.Add(_foodstuffs[_foodIdx["Tacos"]].GetOption());
                    }
                    else
                    {
                        List <string> LunchOptions = new List <string>()
                        {
                            "Hamburger",
                            "Instant Noodles",
                            "Meatball Sub",
                            "Peanut Butter & Jelly",
                            "Pepperoni Pizza Slice",
                            "Vegetable Soup",
                            "Spaghetti",
                            "Spaghetti w/ Meatballs",
                            "Sushi Serving",
                            "Tacos",
                            "Donuts",
                        };
                        for (int i = 0; i < 5; ++i)
                        {
                            int lOpt = r.Next(LunchOptions.Count);
                            PrimaryOptions.Add(_foodstuffs[_foodIdx[LunchOptions[lOpt]]].GetOption());
                            LunchOptions.RemoveAt(lOpt);
                        }
                    }
                    break;

                case GameState.PageSubType.Dinner:
                    List <string> DinnerOptions = new List <string>()
                    {
                        "Hamburger",

                        "Instant Noodles",
                        "Lamb Chops",

                        "Pepperoni Pizza Slice",
                        "Vegetable Soup",
                        "Spaghetti",
                        "Spaghetti w/ Meatballs",
                        "Sushi Serving",
                        "Tacos",
                        "Donuts",
                    };

                    for (int i = 0; i < 5; ++i)
                    {
                        if (i == 1 && Day == 2)
                        {
                            PrimaryOptions.Add(_foodstuffs[_foodIdx["Chocolate Ice Cream"]].GetOption());
                        }
                        else if (i == 3 && Day == 2)
                        {
                            PrimaryOptions.Add(_foodstuffs[_foodIdx["Meatball Sub"]].GetOption());
                        }
                        else
                        {
                            int lOpt = r.Next(DinnerOptions.Count);
                            PrimaryOptions.Add(_foodstuffs[_foodIdx[DinnerOptions[lOpt]]].GetOption());
                            DinnerOptions.RemoveAt(lOpt);
                        }
                    }

                    PrimaryOptions.SelectionLimit = 3;
                    break;
                }
                if (PrimaryOptions.Count == 0)
                {
                    for (int idx = 0; idx < _foodstuffs.Count && idx < 5; ++idx)
                    {
                        PrimaryOptions.Add(_foodstuffs[idx].GetOption());
                    }
                }
                PrimaryOptions.Add(new NoSelectFoodOption("Nothing Prepared")
                {
                    Enabled = false
                });
                hcPage.Message +=
                    "Choose Up To " + PrimaryOptions.SelectionLimit.ToString();
                hcPage.PrimaryOptions = PrimaryOptions;
                break;

            case GameState.PageType.Summarize_Meal:
                hcPage.Title = hcPage.SubType.ToString() + " Results";
                //hcPage.Message = "We shouldn't be seeing this.";
                //hcPage.Background = "Start_Page";
                hcPage.PrimaryOptions = new HardCodedOptionSet()
                {
                    Finalizer = _emptyOption("Continue")
                };
                break;

            // TODO: Summarize Meal is actually 2 pages.
            case GameState.PageType.Select_Activity:
                hcPage.Title          = "Evening";
                hcPage.Message        = "Select An Activity";
                hcPage.PrimaryOptions = GetDailyActivities();
                break;

            case GameState.PageType.Summarize_Activity:
                hcPage.Title = generic.SubType.ToString() + " Summary";
                switch (generic.SubType)
                {
                case GameState.PageSubType.Breakfast:
                    hcPage.Title = "Morning Update";
                    break;

                case GameState.PageSubType.Lunch:
                    hcPage.Title = "Afternoon Update";
                    break;

                case GameState.PageSubType.Dinner:
                    hcPage.Title = "Daily Summary";
                    break;
                }
                if (generic.SubType == GameState.PageSubType.Daily)
                {
                    if (generic.AppliedOptions.Count > 0)
                    {
                        foreach (IGameOption igo in generic.AppliedOptions)
                        {
                            Activity _act = igo as Activity;
                            if (_act != null)
                            {
                                hcPage.Title = _act.OptionName;
                            }
                        }
                    }
                }

                //hcPage.Background = "Start_Page";
                hcPage.PrimaryOptions = new HardCodedOptionSet()
                {
                    Finalizer = _emptyOption("Continue")
                };
                break;

            case GameState.PageType.Summarize_Day:
                hcPage.Title = "Activity Results";
                //hcPage.Background = "Start_Page";
                hcPage.PrimaryOptions = new HardCodedOptionSet()
                {
                    Finalizer = _emptyOption("Continue")
                };
                break;

            default:
                hcPage.Title   = "== Florine ==";
                hcPage.Message = "Unexpected Value " + generic.MainType.ToString();
                break;
            }
            // hcPage.Title = "(" + Day.ToString() + ")" + hcPage.Title;
            return(hcPage);
        }