Passed
Push — master ( 56813c...ebb300 )
by Paweł
03:29
created

Weapon   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 6
c 4
b 0
f 0
dl 0
loc 34
ccs 0
cts 12
cp 0
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A getType() 0 3 1
A getDamage() 0 3 1
A getName() 0 3 1
A getDescription() 0 3 1
A getSellValue() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Inventory\Weapon;
6
7
use AardsGerds\Game\Build\Attribute\Damage;
8
use AardsGerds\Game\Build\Talent\WeaponMastery\WeaponMastery;
9
use AardsGerds\Game\Inventory\Coin;
10
use AardsGerds\Game\Inventory\InventoryItem;
11
12
abstract class Weapon implements InventoryItem
13
{
14
    public function __construct(
15
        protected string $name,
16
        protected string $description,
17
        protected Coin $sellValue,
18
        protected WeaponType $type,
19
        protected Damage $damage,
20
        protected WeaponMastery $requiredWeaponMastery,
21
    ) {}
22
23
    public function getName(): string
24
    {
25
        return $this->name;
26
    }
27
28
    public function getDescription(): string
29
    {
30
        return $this->description;
31
    }
32
33
    public function getSellValue(): Coin
34
    {
35
        return $this->sellValue;
36
    }
37
38
    public function getType(): WeaponType
39
    {
40
        return $this->type;
41
    }
42
43
    public function getDamage(): Damage
44
    {
45
        return $this->damage;
46
    }
47
}
48