Total Complexity | 10 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Coverage | 52.38% |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | #[Immutable] |
||
13 | 1 | final class WeaponMastery implements Talent |
|
14 | { |
||
15 | 1 | public function __construct( |
|
16 | private WeaponType $type, |
||
17 | private WeaponMasteryLevel $level, |
||
18 | 1 | ) {} |
|
19 | |||
20 | 1 | public static function shortSword(WeaponMasteryLevel $level): self |
|
21 | { |
||
22 | 1 | return new self(WeaponType::shortSword(), $level); |
|
23 | } |
||
24 | |||
25 | 1 | 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 | 1 | public function getType(): WeaponType |
|
51 | { |
||
52 | 1 | return $this->type; |
|
53 | } |
||
54 | |||
55 | 1 | public function getLevel(): WeaponMasteryLevel |
|
58 | } |
||
59 | |||
60 | public function __toString(): string |
||
61 | { |
||
62 | return "Mastery at {$this->type}: {$this->level}"; |
||
63 | } |
||
64 | } |
||
65 |