Inheritance: BoxProperties
Beispiel #1
0
    void Upgrade()
    {
        var endlessGameVariables = GameObject.Find("LevelManager").GetComponent <EndlessGameVariables>();

        if (endlessGameVariables.ReturnMoney() > UpgradeStoveCost)
        {
            float upgradelevel = PlayerPrefs.GetFloat("EndlessStoveUpgrade");

            upgradelevel++;

            PlayerPrefs.SetFloat("EndlessStoveUpgrade", upgradelevel);
            print(PlayerPrefs.GetFloat("EndlessStoveUpgrade"));

            foreach (var t in Stoves)
            {
                Stove stove = t.GetComponent <Stove>();
                stove.Upgrade(upgradelevel);
            }

            endlessGameVariables.AddMoney(-UpgradeStoveCost);
        }

        if (PlayerPrefs.GetFloat("EndlessStoveUpgrade") >= 3)
        {
            UpgradeStoveButton.enabled = false;
        }
    }
Beispiel #2
0
 private Home(int rooms, double bathrooms, Stove stove, InternetConnection internetConnection)
 {
     Rooms     = rooms;
     Bathrooms = (decimal)bathrooms;
     StoveType = stove;
     Internet  = internetConnection;
 }
Beispiel #3
0
 void Awake()
 {
     Instance          = this;
     boilerWaterTemp   = 50f;
     boilerWaterAmt    = 50f;
     boilerHasHotWater = true;
 }
        // Обработчик нажатия кнопки добавления компонентов
        protected void AddComponentButtonClick(object sender, EventArgs e)
        {
            Component newComponent;

            switch (dropDownComponentList.SelectedIndex)
            {
            default:
                newComponent = new TV(nameComponentBox.Text);
                break;

            case 1:
                newComponent = new Fridge(nameComponentBox.Text);
                break;

            case 2:
                newComponent = new Stove(nameComponentBox.Text);
                break;

            case 3:
                newComponent = new Oven(nameComponentBox.Text, 0, 96);
                break;

            case 4:
                newComponent = new MediaCenter(nameComponentBox.Text, 88.8);
                break;
            }

            //int id = (int)Session["NextId"];
            //figuresDictionary.Add(id, newFigure); // Добавление фигуры в коллекцию
            //figuresPanel.Controls.Add(new FigureControl(id, figuresDictionary)); // Добавление графики для фигуры
            //id++;
            //Session["NextId"] = id;


            // проверка заполненности
            // проверка наличия имени
            string name = nameComponentBox.Text;

            if (nameComponentBox.Text == "")
            {
                infoLabel.ForeColor = Color.Red;
                infoLabel.Text      = "Укажите имя компонента!";
            }
            else if (componentList.ContainsKey(name))
            {
                infoLabel.ForeColor = Color.Red;
                infoLabel.Text      = "Такое имя уже существует. Укажите другое имя компонента.";
            }
            else
            {
                infoLabel.Text = "";
                componentList.Add(name, newComponent);
                сomponentPanel.Controls.Add(new ComponentControl(name, componentList));
            }


            Session["Components"] = componentList;
        }
Beispiel #5
0
 private static StoveData GetStoveData(Stove stove)
 {
     if (!stoveDictionary.ContainsKey(stove))
     {
         Logger.LogError($"stoveDictionary is missing stove #{stove.objectRealID}");
         return(stoveDictionary[stove] = new StoveData());
     }
     return(stoveDictionary[stove]);
 }
Beispiel #6
0
        public static void AddInteractions(GameObject obj)
        {
            Grill         grill     = obj as Grill;
            Stove         stove     = obj as Stove;
            Fridge        fridge    = obj as Fridge;
            Microwave     micro     = obj as Microwave;
            FoodProcessor processor = obj as FoodProcessor;

            if (obj != null && obj.Interactions != null)
            {
                if (fridge != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedFridge_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.RemoveInteractionByType(Fridge_Have.Singleton);
                        // obj.Interactions.RemoveAt(0);
                        obj.AddInteraction(OverridedFridge_Have.Singleton);
                        obj.AddInteraction(OverridedFridge_Prepare.PrepareSingleton);
                    }
                }
                else if (micro != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedMicrowave_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.AddInteraction(OverridedMicrowave_Have.Singleton);
                    }
                }
                else if (processor != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedFoodProcessor_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.AddInteraction(OverridedFoodProcessor_Have.Singleton);
                    }
                }
                else if (stove != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedStove_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.AddInteraction(OverridedStove_Have.Singleton);
                    }
                }
                else if (grill != null)
                {
                    InteractionObjectPair i2 = new InteractionObjectPair(OverridedGrill_Have.Singleton, obj);
                    if (!obj.Interactions.Contains(i2))
                    {
                        obj.AddInteraction(OverridedGrill_Have.Singleton);
                    }
                }
            }
        }
