Talents::secondaryTalentsCalcGlyph()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 2
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