-
Notifications
You must be signed in to change notification settings - Fork 3
PersonControl
相当于人事部吧
当前员工的数组
当前有多少员工,初始为0
当前最多可以有多少员工,暂时设置为5
项目组数组,表示当前正在 开发/销售/维护的项目组
信誉度,影响银行的贷款额度
num可以为正也可以为负
this.credit_ += num;
return this.credit_ <= 0 ? 0 : this.credit_
可雇佣最大人数加1
看当前人员是否已满
return this.currentNum_ < this.maxNum_
@require:自己的列表中没这个person;且这个person合法; 且当前没有达到最大人数
@modify:this
@effect:
判断是不是人员已满:
- 如果当前已满,那么返回false
- 如果没满,那么:
- 抛出事件
"MONEYCUT",force = false,判断返回值- 是
true,那么-
currentNum_增加1 -
persons_中包含person - 返回
true
-
-
false,then returnfalse
- 是
- 抛出事件
@require: index和当前persons_数组的其中某个person元素的index_相等
遍历persons_,由index找出这个员工person
遍历this.projectGroups_,每一个记为group,调用group.removePerson(person)
从this.persons_中去掉这个员工,currentNum_自减1,返回这个员工
表示要开始做这个项目,初始化项目组,根据ui传入的project和persons参数
- new 一个 ProjectGroup,记为
group,设置group.node = this.node,即设置group的node属性为PersonGenerator - 同样设置
project.node - 调用
group.begin(project,persons) - 让
this.projectGroups_包含group
解散这个组
- 调用
group.stop() - 让
this.personGroups_中不再包含group
负责每个项目组状态的改变以及具体的工作
遍历this.projectGroups_,设置每个元素是group
- 调用
group.work()工作 - 如果
group.state_ == end,那么这个吧这个group,加入到临时数组中
对于每一个临时数组中的group,调用this.stop(group)
返回persons_
"GETDATE"获取日期,如果是30的倍数,那么
计算当前员工总工资,设置event.detail.money ,event.detail.record = "付工资" 和 event.detail.force = true ,"MONEYCUT"
unschedule this.work, paySalary
schedule this.work,paySalary ,频率为time
- 这两个表格主要作用跟考勤差不多
| 第一周贡献分 | 周一 | 周二 | 周三 | 周四 | 周五 | 周六 | 周日 |
|---|---|---|---|---|---|---|---|
| 蔡帜 | 1 | 1 | 1 | 1 | 1 | ||
| 王子铭 | 1 | 1 | 1 | 1 | |||
| 游心 | 1 | 1 | 1 | 1 | 1 | ||
| 解小锐 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 李金奇 | 1 | 1 | |||||
| 杨森 | 1 | ||||||
| 陈鑫 | 1 | ||||||
| 王辰昱 | 1 | 1 | 1 | ||||
| 赵晓宇 | 1 |
| 第二周贡献分 | 周一 | 周二 | 周三 | 周四 | 周五 | 周六 | 周日 |
|---|---|---|---|---|---|---|---|
| 蔡帜 | 1 | 1 | 1 | ||||
| 王子铭 | 1 | 1 | 1 | 1 | |||
| 游心 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 解小锐 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 李金奇 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 杨森 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 陈鑫 | 1 | 1 | 1 | 1 | 1 | 1 | |
| 王辰昱 | 1 | 1 | 1 | 1 | 1 | ||
| 赵晓宇 | 1 | 1 | 1 | 1 |
纪念刷夜小团队:
- 游心,解小锐,李金奇,王辰昱,杨森