Beispiel #7
0
    void Start()
    {
        for (int i = 0; i < (SlotsX * SlotsY); i++)
        {
            Slots.Add(null);
        }

        _database = GameObject.FindGameObjectWithTag("ItemDataBase").GetComponent <ItemDataBase>(); // тут и строкой ниже ищем по тегу база данных и печка и добавляем объекты в таблицу
        stove     = GameObject.FindGameObjectWithTag("Stove").GetComponent <Stove>();               // тут кст могут быть ошибки, если печек будет много, нужно подумать как улучшить
        AddItem(Item.Name.Meat, Item.StateOfIncision.Whole, Item.StateOfPreparing.Raw, false);
        AddItem(Item.Name.Meat, Item.StateOfIncision.Whole, Item.StateOfPreparing.Raw, false);
    }
Beispiel #8
0
        public ActionResult Create(string componentType, string componentName)
        {
            // повторяем выпадающий список - для отображения
            ViewBag.dropDownComponentList = CreateComponentList();

            // проверка заполненности поля для имени
            // проверка наличия имени

            if (componentName == "")
            {
                ViewBag.ErrorNoname = "Укажите имя компонента!";
                return(View());
            }
            else if (componentList.ContainsKey(componentName))
            {
                ViewBag.ErrorContains = "Такое имя уже существует. Укажите другое имя компонента.";
                return(View());
            }
            else
            {
                // определяем выбранный тип компонента, создаем объект
                Component newComponent;
                switch (componentType)
                {
                default:
                    newComponent = new TV(componentName);
                    break;

                case "fridge":
                    newComponent = new Fridge(componentName);
                    break;

                case "stove":
                    newComponent = new Stove(componentName);
                    break;

                case "oven":
                    newComponent = new Oven(componentName, 0, 96);
                    break;

                case "media":
                    newComponent = new MediaCenter(componentName, 88.8);
                    break;
                }

                // добавляем в коллекцию
                componentList.Add(componentName, newComponent);

                // возвращаемся на главную
                return(RedirectToAction("Index"));
            }
        }
