Completed
Push — master ( c23c95...90e58a )
by Jesse
02:01
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 match() 0 3 1
A aggregateId() 0 3 1
A card() 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\Deck\CardId;
6
use Stratadox\CardGame\Match\MatchEvent;
7
use Stratadox\CardGame\Match\MatchId;
8
9
final class UnitDied implements MatchEvent
10
{
11
    /** @var MatchId */
12
    private $match;
13
    /** @var CardId */
14
    private $card;
15
    /** @var int */
16
    private $player;
17
18
    public function __construct(MatchId $match, CardId $card, int $player)
19
    {
20
        $this->match = $match;
21
        $this->card = $card;
22
        $this->player = $player;
23
    }
24
25
    public function aggregateId(): MatchId
26
    {
27
        return $this->match;
28
    }
29
30
    public function match(): MatchId
31
    {
32
        return $this->aggregateId();
33
    }
34
35
    public function card(): CardId
36
    {
37
        return $this->card;
38
    }
39
40
    public function player(): int
41
    {
42
        return $this->player;
43
    }
44
}
45