fr.arakne.swflangloader.lang.classes.DofusClass   A
last analyzed

Complexity

Total Complexity 20

Size/Duplication

Total Lines 127
Duplicated Lines 0 %

Test Coverage

Coverage 95.24%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 54
c 1
b 0
f 0
dl 0
loc 127
ccs 20
cts 21
cp 0.9524
rs 10
wmc 20

17 Methods

Rating   Name   Duplication   Size   Complexity  
A equals(Object) 0 6 4
A vitalityBoost() 0 2 1
A description() 0 2 1
A shortName() 0 2 1
A spellIds() 0 2 1
A id() 0 2 1
A agilityBoost() 0 2 1
A setId(int) 0 2 1
A strengthBoost() 0 2 1
A luckBoost() 0 2 1
A toString() 0 3 1
A wisdomBoost() 0 2 1
A intelligenceBoost() 0 2 1
A longName() 0 2 1
A closeCombatData() 0 2 1
A hashCode() 0 3 1
A ep() 0 2 1
1
/*
2
 * This file is part of ArakneLangLoader.
3
 *
4
 * ArakneLangLoader is free software: you can redistribute it and/or modify
5
 * it under the terms of the GNU Lesser General Public License as published by
6
 * the Free Software Foundation, either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * ArakneLangLoader is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU Lesser General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU Lesser General Public License
15
 * along with ArakneLangLoader.  If not, see <https://www.gnu.org/licenses/>.
16
 *
17
 * Copyright (c) 2020 Vincent Quatrevieux
18
 */
19
20
package fr.arakne.swflangloader.lang.classes;
21
22
import java.util.Objects;
23
24
/**
25
 * Dofus class data
26
 */
27 1
final public class DofusClass {
28
    private int id;
29
30
    /* final */ private String sn;
31
    /* final */ private String ln;
32
    /* final */ private int ep;
33
    /* final */ private String d;
34
    /* final */ private int[] s;
35
    /* final */ private Object[] cc;
36
    /* final */ private int[][] b10;
37
    /* final */ private int[][] b11;
38
    /* final */ private int[][] b12;
39
    /* final */ private int[][] b13;
40
    /* final */ private int[][] b14;
41
    /* final */ private int[][] b15;
42
43
    /**
44
     * @return The short (i.e. single word) class name
45
     */
46
    public String shortName() {
47 1
        return sn;
48
    }
49
50
    /**
51
     * @return The long class name
52
     */
53
    public String longName() {
54 1
        return ln;
55
    }
56
57
    /**
58
     * @return The apparition episode
59
     */
60
    public int ep() {
61
        return ep;
62
    }
63
64
    /**
65
     * @return The class description
66
     */
67
    public String description() {
68 1
        return d;
69
    }
70
71
    /**
72
     * @return List of class spells ids
73
     */
74
    public int[] spellIds() {
75 1
        return s;
76
    }
77
78
    /**
79
     * @return Raw close combat data
80
     */
81
    public Object[] closeCombatData() {
82 1
        return cc;
83
    }
84
85
    /**
86
     * @return The class id
87
     */
88
    public int id() {
89 1
        return id;
90
    }
91
92
    /**
93
     * @return Strength boost costs
94
     */
95
    public CharacteristicBoostCosts strengthBoost() {
96 1
        return new CharacteristicBoostCosts(b10);
97
    }
98
99
    /**
100
     * @return Vitality boost costs
101
     */
102
    public CharacteristicBoostCosts vitalityBoost() {
103 1
        return new CharacteristicBoostCosts(b11);
104
    }
105
106
    /**
107
     * @return Wisdom boost costs
108
     */
109
    public CharacteristicBoostCosts wisdomBoost() {
110 1
        return new CharacteristicBoostCosts(b12);
111
    }
112
113
    /**
114
     * @return Luck boost costs
115
     */
116
    public CharacteristicBoostCosts luckBoost() {
117 1
        return new CharacteristicBoostCosts(b13);
118
    }
119
120
    /**
121
     * @return Agility boost costs
122
     */
123
    public CharacteristicBoostCosts agilityBoost() {
124 1
        return new CharacteristicBoostCosts(b14);
125
    }
126
127
    /**
128
     * @return Intelligence boost costs
129
     */
130
    public CharacteristicBoostCosts intelligenceBoost() {
131 1
        return new CharacteristicBoostCosts(b15);
132
    }
133
134
    @Override
135
    public boolean equals(Object o) {
136 1
        if (this == o) return true;
137 1
        if (o == null || getClass() != o.getClass()) return false;
138 1
        DofusClass that = (DofusClass) o;
139 1
        return id == that.id;
140
    }
141
142
    @Override
143
    public int hashCode() {
144 1
        return Objects.hash(id);
145
    }
146
147
    @Override
148
    public String toString() {
149 1
        return "DofusClass{name=" + sn + ", id=" + id + "}";
150
    }
151
152
    void setId(int id) {
153 1
        this.id = id;
154 1
    }
155
}
156