Total Complexity | 8 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
5 | final class Card |
||
6 | { |
||
7 | /** @var int */ |
||
8 | private $offset; |
||
9 | /** @var CardTemplate */ |
||
10 | private $template; |
||
11 | /** @var bool */ |
||
12 | private $isAttacking = false; |
||
13 | /** @var bool */ |
||
14 | private $isDefending = false; |
||
15 | |||
16 | public function __construct(int $offset, CardTemplate $template) |
||
17 | { |
||
18 | $this->offset = $offset; |
||
19 | $this->template = $template; |
||
20 | } |
||
21 | |||
22 | public function isAttacking(): bool |
||
23 | { |
||
24 | return $this->isAttacking; |
||
25 | } |
||
26 | |||
27 | public function isDefending(): bool |
||
28 | { |
||
29 | return $this->isDefending; |
||
30 | } |
||
31 | |||
32 | public function hasTemplate(CardTemplate $template): bool |
||
33 | { |
||
34 | return $this->template->is($template); |
||
35 | } |
||
36 | |||
37 | public function offset(): int |
||
40 | } |
||
41 | |||
42 | public function attack(): void |
||
45 | } |
||
46 | |||
47 | public function defend(): void |
||
48 | { |
||
49 | $this->isDefending = true; |
||
50 | } |
||
51 | |||
52 | public function regroup(): void |
||
55 | } |
||
56 | } |
||
57 |