Exemple #1
0
        public bool IsEnabled(State state, Action action)
        {
            ActionInfo a = this.actionMethodMap[action.ActionSymbol];

            SetState(state);
            return(a.IsEnabled(action.Arguments()));
        }
Exemple #2
0
        public IEnumerable <Action> GetActions(State state, ActionSymbol actionSymbol)
        {
            //enumerate over the parameter domains, check
            //enabling conditions and yield the actions
            ActionInfo actionMethod = this.actionMethodMap[actionSymbol];

            SetState(state);
            List <Action> res = new List <Action>();

            foreach (object[] args in actionMethod.inputParameterCombinations.GetParameters())
            {
                if (actionMethod.IsEnabled(args))
                {
                    res.Add(new Action(actionSymbol, args));
                }
            }
            return(res);
        }