public ActionWorker(Func <ILockable> lockDelegate, ILocation location, ILocker locker, IScheduler scheduler, IDbManager dbManager, RequirementFormula requirementFormula) { this.locker = locker; this.scheduler = scheduler; this.dbManager = dbManager; this.requirementFormula = requirementFormula; Location = location; LockDelegate = lockDelegate; }
public Error Validate(IGameObject obj, IEnumerable <Effect> effects, RequirementFormula requirementFormula) { foreach (var req in list) { var parms = new object[] { obj, effects, req.Parms, Id }; Error error; if ((error = (Error)req.Method.Invoke(requirementFormula, parms)) != Error.Ok) { return(error); } } return(Error.Ok); }