Beispiel #9
0
        private void bFurnitAdd_Click(object sender, EventArgs e)
        {
            if (nFurnituraCounter > furnituraPath.Count - 1)
            {
                nFurnituraCounter = 0;
            }
            else if (nFurnituraCounter < 0)
            {
                nFurnituraCounter = furnituraPath.Count - 1;
            }

            try
            {
                InterfaceObject obj = null;
                if (modelsPath[nFurnituraCounter].Contains("fridge"))
                {
                    obj = new Fridge(0, 0, 0, 1, 1, 2);
                }
                else if (modelsPath[nFurnituraCounter].Contains("stove"))
                {
                    obj = new Stove(-1, -1, 0, 0.5, 0.7, 1.5);
                }
                else if (modelsPath[nFurnituraCounter].Contains("table"))
                {
                    obj = new Table(0, 0, 0, 2, 2, 0);
                }
                else if (modelsPath[nFurnituraCounter].Contains("chair"))
                {
                    obj = new Chair(0, 0, 0, 0.5, 0.5, 0);
                }
                else if (modelsPath[nFurnituraCounter].Contains("cupboard"))
                {
                    obj = new Cupboard(0, 0, 0, 1.5, 0.5, 0);
                }

                if (obj != null)
                {
                    obj.LoadModel(modelsPath[nFurnituraCounter]);
                }
                room.AddObj(obj);

                string num = "" + modelsPath[nFurnituraCounter][modelsPath[nFurnituraCounter].Length - 6];
                num += modelsPath[nFurnituraCounter][modelsPath[nFurnituraCounter].Length - 5];
                DataForBD.ListZakazMebTeh.Add(new ObjFurnit(DataForBD.IdZakaz, Convert.ToInt32(num), 0, 0));
            }
            catch (Exception ex)
            {
                MessageBox.Show("Файл повреждён\r\n" + ex, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #10
0
    void Start()
    {
        UpgradeStoveButton.onClick.AddListener(Upgrade);

        if (PlayerPrefs.GetFloat("EndlessStoveUpgrade") >= 3)
        {
            UpgradeStoveButton.enabled = false;
        }
        foreach (var t in Stoves)
        {
            Stove stove        = t.GetComponent <Stove>();
            float upgradelevel = PlayerPrefs.GetFloat("EndlessStoveUpgrade");
            stove.Upgrade(upgradelevel);
        }
    }
Beispiel #11
0
 public void InteractWithStove(Stove stove)
 {
     if (stove.IsAccessible)
     {
         if (Interaction.IsLeft)
         {
             Anim.PlayAnimation(Animations.CloseStoveFromLeft);
         }
         else
         {
             Anim.PlayAnimation(Animations.CloseStoveFromRight);
         }
     }
     else
     {
         Anim.PlayAnimation(Animations.OpenStoveFromLeft);
     }
 }
Beispiel #12
0
        public static void AddButtons(Stove stove)
        {
            if (stove.startedFlashing)
            {
                return;
            }

            Agent agent = stove.interactingAgent;

            if (agent.inventory.HasItem(ItemNameDB.rowIds.Wrench))
            {
                int invItemCount = agent.inventory.FindItem(ItemNameDB.rowIds.Wrench).invItemCount;
                int toolCost     = BMTraitController.ApplyToolCostModifiers(agent, wrenchTamperCost);
                stove.AddButton(
                    text: "UseWrenchToDetonate",
                    extraText: $" ({invItemCount}) -{toolCost}"
                    );
            }
        }
Beispiel #13
0
        public static void TriggerExplosion(Stove stove)
        {
            GameController gc = GameController.gameController;

            if (gc.serverPlayer && !stove.spawnedExplosion)
            {
                stove.spawnedExplosion = true;
                StoveData       stoveData     = GetStoveData(stove);
                PlayfieldObject damagerObject = stoveData.savedDamagerObject;
                Explosion       explosion     = gc.spawnerMain.SpawnExplosion(damagerObject, stove.tr.position, "FireBomb", false, -1, false,
                                                                              stove.FindMustSpawnExplosionOnClients(damagerObject));

                if (stoveData.noOwnCheckCountdown)
                {
                    explosion.noOwnCheck = true;
                }
            }
            gc.audioHandler.Stop(stove, "GeneratorHiss");
        }
Beispiel #14
0
    public void MakeFood()
    {
        var stove = new Stove();

        stove.CookFood();
    }
Beispiel #15
0
    public void FeedChildren()
    {
        var stove = new Stove();

        stove.CookFood();
    }
Beispiel #16
0
 public static void RegisterDamagedBy(Stove stove, PlayfieldObject damagerObject)
 {
     GetStoveData(stove).savedDamagerObject = damagerObject;
 }
    // Use this for initialization
    void Start()
    {
        _dialogueComponents = GameObject.FindGameObjectWithTag("LevelManager").GetComponent <DialogueCompanyComponent>();

        _inventory = GameObject.FindGameObjectWithTag("Inventory").GetComponent <Inventory>();


        _cuttingBoard = GameObject.Find("CuttingBoard").GetComponent <CuttingBoard>();
        _meatGrinder  = GameObject.Find("MeatGrinder").GetComponent <MeatGrinder>();
        _grater       = GameObject.Find("Grater").GetComponent <Grater>();
        _pan          = GameObject.Find("Pan").GetComponent <Pan>();
        _stove        = GameObject.FindGameObjectWithTag("Stove").GetComponent <Stove>();

        _boxWithMeat  = GameObject.Find("BoxWithMeat").GetComponent <Repository>();
        _boxWithBread = GameObject.Find("BoxWithBread").GetComponent <Repository>();

        _stage = 0;

        _dialogues = new Dictionary <Stage, DialogueInfo>
        {
            {
                Stage.Begining, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan2",

                    NameText     = "Сестренка",
                    DialogueText =
                        "Доброе утро, братик! С сегодняшнего дня эта закусочная твоя, надеюсь ты сможешь о ней позаботиться. Давай попробуем сделать дедушкин сэндвич. Сходи на склад и достань мясо из коробки.",
                    NextBtnText     = "Ок",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForMeat;
                    }
                }
            },
            {
                Stage.WaitForMeat, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan2",

                    NameText        = "Сестренка",
                    DialogueText    = "Сейчас прижарь его на сковороде.",
                    NextBtnText     = "Хорошо",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.DropWholeRawMeatInStove;
                    }
                }
            },
            {
                Stage.TakeBreadBeforeMeat, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan",

                    NameText        = "Сестренка",
                    DialogueText    = "Это похоже на мясо? Мне кажется это хлеб. Возьми мясо из соседней коробки!",
                    NextBtnText     = "Угу",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForMeat;
                    }
                }
            },
            {
                Stage.DropWholeRawMeatInStove, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = false,
                    IsAnswer1BtnVisible = true,
                    IsAnswer2Visible    = true,
                    IsAnswer3Visible    = true,

                    AvatarPath = "Avatars/tyan2",

                    NameText           = "Сестренка",
                    DialogueText       = "Хорошо, теперь прожарь его до легкой корочки.",
                    Answer1Text        = "A что будет, если я его пережарю?",
                    Answer2Text        = "Как понять, что мясо готово?",
                    Answer3Text        = "Oкей",
                    Answer1BtnCallback = () =>
                    {
                        _stage = Stage.TalkAboutStateOfPreparing;
                        Close();
                    },
                    Answer2BtnCallback = () =>
                    {
                        _stage = Stage.TalkAboutCookingInStove;
                        Close();
                    },
                    Answer3BtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForWholeFriedMeat;
                    }
                }
            },
            {
                Stage.DropWholeRawMeatInAllAnotherPlaces, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan",

                    NameText     = "Сестренка",
                    DialogueText = "Я же сказала, положи мясо на сковороду!",

                    NextBtnText     = "Хорошо, хорошо...",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.DropWholeRawMeatInStove;
                        _meatGrinder.DeleteItem();
                        _cuttingBoard.DeleteItem();
                        _grater.DeleteItem();
                        _pan.DeleteItem();
                        _inventory.AddItem(Item.Name.Meat, Item.StateOfIncision.Whole, Item.StateOfPreparing.Raw, false);
                    }
                }
            },
            {
                Stage.DropWholeRawMeatInGarbage, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan",

                    NameText     = "Сестренка",
                    DialogueText = "Зачем ты выкинул кусок отличной вырезки в мусорку? Ты ебобо?! Иди и возьми новый кусок мяса!",

                    NextBtnText     = "Ой...",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _boxWithMeat.AddtoRepository(1, Item.Name.Meat);
                        _stage = Stage.WaitForMeat;
                    }
                }
            },
            {
                Stage.AgainTalkWhenDropWholeRawMeatInStove, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = false,
                    IsAnswer1BtnVisible = true,
                    IsAnswer2Visible    = true,
                    IsAnswer3Visible    = true,

                    AvatarPath = "Avatars/tyan2",

                    NameText           = "Сестренка",
                    DialogueText       = "Готов жарить мясо?",
                    Answer1Text        = "A что будет, если я его пережарю?",
                    Answer2Text        = "Как понять, что мясо готово?",
                    Answer3Text        = "Дыа",
                    Answer1BtnCallback = () =>
                    {
                        _stage = Stage.TalkAboutStateOfPreparing;
                        Close();
                    },
                    Answer2BtnCallback = () =>
                    {
                        _stage = Stage.TalkAboutCookingInStove;
                        Close();
                    },
                    Answer3BtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForWholeFriedMeat;
                    }
                }
            },
            {
                Stage.TalkAboutStateOfPreparing, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan",

                    NameText     = "Сестренка",
                    DialogueText = "Оно сгорит, глупенький! Что же оно ещё может сделать?!",

                    NextBtnText     = "Ладно, ладно...",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.AgainTalkWhenDropWholeRawMeatInStove;
                    }
                }
            },
            {
                Stage.TalkAboutCookingInStove, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan2",

                    NameText     = "Сестренка",
                    DialogueText = "Все просто! Когда мясо покраснеет, оно будет готово!",

                    NextBtnText     = "Окей",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.AgainTalkWhenDropWholeRawMeatInStove;
                    }
                }
            },

            {
                Stage.CreateBadMeat, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan",

                    NameText     = "Сестренка",
                    DialogueText = "Братик, ты испортил кусок отличного мяса! Постарайся так больше не делать.",

                    NextBtnText     = "Хорошо",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForWholeFriedMeat;
                    }
                }
            },

            {
                Stage.TakeBreadWhenCreateWholeFriedMeat, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan",

                    NameText     = "Сестренка",
                    DialogueText = "Положи этот кусок хлеба, сейчас он тебе ещё не нужен.",

                    NextBtnText     = "Хорошо",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForWholeFriedMeat;
                    }
                }
            },

            {
                Stage.WaitForWholeFriedMeat, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan2",

                    NameText     = "Сестренка",
                    DialogueText = "Отлично, а сейчас достань кусок хлеба из коробки.",

                    NextBtnText     = "Хорошо",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForBread;
                    }
                }
            },

            {
                Stage.TakeMeatBeforeBread, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan",

                    NameText     = "Сестренка",
                    DialogueText = "Я попросила взять тебя кусок хлеба, а ты взял ещё один кусок мяса. Зачем?",

                    NextBtnText     = "Оу...",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForBread;
                    }
                }
            },

            {
                Stage.WaitForBread, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan2",

                    NameText     = "Сестренка",
                    DialogueText = "Теперь просто сделай бутерброд на рабочем столе. Рецепт бутреброда можно посмотреть в книге рецептов. " +
                                   "(Рабочий стол работает по принципу положил в него нужные ингридиенты, нажал, получил продукт. Однако, если положить туда не те продукты, которые требуются, на выходе получишь что - то совсем иное...)",

                    NextBtnText     = "Хорошо",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForSandwich;
                    }
                }
            },

            {
                Stage.DoBadThing, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan",

                    NameText     = "Сестренка",
                    DialogueText =
                        "Не очень то похоже на сэндвич! Открой книгу рецептов, прочти её и попробуй снова! >_>",

                    NextBtnText     = "Хорошо",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForSandwich;
                    }
                }
            },

            {
                Stage.LostAll, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan",

                    NameText     = "Сестренка",
                    DialogueText =
                        "<_< Ты похерил всю еду на кухне! Фиговый из тебя повар, попробуй ещё раз. >_>",

                    NextBtnText     = "Хорошо",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForSandwich;
                    }
                }
            },

            {
                Stage.WaitForSandwich, new DialogueInfo
                {
                    IsChatPanelVisible  = true,
                    IsAvatarVisible     = true,
                    IsNextBtnVisible    = true,
                    IsAnswer1BtnVisible = false,
                    IsAnswer2Visible    = false,
                    IsAnswer3Visible    = false,

                    AvatarPath = "Avatars/tyan2",

                    NameText     = "Сестренка",
                    DialogueText = "Думаю ты справишься с покупателями в первые дни. Главное не забудь читать книгу рецептов в поисках новых рецептов!",

                    NextBtnText     = "Хорошо",
                    NextBtnCallback = () =>
                    {
                        Close();
                        _stage = Stage.WaitForDroppingSandwichToSister;
                    }
                }
            }
        };
    }
