| Total Complexity | 10 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 50% |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | #[Immutable] |
||
| 13 | final class WeaponMastery implements Talent |
||
| 14 | { |
||
| 15 | 6 | public function __construct( |
|
| 16 | private WeaponType $type, |
||
| 17 | private WeaponMasteryLevel $level, |
||
| 18 | 6 | ) {} |
|
| 19 | |||
| 20 | 4 | public static function shortSword(WeaponMasteryLevel $level): self |
|
| 21 | { |
||
| 22 | 4 | return new self(WeaponType::shortSword(), $level); |
|
| 23 | } |
||
| 24 | |||
| 25 | 6 | public static function greatSword(WeaponMasteryLevel $level): self |
|
| 28 | } |
||
| 29 | |||
| 30 | public static function bow(WeaponMasteryLevel $level): self |
||
| 31 | { |
||
| 32 | return new self(WeaponType::bow(), $level); |
||
| 33 | } |
||
| 34 | |||
| 35 | public static function getName(): string |
||
| 36 | { |
||
| 37 | return 'Weapon Mastery'; |
||
| 38 | } |
||
| 39 | |||
| 40 | public static function getDescription(): string |
||
| 41 | { |
||
| 42 | return 'Talent of weapon fighting.'; |
||
| 43 | } |
||
| 44 | |||
| 45 | public static function getRequiredTalentPoints(): TalentPoints |
||
| 46 | { |
||
| 47 | return new TalentPoints(4); |
||
| 48 | } |
||
| 49 | |||
| 50 | 5 | public function getType(): WeaponType |
|
| 51 | { |
||
| 52 | 5 | return $this->type; |
|
| 53 | } |
||
| 54 | |||
| 55 | 5 | public function getLevel(): WeaponMasteryLevel |
|
| 58 | } |
||
| 59 | |||
| 60 | public function __toString(): string |
||
| 61 | { |
||
| 62 | return "Mastery at {$this->type}: {$this->level}"; |
||
| 63 | } |
||
| 64 | } |
||
| 65 |