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); }
public ActionTarget(SubjectActionResult action, Subject obj, Subject subj, Action <ActionTarget> applyCallback) { this.Action = action; Object = obj; Subject = subj; this.applyCallback = applyCallback; }
public void Apply() { if (unstableLastAction != null) { lastAction = unstableLastAction; unstableLastAction = null; } lastAction.AddFeedback(objectFeedback, subjectFeedback); objectFeedback.ZeroState(); subjectFeedback.ZeroState(); }
void SetLastAction(ActionTarget action) { unstableLastAction = action.Action; }