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