Example #1
0
        // Acts out Action. Runs every updateloop.
        public override void Execute(RuleController controller)
        {
            // Execute Current Index
            int index = controller.GetSequenceIndex(this);

            ActionElements[index].Execute(controller);

            // Increment Index if Action-Element is complete
            if (ActionElements[index].IsComplete(controller))
            {
                controller.IncrementSequence(this);
            }
        }
Example #2
0
 // Evaluates, once action is active, if the action is completed.
 public override bool IsComplete(RuleController controller)
 {
     // Completes Sequence if The sequence index is bigger than the amount of elements in sequence
     return(controller.GetSequenceIndex(this) >= ActionElements.Length);
 }