Lines
100.00%
2 / 2
Functions and Methods
100.00%
2 / 2
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| MapMonster | 100.00% | 2 / 2 | 100.00% | 2 / 2 | 2 | 100.00% | 1 / 1 | |||
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| change | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Lorekeeper\Core\World\Map; | |
| 6 | ||
| 7 | use Lorekeeper\Core\Game\Attribute\Vitals; | |
| 8 | use Lorekeeper\Core\Game\Combat\CombatState; | |
| 9 | use Lorekeeper\Core\World\Monster\Monster; | |
| 10 | use Lorekeeper\Core\World\Monster\MonsterSpawnId; | |
| 11 | ||
| 12 | final class MapMonster | |
| 13 | { | |
| 14 | public function __construct( | |
| 15 | public readonly MonsterSpawnId $id, | |
| 16 | public readonly Monster $monster, | |
| 17 | public readonly MapCell $cell, | |
| 18 | public readonly Vitals $vitals, | |
| 19 | public private(set) CombatState $state, | |
| 20 | ) {} | |
| 21 | ||
| 22 | public function change(CombatState $state): void | |
| 23 | { | |
| 24 | $this->state = $state; | |
| 25 | } | |
| 26 | } |