|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace AardsGerds\Game\Event; |
|
6
|
|
|
|
|
7
|
|
|
final class EventType implements \Stringable |
|
8
|
|
|
{ |
|
9
|
|
|
public const FIGHT = 'fight'; |
|
10
|
|
|
public const DIALOG = 'dialog'; |
|
11
|
|
|
public const TRADE = 'trade'; |
|
12
|
|
|
public const TRAVEL = 'travel'; |
|
13
|
|
|
public const ENCOUNTER = 'encounter'; |
|
14
|
|
|
public const LOOT = 'loot'; |
|
15
|
|
|
public const EXPLORE = 'explore'; |
|
16
|
|
|
public const RETREAT = 'retreat'; |
|
17
|
|
|
|
|
18
|
|
|
private function __construct( |
|
19
|
|
|
private string $value, |
|
20
|
|
|
) {} |
|
21
|
|
|
|
|
22
|
|
|
public static function fight(): self |
|
23
|
|
|
{ |
|
24
|
|
|
return new self(self::FIGHT); |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
public static function dialog(): self |
|
28
|
|
|
{ |
|
29
|
|
|
return new self(self::DIALOG); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
public static function trade(): self |
|
33
|
|
|
{ |
|
34
|
|
|
return new self(self::TRADE); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public static function travel(): self |
|
38
|
|
|
{ |
|
39
|
|
|
return new self(self::TRAVEL); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public static function encounter(): self |
|
43
|
|
|
{ |
|
44
|
|
|
return new self(self::ENCOUNTER); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
public static function loot(): self |
|
48
|
|
|
{ |
|
49
|
|
|
return new self(self::LOOT); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public static function explore(): self |
|
53
|
|
|
{ |
|
54
|
|
|
return new self(self::EXPLORE); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public static function retreat(): self |
|
58
|
|
|
{ |
|
59
|
|
|
return new self(self::RETREAT); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function __toString(): string |
|
63
|
|
|
{ |
|
64
|
|
|
return $this->value; |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|