Пример #1
0
 public SubjectCore(IEnumerable <SubjectAction> actions, ModelState model)
 {
     this.actions    = actions.Select(a => new SubjectActionResult(a, model)).ToArray();
     objectFeedback  = new State(model);
     subjectFeedback = new State(model);
     lastAction      = new SubjectActionResult(SubjectAction.Fake, model);
 }
Пример #2
0
        public ActionTarget(SubjectActionResult action, Subject obj, Subject subj, Action <ActionTarget> applyCallback)
        {
            this.Action = action;
            Object      = obj;
            Subject     = subj;

            this.applyCallback = applyCallback;
        }
Пример #3
0
        public void Apply()
        {
            if (unstableLastAction != null)
            {
                lastAction         = unstableLastAction;
                unstableLastAction = null;
            }

            lastAction.AddFeedback(objectFeedback, subjectFeedback);
            objectFeedback.ZeroState();
            subjectFeedback.ZeroState();
        }
Пример #4
0
 void SetLastAction(ActionTarget action)
 {
     unstableLastAction = action.Action;
 }