Ejemplo n.º 1
0
        //Methods
        //FIXME: should this be public? It is difficult to extend the behavior of the engine without
        //hosting the extension in the same assembly, unless we do this.
        internal ModelActions           GetPossibleActions()
        {
            //Default - exclude: invalid, callbefore, callafter, calllast, which are handled seperatly.
            ModelActionFlags exclude = ModelActionFlags.CallBefore | ModelActionFlags.CallAfter | ModelActionFlags.CallLast;

            if (!this.InvalidActions)
            {
                exclude |= (ModelActionFlags)ModelItemFlags.Invalid;
            }

            //Loop through all models
            ModelActions totalactions = new ModelActions();

            foreach (Model model in this.Models)
            {
                //Ignore disabled models
                if (model.Weight == 0 || model.Disabled)
                {
                    continue;
                }

                totalactions.Add(model.Actions.FindFlag(exclude, false));
            }

            //Delegate
            return(this.GetPossibleActions(totalactions));
        }
Ejemplo n.º 2
0
 ///<summary>Find all actions that dont match the given flag</summary>
 public virtual ModelActions         FindFlag(ModelActionFlags flag, bool include)
 {
     //Delegate
     return((ModelActions)base.FindFlag((int)flag, include));
 }
Ejemplo n.º 3
0
 ///<summary>Find all actions that match the give flag</summary>
 public virtual ModelActions         FindFlag(ModelActionFlags flag)
 {
     //Delegate
     return(this.FindFlag(flag, true));
 }