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

Card   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 38
rs 10
c 1
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A offset() 0 3 1
A attack() 0 3 1
A template() 0 3 1
A isAttacking() 0 3 1
A __construct() 0 4 1
A regroup() 0 3 1
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