Total Complexity | 8 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Coverage | 92.86% |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
18 | 1 | abstract class BaseCharacterSkill { |
|
19 | use \Nette\SmartObject; |
||
20 | |||
21 | /** @var BaseSkill */ |
||
22 | protected $skill; |
||
23 | protected int $level; |
||
24 | protected int $cooldown = 0; |
||
25 | |||
26 | public function __construct(BaseSkill $skill, int $level) { |
||
27 | 1 | $this->skill = $skill; |
|
28 | 1 | $this->setLevel($level); |
|
29 | 1 | $this->resetCooldown(); |
|
30 | 1 | } |
|
31 | |||
32 | abstract protected function getSkillType(): string; |
||
33 | |||
34 | protected function getLevel(): int { |
||
36 | } |
||
37 | |||
38 | protected function getCooldown(): int { |
||
39 | return $this->cooldown; |
||
40 | } |
||
41 | |||
42 | protected function setLevel(int $level): void { |
||
43 | 1 | $this->level = Numbers::range($level, 0, $this->skill->levels); |
|
44 | 1 | } |
|
45 | |||
46 | protected function isUsable(): bool { |
||
47 | 1 | return ($this->cooldown < 1); |
|
48 | } |
||
49 | |||
50 | public function resetCooldown(): void { |
||
52 | 1 | } |
|
53 | |||
54 | public function decreaseCooldown(): void { |
||
57 | } |
||
58 | 1 | } |
|
60 | ?> |