Esempio n. 1
0
    //prepare interactable objects
    void PrepareObjectsToTakeOrExamine(Room curentRoom)
    {
        for (int i = 0; i < curentRoom.interactableObjectsInRoom.Length; i++)
        {
            //go over our array of objects in room, and show object descriptions
            string descriptionNotInInventory = interactableItem.GetObjectsNotInInventory(curentRoom, i);
            {
                if (descriptionNotInInventory != null)
                {
                    interactionDescriptionsInRoom.Add(descriptionNotInInventory);
                }

                InteractableObject interactableInRoom = curentRoom.interactableObjectsInRoom[i];
                //checking over all interactions
                for (int j = 0; j < interactableInRoom.interactions.Length; j++)
                {
                    Interaction interaction = interactableInRoom.interactions[j];
                    //what did they say? Was it examine?
                    if (interaction.inputAction.keyWord == "examine")
                    {
                        //if it is, add to examine dictionary
                        interactableItem.examineDictionary.Add(interactableInRoom.noun, interaction.textResponse);
                    }
                    if (interaction.inputAction.keyWord == "take")
                    {
                        //if it is, add to examine dictionary
                        interactableItem.takeDictionary.Add(interactableInRoom.noun, interaction.textResponse);
                    }
                }
            }
        }
    }