Beispiel #18
0
 public void UnsubscribeToStove(Stove stove)
 {
     stove.OnTopObjectPut -= Cook;
     aSource.Stop();
 }
Beispiel #19
0
 public void SubscribeToStove(Stove stove)
 {
     stove.OnTopObjectPut += Cook;
 }
Beispiel #20
0
        public DomainApp()
        {
            // Créations des Ingrédients
            Ingredient steak    = new Ingredient("Steak", "Refrigérateur");
            Ingredient poulet   = new Ingredient("Poulet", "Refrigérateur");
            Ingredient poisson  = new Ingredient("Poisson", "Refrigérateur");
            Ingredient pain     = new Ingredient("Pain", "Stock d'Ingrédient");
            Ingredient salade   = new Ingredient("Salade", "Stock d'Ingrédient");
            Ingredient tomate   = new Ingredient("Tomate", "Stock d'Ingrédient");
            Ingredient oignon   = new Ingredient("Oignon", "Stock d'Ingrédient");
            Ingredient cheddar  = new Ingredient("Cheddar", "Refrigérateur");
            Ingredient raclette = new Ingredient("Raclette", "Refrigérateur");
            Ingredient sauce    = new Ingredient("Sauce", "Stock d'Ingrédient");

            // Instanciation Object Cuisine Material
            KitchenKnife kitchenKnife      = new KitchenKnife();
            Pans         kitchenCasserolle = new Pans();
            Stove        kitchenPoêle      = new Stove();
            WoodenSpoon  kitchenCuillière  = new WoodenSpoon();
            SaladBowl    kitchenBolSalade  = new SaladBowl();


            // Creation des etapes des recettes
            RecipeStep prepareSteak = new RecipeStep("Cuire le Steak", 1000);

            prepareSteak.IngredientQuantities.Add(new IngredientQuantity(1, steak));
            prepareSteak.ListUstencils.Add(kitchenPoêle);

            RecipeStep preparePoulet = new RecipeStep("Cuire le Poulet", 1000);

            preparePoulet.IngredientQuantities.Add(new IngredientQuantity(1, poulet));
            preparePoulet.ListUstencils.Add(kitchenPoêle);

            RecipeStep preparePoisson = new RecipeStep("Cuire le Poisson", 1000);

            preparePoisson.IngredientQuantities.Add(new IngredientQuantity(1, poisson));
            preparePoisson.ListUstencils.Add(kitchenPoêle);

            RecipeStep prepareVegetables = new RecipeStep("Couper les légumes", 500);

            prepareVegetables.IngredientQuantities.Add(new IngredientQuantity(1, salade));
            prepareVegetables.IngredientQuantities.Add(new IngredientQuantity(2, tomate));
            prepareVegetables.IngredientQuantities.Add(new IngredientQuantity(1, oignon));
            prepareVegetables.ListUstencils.Add(kitchenBolSalade);
            prepareVegetables.ListUstencils.Add(kitchenCuillière);
            prepareVegetables.ListUstencils.Add(kitchenKnife);
            prepareVegetables.PeelIngredient = true;

            RecipeStep prepareRaclette = new RecipeStep("Préparer le frommage à Raclette", 500);

            prepareRaclette.IngredientQuantities.Add(new IngredientQuantity(2, raclette));
            prepareRaclette.ListUstencils.Add(kitchenKnife);
            prepareRaclette.PeelIngredient = true;

            RecipeStep prepareCheddar = new RecipeStep("Préparer le Cheddar", 500);

            prepareCheddar.IngredientQuantities.Add(new IngredientQuantity(2, cheddar));
            prepareCheddar.ListUstencils.Add(kitchenKnife);
            prepareCheddar.PeelIngredient = true;


            RecipeStep assemblerBurger = new RecipeStep("Assembler le Burger", 500);

            assemblerBurger.IngredientQuantities.Add(new IngredientQuantity(1, pain));
            assemblerBurger.IngredientQuantities.Add(new IngredientQuantity(1, sauce));


            // Creations des plats
            Dish burgerClassic = new Dish(1, "Burger Classique");

            burgerClassic.Recipe.Add(prepareVegetables);
            burgerClassic.Recipe.Add(prepareSteak);
            burgerClassic.Recipe.Add(prepareCheddar);
            //burgerClassic.Recipe.Add(assemblerBurger);

            Dish burgerChicken = new Dish(2, "Burger Poulet");

            burgerChicken.Recipe.Add(preparePoulet);
            burgerChicken.Recipe.Add(prepareCheddar);
            burgerChicken.Recipe.Add(prepareVegetables);
            burgerChicken.Recipe.Add(assemblerBurger);

            Dish burgerMountain = new Dish(3, "Burger Montagnard");

            burgerMountain.Recipe.Add(prepareVegetables);
            burgerMountain.Recipe.Add(prepareCheddar);
            burgerMountain.Recipe.Add(prepareSteak);
            //burgerMountain.Recipe.Add(assemblerBurger);

            Dish burgerVegan = new Dish(4, "Burger Vegan");

            burgerVegan.Recipe.Add(prepareVegetables);
            burgerVegan.Recipe.Add(prepareCheddar);
            burgerVegan.Recipe.Add(preparePoisson);
            burgerVegan.Recipe.Add(prepareRaclette);
            burgerVegan.Recipe.Add(assemblerBurger);

            // Ajout des plats dans la liste Menu static
            menu.Add(burgerClassic);
            menu.Add(burgerChicken);
            menu.Add(burgerMountain);
            menu.Add(burgerVegan);
        }
    private void Update()
    {
        transform.position = new Vector3(transform.position.x, 0, transform.position.z);

        if (Input.GetKeyDown(KeyCode.Space))
        {
            Furniture currentFurniture = furnitureDetection.getSelected();

            if (currentFurniture != null)
            {
                Holder currentFurnitureHolder = currentFurniture.GetComponent <Holder>();

                if (myHolder.hasMovable() && !currentFurnitureHolder.hasMovable())
                {
                    MovableObject movable = myHolder.GetMovableObjet();
                    Trash         trash   = currentFurniture.GetComponent <Trash>();
                    if (trash != null)
                    {
                        Food food = movable.GetComponent <Food>();
                        if (food != null)
                        {
                            trash.destroyObject(movable);
                            myHolder.removeMovable();
                            currentFurnitureHolder.setMovable(movable);
                        }

                        Container container = movable.GetComponent <Container>();
                        if (container != null)
                        {
                            container.returnToEmpty();
                        }
                    }
                    else
                    {
                        Stove     stove     = currentFurniture.GetComponent <Stove>();
                        Container container = movable.GetComponent <Container>();
                        if (stove != null && container != null)
                        {
                            myHolder.removeMovable();
                            currentFurnitureHolder.setMovable(movable);
                        }
                        else if (stove == null)
                        {
                            OrganizingPlates organizingPlates = currentFurniture.GetComponent <OrganizingPlates>();
                            Plate            plate            = movable.GetComponent <Plate>();

                            if (organizingPlates != null)
                            {
                                if (plate != null)
                                {
                                    if (plate.plateContent == plateContent.TOMATO || plate.plateContent == plateContent.ONION || plate.plateContent == plateContent.MUSHROOM)
                                    {
                                        currentFurnitureHolder.setMovable(movable);
                                        plate.toEating();
                                        myHolder.removeMovable();

                                        Delivery delivery = currentFurniture.GetComponent <Delivery>();
                                        delivery.receivePlate(plate.plateContent);
                                        delivery.activatePanels();
                                    }
                                }
                            }
                            else
                            {
                                myHolder.removeMovable();
                                currentFurnitureHolder.setMovable(movable);
                            }
                        }
                    }
                }
                else if (myHolder.hasMovable() && currentFurnitureHolder.hasMovable())
                {
                    MovableObject movable = myHolder.GetMovableObjet();
                    Container     pot     = movable.GetComponent <Container>();
                    Plate         plate   = currentFurnitureHolder.GetMovableObjet().GetComponent <Plate>();


                    Container container = currentFurnitureHolder.GetComponentInChildren <Container>();
                    if (container != null)
                    {
                        if (container.verifyFood(movable.gameObject))
                        {
                            Food food = myHolder.GetComponentInChildren <Food>();
                            food.changeToCook();
                            container.addFood(food);
                            myHolder.removeMovable();

                            Cooking cooking = container.GetComponent <Cooking>();
                            cooking.setInitialTime();
                            if (!cooking.isActivated())
                            {
                                cooking.activateCanvas();
                            }
                        }
                    }
                    else
                    {
                        Stove stove = currentFurniture.GetComponent <Stove>();
                        if (stove != null && movable.GetComponent <MovableObject>().GetComponent <Container>() != null)
                        {
                            myHolder.removeMovable();
                            currentFurnitureHolder.setMovable(movable);
                        }
                    }

                    //--------------------------------------------------------

                    if (pot != null && plate != null)
                    {
                        if (pot.canGiveToPlate())
                        {
                            Cooking cooking = pot.GetComponent <Cooking>();
                            plate.receiveContent(cooking.iconCanvas);
                            plate.setPlateContent(pot.getPotContent());
                            pot.returnToEmpty();
                        }
                    }
                    else
                    {
                        Container pot2   = currentFurnitureHolder.GetMovableObjet().GetComponent <Container>();
                        Plate     plate2 = movable.GetComponent <Plate>();
                        if (pot2 != null && plate2 != null)
                        {
                            if (pot2.canGiveToPlate())
                            {
                                Cooking cooking = pot2.GetComponent <Cooking>();
                                plate2.receiveContent(cooking.iconCanvas);
                                plate2.setPlateContent(pot2.getPotContent());
                                pot2.returnToEmpty();
                            }
                        }
                    }
                }
                else if (currentFurnitureHolder.hasMovable() && !myHolder.hasMovable())
                {
                    MovableObject movable = currentFurnitureHolder.GetMovableObjet();
                    Chopper       chopper = currentFurniture.GetComponent <Chopper>();

                    if (chopper != null)
                    {
                        myHolder.setMovable(movable);
                        currentFurnitureHolder.removeMovable();

                        Timing timing = currentFurniture.GetComponent <Timing>();
                        timing.desactivateCanvas();
                        anim.SetBool("chopping", false);
                        chopper.stopChopping();
                    }
                    else
                    {
                        Container container = movable.GetComponent <Container>();

                        if (container != null)
                        {
                            myHolder.setMovable(movable);
                            currentFurnitureHolder.removeMovable();
                        }
                        else
                        {
                            myHolder.setMovable(movable);
                            currentFurnitureHolder.removeMovable();
                        }
                    }
                }
            }
        }

        if (Input.GetKeyDown(KeyCode.LeftShift))
        {
            Furniture currentFurniture = furnitureDetection.getSelected();

            if (currentFurniture != null)
            {
                Holder furnitureHolder = currentFurniture.GetComponent <Holder>();
                if (furnitureHolder != null)
                {
                    MovableAnchor movableA = furnitureHolder.GetComponentInChildren <MovableAnchor>();
                    if (movableA != null)
                    {
                        Food food = movableA.GetComponentInChildren <Food>();
                        if (food != null && (food.getStatus() == FoodStatus.RAW || food.getStatus() == FoodStatus.CUT))
                        {
                            currentChopper = currentFurniture.GetComponent <Chopper>();
                            if (currentChopper != null)
                            {
                                timing = currentFurniture.GetComponent <Timing>();
                                if (timing != null)
                                {
                                    timing.activateCanvas();
                                }
                                myKnife.gameObject.SetActive(true);
                                isChopping = currentChopper.startChopping();
                                anim.SetBool("chopping", isChopping);
                            }
                        }
                    }
                }
            }
        }

        if (Input.GetKeyDown(KeyCode.LeftControl))
        {
            Furniture currentFurniture = furnitureDetection.getSelected();

            if (currentFurniture != null)
            {
                Creator creator         = currentFurniture.GetComponent <Creator>();
                Holder  furnitureHolder = currentFurniture.GetComponent <Holder>();
                if (creator != null && myHolder.movableAnchor.transform.childCount == 0 && furnitureHolder.movableAnchor.transform.childCount == 0)
                {
                    MovableObject movable = creator.createFood();
                    myHolder.setMovable(movable);
                }
            }
        }

        if (Input.GetKeyDown(KeyCode.LeftAlt) && !boost)
        {
            boost = true;
            speed = 0.25f;
        }

        if (boost)
        {
            if (timeBoost >= 0)
            {
                timeBoost -= Time.deltaTime;
                speed      = speed + (-0.15f) * Time.deltaTime;
            }
            else
            {
                boost     = false;
                speed     = 0.1f;
                timeBoost = 1f;
            }
        }
    }
