Talents   A
last analyzed

Complexity

Total Complexity 18

Size/Duplication

Total Lines 103
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 18
lcom 1
cbo 0
dl 0
loc 103
ccs 0
cts 85
cp 0
rs 10
c 0
b 0
f 0

18 Methods

Rating   Name   Duplication   Size   Complexity  
getEntityInformations() 0 1 ?
retreiveField() 0 1 ?
A mainTalentsTree() 0 5 1
A mainTalentsGlyphs() 0 5 1
A mainTalentsSpec() 0 5 1
A mainTalentsCalcTalent() 0 5 1
A mainTalentsCalcSpec() 0 5 1
A mainTalentsCalcGlyph() 0 5 1
A secondaryTalentsTree() 0 5 1
A secondaryTalentsGlyphs() 0 5 1
A secondaryTalentsSpec() 0 5 1
A secondaryTalentsCalcTalent() 0 5 1
A secondaryTalentsCalcSpec() 0 5 1
A secondaryTalentsCalcGlyph() 0 5 1
A getMainTalent() 0 5 1
A getSecondaryTalent() 0 5 1
A getSelectedTalent() 0 9 3
A getTalents() 0 6 1
1
<?php namespace GameScan\WoW\Entity\Player;
2
3
trait Talents
4
{
5
6
    abstract public function getEntityInformations();
7
    abstract public function retreiveField($fielName);
8
9
    public function mainTalentsTree()
10
    {
11
        $talents = $this->getMainTalent();
12
        return $talents->talents;
13
    }
14
    public function mainTalentsGlyphs()
15
    {
16
        $talents = $this->getMainTalent();
17
        return $talents->glyphs;
18
    }
19
    public function mainTalentsSpec()
20
    {
21
        $talents = $this->getMainTalent();
22
        return $talents->spec;
23
    }
24
    public function mainTalentsCalcTalent()
25
    {
26
        $talents = $this->getMainTalent();
27
        return $talents->calcTalent;
28
    }
29
    public function mainTalentsCalcSpec()
30
    {
31
        $talents = $this->getMainTalent();
32
        return $talents->calcSpec;
33
    }
34
35
    public function mainTalentsCalcGlyph()
36
    {
37
        $talents = $this->getMainTalent();
38
        return $talents->calcGlyph;
39
    }
40
41
42
43
    public function secondaryTalentsTree()
44
    {
45
        $talents = $this->getSecondaryTalent();
46
        return $talents->talents;
47
    }
48
    public function secondaryTalentsGlyphs()
49
    {
50
        $talents = $this->getSecondaryTalent();
51
        return $talents->glyphs;
52
    }
53
    public function secondaryTalentsSpec()
54
    {
55
        $talents = $this->getSecondaryTalent();
56
        return $talents->spec;
57
    }
58
    public function secondaryTalentsCalcTalent()
59
    {
60
        $talents = $this->getSecondaryTalent();
61
        return $talents->calcTalent;
62
    }
63
    public function secondaryTalentsCalcSpec()
64
    {
65
        $talents = $this->getSecondaryTalent();
66
        return $talents->calcSpec;
67
    }
68
69
    public function secondaryTalentsCalcGlyph()
70
    {
71
        $talents = $this->getSecondaryTalent();
72
        return $talents->calcGlyph;
73
    }
74
75
76
77
    public function getMainTalent()
78
    {
79
        $talents = $this->getTalents();
80
        return $talents[0];
81
    }
82
83
    public function getSecondaryTalent()
84
    {
85
        $talents = $this->getTalents();
86
        return $talents[1];
87
    }
88
89
    protected function getSelectedTalent()
90
    {
91
        $talents = $this->getTalents();
92
        if (isset($talents[0]->selected) && $talents[0]->selected === true) {
93
            return $talents[0];
94
        } else {
95
            return $talents[1];
96
        }
97
    }
98
99
    public function getTalents()
100
    {
101
        $this->retreiveField("talents");
102
        $talents = $this->getEntityInformations()->talents;
103
        return $talents;
104
    }
105
}
106