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

SpellTemplate::dyingEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\CardGame\Match;
4
5
use BadMethodCallException;
6
use Stratadox\CardGame\Deck\CardId;
7
use Stratadox\CardGame\Match\Event\CardWasDrawn;
8
use Stratadox\CardGame\Match\Event\SpellVanishedToTheVoid;
9
10
final class SpellTemplate implements CardTemplate
11
{
12
    private $card;
13
    private $cost;
14
15
    public function __construct(CardId $card, Mana $cost)
16
    {
17
        $this->card = $card;
18
        $this->cost = $cost;
19
    }
20
21
    public function playingEvents(
22
        MatchId $match,
23
        int $player,
24
        int $offset
25
    ): array {
26
        return [new SpellVanishedToTheVoid($match, $player, $offset)];
27
    }
28
29
    public function drawingEvents(
30
        MatchId $match,
31
        int $player,
32
        int $offset
33
    ): array {
34
        return [new CardWasDrawn($match, $this->card, $player, $offset)];
35
    }
36
37
    public function attackingEvents(
38
        MatchId $match,
39
        int $player,
40
        int $offset
41
    ): array {
42
        return [];
43
    }
44
45
    public function defendingEvents(
46
        MatchId $match,
47
        int $player,
48
        int $offset
49
    ): array {
50
        return [];
51
    }
52
53
    public function dyingEvents(
54
        MatchId $match,
55
        int $player,
56
        int $offset
57
    ): array {
58
        return [];
59
    }
60
61
    public function regroupingEvents(
62
        MatchId $match,
63
        int $player,
64
        int $offset
65
    ): array {
66
        return [];
67
    }
68
69
    public function playingMove(int $position): Location
70
    {
71
        return Location::inVoid();
72
    }
73
74
    public function attackingMove(int $position): Location
75
    {
76
        throw new BadMethodCallException('Spells cannot attack.');
77
    }
78
79
    public function defendingMove(int $position): Location
80
    {
81
        throw new BadMethodCallException('Spells cannot defend.');
82
    }
83
84
    public function regroupingMove(int $position): Location
85
    {
86
        throw new BadMethodCallException('Spells cannot regroup.');
87
    }
88
89
    public function cost(): Mana
90
    {
91
        return $this->cost;
92
    }
93
}
94