Test Failed
Pull Request — master (#239)
by Vincent
14:03
created

fightPlaces()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
ccs 0
cts 0
cp 0
c 0
b 0
f 0
cc 1
crap 2
rs 10
1
/*
2
 * This file is part of Araknemu.
3
 *
4
 * Araknemu 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
 * Araknemu 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 Araknemu.  If not, see <https://www.gnu.org/licenses/>.
16
 *
17
 * Copyright (c) 2017-2020 Vincent Quatrevieux
18
 */
19
20
package fr.quatrevieux.araknemu.data.world.entity.environment;
21
22
import fr.arakne.utils.maps.serializer.CellData;
23
import fr.arakne.utils.value.Dimensions;
24
import fr.quatrevieux.araknemu.data.value.Geolocation;
25
import org.checkerframework.checker.index.qual.NonNegative;
26
27
/**
28
 * Entity for Dofus map
29
 */
30
public final class MapTemplate {
31
    private final @NonNegative int id;
32
    private final String date;
33
    private final Dimensions dimensions;
34
    private final String key;
35
    private final CellData[] cells;
36
    private final @NonNegative int[][] fightPlaces;
37
    private final Geolocation geolocation;
38
    private final int subAreaId;
39
    private final boolean indoor;
40
41
    public MapTemplate(@NonNegative int id, String date, Dimensions dimensions, String key, CellData[] cells, @NonNegative int[][] fightPlaces, Geolocation geolocation, int subAreaId, boolean indoor) {
0 ignored issues
show
Comprehensibility introduced by
Constructor has 9 parameters, which is greater than 7 authorized.
Loading history...
42
        this.id = id;
43 1
        this.date = date;
44 1
        this.dimensions = dimensions;
45 1
        this.key = key;
46 1
        this.cells = cells;
47 1
        this.fightPlaces = fightPlaces;
48 1
        this.geolocation = geolocation;
49 1
        this.subAreaId = subAreaId;
50 1
        this.indoor = indoor;
51 1
    }
52 1
53 1
    public @NonNegative int id() {
54
        return id;
55
    }
56 1
57
    public String date() {
58
        return date;
59
    }
60 1
61
    public Dimensions dimensions() {
62
        return dimensions;
63
    }
64 1
65
    public String key() {
66
        return key;
67
    }
68 1
69
    public CellData[] cells() {
70
        return cells;
71
    }
72 1
73
    /**
74
     * Cell ids for start place on fights
75
     * The first index is used as team number
76 1
     */
77
    public @NonNegative int[][] fightPlaces() {
78
        return fightPlaces;
79
    }
80
81
    /**
82
     * Get the map coordinates as 2D point
83
     *
84
     * This location can be found into map_xx_xxx.swf, as value of MA.m[mapid]
85 1
     */
86
    public Geolocation geolocation() {
87
        return geolocation;
88
    }
89
90
    /**
91
     * Get the map subarea
92
     *
93
     * @see fr.quatrevieux.araknemu.data.world.entity.environment.area.SubArea#id()
94 1
     */
95
    public int subAreaId() {
96
        return subAreaId;
97
    }
98
99
    /**
100
     * Does the map is an indoor map ?
101
     * Indoor map are house or underground maps
102 1
     */
103
    public boolean indoor() {
104
        return indoor;
105
    }
106
}
107