@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - private static function askForAction(Player $player, PlayerAction $playerAction): Attack|Consumable |
|
| 84 | + private static function askForAction(Player $player, PlayerAction $playerAction): Attack | Consumable |
|
| 85 | 85 | { |
| 86 | 86 | $action = $playerAction->askForChoice( |
| 87 | 87 | 'Select action', |
@@ -103,10 +103,10 @@ discard block |
||
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | private static function validateAction( |
| 106 | - Attack|Consumable $action, |
|
| 106 | + Attack | Consumable $action, |
|
| 107 | 107 | Player $player, |
| 108 | 108 | PlayerAction $playerAction, |
| 109 | - ): Attack|Consumable { |
|
| 109 | + ): Attack | Consumable { |
|
| 110 | 110 | if ($action instanceof MeleeAttack && $player->getWeapon() === null) { |
| 111 | 111 | $playerAction->note('This attack requires weapon equipped.'); |
| 112 | 112 | return self::askForAction($player, $playerAction); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | FighterCollection $opponents, |
| 127 | 127 | PlayerAction $playerAction, |
| 128 | 128 | ): Fighter { |
| 129 | - return match (true) { |
|
| 129 | + return match(true) { |
|
| 130 | 130 | $fighter instanceof Player && $opponents->count() > 1 |
| 131 | 131 | => $playerAction->askForChoice('Select opponent to attack', $opponents->getItems()), |
| 132 | 132 | $fighter instanceof Player => $opponents->first(), |