Example #1
0
        public bool Check()
        {
            IActivatable element = elementManager.GetActivatableGameElement(refId);

            if (element == null)
            {
                System.Console.WriteLine("There is no activatable element with the given id! " + refId);
                return(false);
            }
            return(element.IsActive() == valueToCheck);
        }
Example #2
0
        public void Execute(GameElementManager elementManager)
        {
            IActivatable activatable = elementManager.GetActivatableGameElement(refId);

            if (activatable == null)
            {
                ObjectManager.Logger.LogWarn("There is no activatable element with the given id, however an action is reffering it! The given id: " + refId);
            }
            if (valueToSet == null)
            {
                activatable.SetActive(!activatable.IsActive());
            }
            else
            {
                activatable.SetActive((bool)valueToSet);
            }
        }