예제 #1
0
 internal ConditionalDepartment(int id, int conditionStamp,
                                DepartmentWorker workerIfTrue, DepartmentWorker workerIfFalse)
 {
     Id             = id;
     ConditionStamp = conditionStamp;
     WorkerIfTrue   = workerIfTrue;
     WorkerIfFalse  = workerIfFalse;
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
 internal SimpleDepartment(int id, DepartmentWorker worker)
 {
     Id     = id;
     Worker = worker;
 }