internal ConditionalDepartment(int id, int conditionStamp, DepartmentWorker workerIfTrue, DepartmentWorker workerIfFalse) { Id = id; ConditionStamp = conditionStamp; WorkerIfTrue = workerIfTrue; WorkerIfFalse = workerIfFalse; }
public DepartmentArrangementBuilder SetSimpleDepartment(int deptId, DepartmentWorker worker) { if (!IsValidDeptId(deptId) || worker == null || !worker.IsValid(DeptCount, StampCount)) { throw new ArgumentException("Department|stamp IDs should be between 1 and deptCount|stampCount"); } this.depts[deptId - 1] = new SimpleDepartment(deptId, worker); return(this); }
public DepartmentArrangementBuilder SetConditionalDepartment(int deptId, int conditionStamp, DepartmentWorker workerIfTrue, DepartmentWorker workerIfFalse) { if (!IsValidDeptId(deptId) || !IsValidStampId(conditionStamp) || workerIfTrue == null || workerIfFalse == null || !workerIfTrue.IsValid(DeptCount, StampCount) || !workerIfFalse.IsValid(DeptCount, StampCount)) { throw new ArgumentException("Department|stamp IDs should be between 1 and deptCount|stampCount"); } this.depts[deptId - 1] = new ConditionalDepartment(deptId, conditionStamp, workerIfTrue, workerIfFalse); return(this); }
internal SimpleDepartment(int id, DepartmentWorker worker) { Id = id; Worker = worker; }