fr.arakne.swflangloader.lang.maps.MapArea   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 29
c 1
b 0
f 0
dl 0
loc 59
ccs 14
cts 14
cp 1
rs 10
wmc 12

9 Methods

Rating   Name   Duplication   Size   Complexity  
A superAreaId() 0 2 1
A toString() 0 3 1
A hashCode() 0 3 1
A setId(int) 0 2 1
A name() 0 2 1
A id() 0 2 1
A setMaps(MapsFile) 0 2 1
A equals(Object) 0 6 4
A superArea() 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.maps;
21
22
import java.util.Objects;
23
24
/**
25
 * Dofus map area
26
 */
27 1
final public class MapArea {
28
    private int id;
29
    private MapsFile maps;
30
31
    private String n;
32
    private int sua;
33
34
    /**
35
     * @return The area id
36
     */
37
    public int id() {
38 1
        return id;
39
    }
40
41
    /**
42
     * @return The area name
43
     */
44
    public String name() {
45 1
        return n;
46
    }
47
48
    /**
49
     * @return Super area id. Unique on the maps file
50
     */
51
    public int superAreaId() {
52 1
        return sua;
53
    }
54
55
    /**
56
     * @return Super area name
57
     */
58
    public String superArea() {
59 1
        return maps.superArea(sua);
60
    }
61
62
    @Override
63
    public boolean equals(Object o) {
64 1
        if (this == o) return true;
65 1
        if (o == null || getClass() != o.getClass()) return false;
66 1
        MapArea area = (MapArea) o;
67 1
        return id == area.id;
68
    }
69
70
    @Override
71
    public int hashCode() {
72 1
        return Objects.hash(id);
73
    }
74
75
    @Override
76
    public String toString() {
77 1
        return "MapArea{" + n + " (" + id + ")}";
78
    }
79
80
    void setId(int id) {
81 1
        this.id = id;
82 1
    }
83
84
    void setMaps(MapsFile maps) {
85 1
        this.maps = maps;
86 1
    }
87
}
88