Test Failed
Push — master ( 55d9e9...6ae951 )
by Paweł
02:43
created

Player::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 5
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Player;
6
7
use AardsGerds\Game\Build\Attribute\AttributePoints;
8
use AardsGerds\Game\Build\Level;
9
use AardsGerds\Game\Build\LevelProgress;
10
use AardsGerds\Game\Build\Talent\TalentPoints;
11
12
final class Player
13
{
14
    public function __construct(
15
        private string $name,
16
        private Level $level,
17
        private LevelProgress $levelProgress,
18
        private AttributePoints $attributePoints,
19
        private TalentPoints $talentPoints,
20
    ) {}
21
22
    public function increaseExperience(): void
23
    {
24
25
    }
26
27
    public function levelUp(): void
28
    {
29
        $this->level->increment();
30
        $this->levelProgress->reset();
31
        $this->attributePoints->increaseBy(new AttributePoints(5));
32
        $this->talentPoints->increaseBy(new TalentPoints(3));
33
    }
34
}
35