@@ -77,11 +77,11 @@ |
||
77 | 77 | */ |
78 | 78 | public function setCharacterPosition($id, int $row, int $column): void { |
79 | 79 | if(!$this->hasItems(["id" => $id])) { |
80 | - throw new \OutOfBoundsException("Character $id is not in the team"); |
|
80 | + throw new \OutOfBoundsException("character $id is not in the team"); |
|
81 | 81 | } elseif(count($this->getItems(["positionRow" => $row])) >= $this->maxRowSize) { |
82 | - throw new InvalidCharacterPositionException("Row $row is full.", InvalidCharacterPositionException::ROW_FULL); |
|
82 | + throw new InvalidCharacterPositionException("row $row is full.", InvalidCharacterPositionException::ROW_FULL); |
|
83 | 83 | } elseif($this->hasItems(["positionRow" => $row, "positionColumn" => $column])) { |
84 | - throw new InvalidCharacterPositionException("Row $row column $column is occupied.", InvalidCharacterPositionException::POSITION_OCCUPIED); |
|
84 | + throw new InvalidCharacterPositionException("row $row column $column is occupied.", InvalidCharacterPositionException::POSITION_OCCUPIED); |
|
85 | 85 | } |
86 | 86 | $character = $this->getItems(["id" => $id])[0]; |
87 | 87 | $character->positionRow = $row; |
@@ -10,6 +10,8 @@ |
||
10 | 10 | public function getName(): string; |
11 | 11 | public function getPriority(): int; |
12 | 12 | public function shouldUse(CombatBase $combat, Character $character): bool; |
13 | - public function do(CombatBase $combat, Character $character): void; |
|
14 | -} |
|
13 | + public function do { |
|
14 | + (CombatBase $combat, Character $character): void; |
|
15 | + } |
|
16 | + } |
|
15 | 17 | ?> |
16 | 18 | \ No newline at end of file |
@@ -26,8 +26,10 @@ |
||
26 | 26 | return (in_array($character, $this->findHealers($combat)->toArray(), true) && $this->selectHealingTarget($character, $combat) !== null); |
27 | 27 | } |
28 | 28 | |
29 | - public function do(CombatBase $combat, Character $character): void { |
|
29 | + public function do { |
|
30 | + (CombatBase $combat, Character $character): void { |
|
30 | 31 | $result = []; |
32 | + } |
|
31 | 33 | /** @var Character $patient */ |
32 | 34 | $patient = $this->selectHealingTarget($character, $combat); |
33 | 35 | $result["result"] = $combat->successCalculator->hasHealed($character); |
@@ -30,8 +30,10 @@ |
||
30 | 30 | * Hit chance = Attacker's hit - Defender's dodge, but at least 15% |
31 | 31 | * Damage = Attacker's damage - defender's defense |
32 | 32 | */ |
33 | - public function do(CombatBase $combat, Character $character): void { |
|
33 | + public function do { |
|
34 | + (CombatBase $combat, Character $character): void { |
|
34 | 35 | $result = []; |
36 | + } |
|
35 | 37 | $defender = $combat->selectAttackTarget($character); |
36 | 38 | if($defender === null) { |
37 | 39 | return; |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | protected function setTemplate(string $template): void { |
34 | 34 | if(!is_file($template)) { |
35 | - throw new \RuntimeException("File $template does not exist."); |
|
35 | + throw new \RuntimeException("file $template does not exist."); |
|
36 | 36 | } |
37 | 37 | $this->template = $template; |
38 | 38 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | declare(strict_types=1); |
3 | 3 | |
4 | 4 | require __DIR__ . "/../vendor/autoload.php"; |
5 | -Testbench\Bootstrap::setup(__DIR__ . '/_temp', function (\Nette\Configurator $configurator): void { |
|
5 | +Testbench\Bootstrap::setup(__DIR__ . '/_temp', function(\Nette\Configurator $configurator): void { |
|
6 | 6 | $configurator->addParameters(["appDir" => __DIR__, ]); |
7 | 7 | $configurator->addConfig(__DIR__ . "/tests.neon"); |
8 | 8 | }); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | |
21 | 21 | protected function generateCharacter(int $id): Character { |
22 | 22 | $stats = [ |
23 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
23 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
24 | 24 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
25 | 25 | ]; |
26 | 26 | return new Character($stats); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | final class InitiativeFormulaParserTest extends \Tester\TestCase { |
15 | 15 | protected function generateCharacter(int $id): Character { |
16 | 16 | $stats = [ |
17 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d4+DEX/4", "strength" => 10, |
|
17 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d4+DEX/4", "strength" => 10, |
|
18 | 18 | "dexterity" => 12, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
19 | 19 | ]; |
20 | 20 | return new Character($stats); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | final class TeamTest extends \Tester\TestCase { |
15 | 15 | protected function generateCharacter(int $id): Character { |
16 | 16 | $stats = [ |
17 | - "id" => $id, "name" => "Player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
17 | + "id" => $id, "name" => "player $id", "level" => 1, "initiativeFormula" => "1d2+DEX/4", "strength" => 10, |
|
18 | 18 | "dexterity" => 10, "constitution" => 10, "intelligence" => 10, "charisma" => 10 |
19 | 19 | ]; |
20 | 20 | return new Character($stats); |