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