Exemple #1
0
    public bool SubmitAction(string action, string target)
    {
        bool actionExecuted = false;

        //Check obstacle
        if (ObstacleController.Instance.ObstaclePresent())
        {
            actionExecuted = ObstacleController.Instance.SubmitObstacleAction(action, target);
        }

        if (!actionExecuted)
        {
            //Check through interactables
            for (int i = 0; i < StaticData.InteractableIds.Length; i++)
            {
                string           interactableId = StaticData.InteractableIds[i];
                InteractableData data           = InteractableDatabase.GetInteractableData(interactableId);
                for (int j = 0; j < data.Interactions.Length; j++)
                {
                    Interaction interaction = data.Interactions[j];
                    if ((Helpers.LooseCompare(target, interaction.Target) || Helpers.LooseCompare(target, data.Name)) && Helpers.LooseCompare(action, interaction.Action))
                    {
                        interaction.ExecuteInteractionOutcome();
                        actionExecuted = true;
                    }
                }
            }
        }

        return(actionExecuted);
    }
Exemple #2
0
    public bool SubmitExamineAction(string target)
    {
        for (int i = 0; i < StaticData.InteractableIds.Length; i++)
        {
            string           interactableId = StaticData.InteractableIds[i];
            InteractableData data           = InteractableDatabase.GetInteractableData(interactableId);
            if (Helpers.LooseCompare(target, data.Name))
            {
                MessageManager.SendStringMessage(data.Description);
                return(true);
            }
        }

        return(false);
    }