Beispiel #22
0
    //private void OnGUI()
    //{
    //    GUI.Label(new Rect(10, 10, 100, 80), "test float: " + testFloat);
    //}

    public void Save()
    {
        BinaryFormatter binaryFormatter = new BinaryFormatter();
        FileStream      dataFile        = File.Create(Application.persistentDataPath + "/TrainOfBotDataFile.dat");

        Data data = new Data();

        data.testFloat               = 0.0f;
        data.storageRoomBoxPos       = StorageRoomBox.FindObjectOfType <Transform>().position;
        data.testCharacterCanRecieve = true;
        data.testCharacterCanGive    = true;

        //ITEMS
        data.bottleOfBoltsTaken          = BottleOfBolts.FindObjectOfType <BottleOfBolts>().taken;
        data.cabinetKeyTaken             = CabinetKey.FindObjectOfType <CabinetKey>().taken;
        data.chefsSpoonTaken             = ChefsSpoon.FindObjectOfType <ChefsSpoon>().taken;
        data.cookedMechanicalDinnerTaken = CookedMechanicalDinner.FindObjectOfType <CookedMechanicalDinner>().taken;
        data.earmuffsTaken = Earmuffs.FindObjectOfType <Earmuffs>().taken;
        data.frozenMechanicalDinnerTaken = FrozenMechanicalDinner.FindObjectOfType <FrozenMechanicalDinner>().taken;
        data.gasCanisterTaken            = GasCanister.FindObjectOfType <GasCanister>().taken;
        data.passengersEyeTaken          = PassengersEye.FindObjectOfType <PassengersEye>().taken;
        data.plungerTaken = Plunger.FindObjectOfType <Plunger>().taken;
        data.rattleTaken  = Rattle.FindObjectOfType <Rattle>().taken;
        data.valveTaken   = Valve.FindObjectOfType <Valve>().taken;

        data.plungerThrown = Plunger.FindObjectOfType <Plunger>().thrown;

        //NPCS
        data.earmuffsGuyCanGive    = EarmuffsGuy.FindObjectOfType <EarmuffsGuy>().canGiveItem;
        data.earmuffsGuyCanRecieve = EarmuffsGuy.FindObjectOfType <EarmuffsGuy>().canRecieveItem;

        data.eyeRobotCanGive    = EyeRobot.FindObjectOfType <EyeRobot>().canGiveItem;
        data.eyeRobotCanRecieve = EyeRobot.FindObjectOfType <EyeRobot>().canRecieveItem;

        data.chefCanGive    = Chef.FindObjectOfType <Chef>().canGiveItem;
        data.chefCanRecieve = Chef.FindObjectOfType <Chef>().canRecieveItem;
        data.chefFrozen     = Chef.FindObjectOfType <Chef>().frozen;

        data.womanRobotCanGive    = WomanRobot.FindObjectOfType <WomanRobot>().canGiveItem;
        data.womanRobotCanRecieve = WomanRobot.FindObjectOfType <WomanRobot>().canRecieveItem;

        data.cabinetCanGive    = Cabinet.FindObjectOfType <Cabinet>().canGiveItem;
        data.cabinetCanRecieve = Cabinet.FindObjectOfType <Cabinet>().canRecieveItem;

        data.toiletcanRecieve = Toilet.FindObjectOfType <Toilet>().canRecieveItem;

        data.hoboThrew = HoboRobot.FindObjectOfType <HoboRobot>().hoboThrew;

        data.nozzleCanRecieve = Nozzle.FindObjectOfType <Nozzle>().canRecieveItem;

        //ROBOT SPECIFIC
        data.robotLeftBathroom = BathroomRobot.FindObjectOfType <BathroomRobot>().leftBathroom;

        //DOG
        data.dogEating   = Dog.FindObjectOfType <Dog>().eating;
        data.dogLocation = Dog.FindObjectOfType <Transform>().position;

        //DOG BOWL
        data.bowlHasFood  = DogBowl.FindObjectOfType <DogBowl>().hasFood;
        data.dinnerActive = DogBowl.FindObjectOfType <DogBowl>().dinnerActive;

        //WORKTABLE
        data.canRecieveChefsSpoon = Worktable.FindObjectOfType <Worktable>().canRecieveChefsSpoon;
        data.canRecieveBottle     = Worktable.FindObjectOfType <Worktable>().canRecieveBottle;
        data.tableCanGiveItem     = Worktable.FindObjectOfType <Worktable>().canGiveItem;

        //STOVE
        data.canRecieveFMD         = Stove.FindObjectOfType <Stove>().canRecieveFMD;
        data.canRecieveGasCanister = Stove.FindObjectOfType <Stove>().canRecieveGasCanister;
        data.stoveCanGiveItem      = Stove.FindObjectOfType <Stove>().canGiveItem;

        //        Data data = new Data
        //        {
        //            testFloat = 0.0f
        //        };

        binaryFormatter.Serialize(dataFile, data);
        dataFile.Close();
    }
Beispiel #23
0
 void Cook(Stove stove)
 {
     myNoodles.SetActive(false);
     stove.CookNoodles();
 }