Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
8 | class Battlefields |
||
9 | { |
||
10 | private $battlefields = []; |
||
11 | |||
12 | public function for(MatchId $match): Battlefield |
||
13 | { |
||
14 | if (!array_key_exists($match->id(), $this->battlefields)) { |
||
15 | $this->battlefields[$match->id()] = Battlefield::untouched(); |
||
16 | } |
||
17 | return $this->battlefields[$match->id()]; |
||
18 | } |
||
19 | |||
20 | /** @return Card[] */ |
||
21 | public function cardsInPlay(MatchId $match): array |
||
24 | } |
||
25 | |||
26 | /** @return Card[] */ |
||
27 | public function cardsInPlayFor(int $player, MatchId $match): array |
||
28 | { |
||
29 | return $this->for($match)->cardsInPlayFor($player); |
||
30 | } |
||
31 | |||
32 | /** @return Card[] */ |
||
33 | public function attackers(MatchId $match): array |
||
36 | } |
||
37 | |||
38 | /** @return Card[] */ |
||
39 | public function defenders(MatchId $match): array |
||
44 |