1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace AardsGerds\Game\Build\Talent\WeaponMastery; |
6
|
|
|
|
7
|
|
|
use AardsGerds\Game\Shared\IntegerValue; |
8
|
|
|
|
9
|
|
|
final class WeaponMasteryLevel extends IntegerValue |
10
|
|
|
{ |
11
|
|
|
public const INEXPERIENCED = 0; |
12
|
|
|
public const NOVICE = 1; |
13
|
|
|
public const WARRIOR = 2; |
14
|
|
|
public const VETERAN = 3; |
15
|
|
|
public const MASTER_OF_FIRST_TIER = 4; |
16
|
|
|
public const MASTER_OF_SECOND_TIER = 5; |
17
|
|
|
public const MASTER_OF_THIRD_TIER = 6; |
18
|
|
|
|
19
|
|
|
private const STRING_VALUES = [ |
20
|
|
|
self::INEXPERIENCED => 'inexperienced', |
21
|
|
|
self::NOVICE => 'novice', |
22
|
|
|
self::WARRIOR => 'warrior', |
23
|
|
|
self::VETERAN => 'veteran', |
24
|
|
|
self::MASTER_OF_FIRST_TIER => 'master of first tier', |
25
|
|
|
self::MASTER_OF_SECOND_TIER => 'master of second tier', |
26
|
|
|
self::MASTER_OF_THIRD_TIER => 'master of third tier', |
27
|
|
|
]; |
28
|
|
|
|
29
|
|
|
public static function inexperienced(): self |
30
|
|
|
{ |
31
|
|
|
return new self(self::INEXPERIENCED); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
public static function novice(): self |
35
|
|
|
{ |
36
|
|
|
return new self(self::NOVICE); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
public static function warrior(): self |
40
|
|
|
{ |
41
|
|
|
return new self(self::WARRIOR); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public static function veteran(): self |
45
|
|
|
{ |
46
|
|
|
return new self(self::VETERAN); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public static function masterOfFirstTier(): self |
50
|
|
|
{ |
51
|
|
|
return new self(self::MASTER_OF_FIRST_TIER); |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public static function masterOfSecondTier(): self |
55
|
|
|
{ |
56
|
|
|
return new self(self::MASTER_OF_SECOND_TIER); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public static function masterOfThirdTier(): self |
60
|
|
|
{ |
61
|
|
|
return new self(self::MASTER_OF_THIRD_TIER); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
public function __toString(): string |
65
|
|
|
{ |
66
|
|
|
return self::STRING_VALUES[$this->value]; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
private function __construct(int $value) |
70
|
|
|
{ |
71
|
|
|
parent::__construct($value); |
72
|
|
|
} |
73
|
|
|
} |
74
|
|
|
|