Test Setup Failed
Push — master ( 647a95...23a558 )
by Jesse
02:13
created

Card::is()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\ReadModel\Match;
4
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
14
    public function __construct(int $offset, CardTemplate $template)
15
    {
16
        $this->offset = $offset;
17
        $this->template = $template;
18
    }
19
20
    public function isAttacking(): bool
21
    {
22
        return $this->isAttacking;
23
    }
24
25
    public function template(): CardTemplate
26
    {
27
        return $this->template;
28
    }
29
30
    public function offset(): int
31
    {
32
        return $this->offset;
33
    }
34
35
    public function attack(): void
36
    {
37
        $this->isAttacking = true;
38
    }
39
40
    public function regroup(): void
41
    {
42
        $this->isAttacking = false;
43
    }
44
}
45