fr.arakne.utils.maps.serializer.CellLayerData   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 33
ccs 1
cts 1
cp 1
rs 10
wmc 1

4 Methods

Rating   Name   Duplication   Size   Complexity  
rotation() 0 2 ?
number() 0 2 ?
flip() 0 2 ?
A active() 0 3 1
1
/*
2
 * This file is part of ArakneUtils.
3
 *
4
 * ArakneUtils 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
 * ArakneUtils 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 ArakneUtils.  If not, see <https://www.gnu.org/licenses/>.
16
 *
17
 * Copyright (c) 2017-2020 Vincent Quatrevieux
18
 */
19
20
package fr.arakne.utils.maps.serializer;
21
22
import org.checkerframework.dataflow.qual.Pure;
23
24
/**
25
 * Data for a single cell layer
26
 */
27
public interface CellLayerData {
28
    /**
29
     * The object number on the cell
30
     *
31
     * @return int
32
     */
33
    @Pure
34
    public int number();
35
36
    /**
37
     * The rotation value of the sprite
38
     *
39
     * @return int
40
     */
41
    @Pure
42
    public int rotation();
43
44
    /**
45
     * Does the sprite has been flipped ?
46
     *
47
     * @return bool
48
     */
49
    @Pure
50
    public boolean flip();
51
52
    /**
53
     * Check if the layer is active (i.e. has an object)
54
     *
55
     * @return bool
56
     */
57
    @Pure
58
    public default boolean active() {
59 1
        return number() != 0;
60
    }
61
}
62