Total Complexity | 3 |
Total Lines | 12 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | from synergine.synergy.event.Action import Action |
||
6 | class CycleAction(Action): |
||
7 | |||
8 | _listen = CycleEvent |
||
9 | |||
10 | def run(self, obj, context, synergy_manager): |
||
11 | cant_carry_still = context.metas.value.get(CANT_CARRY_STILL, obj.get_id(), allow_empty=True, empty_value=0) |
||
12 | if cant_carry_still > 0: |
||
13 | context.metas.value.set(CANT_CARRY_STILL, obj.get_id(), cant_carry_still-1) |
||
14 | |||
15 | cant_put_still = context.metas.value.get(CANT_PUT_STILL, obj.get_id(), allow_empty=True, empty_value=0) |
||
16 | if cant_put_still > 0: |
||
17 | context.metas.value.set(CANT_PUT_STILL, obj.get_id(), cant_put_still-1) |
||
18 |