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

UnitDied   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A offset() 0 3 1
A match() 0 3 1
A aggregateId() 0 3 1
A player() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\Match\Event;
4
5
use Stratadox\CardGame\Match\MatchEvent;
6
use Stratadox\CardGame\Match\MatchId;
7
8
final class UnitDied implements MatchEvent
9
{
10
    /** @var MatchId */
11
    private $match;
12
    /** @var int */
13
    private $player;
14
    /** @var int */
15
    private $offset;
16
17
    public function __construct(MatchId $match, int $player, int $offset)
18
    {
19
        $this->match = $match;
20
        $this->player = $player;
21
        $this->offset = $offset;
22
    }
23
24
    public function aggregateId(): MatchId
25
    {
26
        return $this->match;
27
    }
28
29
    public function match(): MatchId
30
    {
31
        return $this->aggregateId();
32
    }
33
34
    public function player(): int
35
    {
36
        return $this->player;
37
    }
38
39
    public function offset(): int
40
    {
41
        return $this->offset;
42
    }
43
}
44