Lines
100.00%
3 / 3
Methods
100.00%
2 / 2
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| __construct | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | ||
| up | 100.00% | 2 / 2 | 100.00% | 1 / 1 | 1 | ||
| 15 | final class Hero extends Player | |
| 16 | { | |
| 17 | /** @mago-expect lint:excessive-parameter-list */ | |
| 18 | public function __construct( | |
| 19 | PlayerSpawnId $spawnId, | |
| 20 | PlayerName $name, | |
| 21 | PlayerLevel $level, | |
| 22 | public readonly HeroAttributes $attributes, | |
| 23 | public readonly HeroClass $class, | |
| 24 | public readonly HeroProgression $progression, | |
| 25 | public readonly HeroInventory $inventory, | |
| 26 | public readonly HeroSettings $settings = new HeroSettings(), | |
| 27 | ) { | |
| 28 | parent::__construct($spawnId, $name, $level, $attributes->vitals); | |
| 29 | } | |
| 30 | ||
| 31 | public function up(Experience $toNext): void | |
| 32 | { | |
| 33 | $this->level = $this->level->up(); | |
| 34 | $this->progression->level->next($toNext); | |
| 35 | } | |
| 36 | } |