kamas()   A
last analyzed

Complexity

Conditions 4

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 20

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 3
c 1
b 0
f 0
cc 4
ccs 0
cts 1
cp 0
crap 20
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.game.monster.reward;
21
22
import fr.arakne.utils.value.Interval;
23
import fr.quatrevieux.araknemu.data.world.entity.monster.MonsterRewardItem;
24
import org.checkerframework.checker.index.qual.NonNegative;
25
26
import java.util.Collections;
27
import java.util.List;
28
29
/**
30
 * Null object for rewards
31
 */
32 1
public final class NullMonsterGradesReward implements MonsterGradesReward {
33 1
    public static final NullMonsterGradesReward INSTANCE = new NullMonsterGradesReward();
34
35 1
    private static final Interval NULL_INTERVAL = new Interval(0, 0);
36 1
    private static final MonsterReward NULL_REWARD = new MonsterReward() {
37
        @Override
38
        public Interval kamas() {
39 1
            return NULL_INTERVAL;
40
        }
41
42
        @Override
43
        public @NonNegative long experience() {
44 1
            return 0;
45
        }
46
47
        @Override
48
        public List<MonsterRewardItem> items() {
49 1
            return Collections.emptyList();
50
        }
51
    };
52
53
    @Override
54
    public Interval kamas() {
55
        return NULL_INTERVAL;
56
    }
57
58
    @Override
59
    public @NonNegative long experience(int gradeNumber) {
60
        return 0;
61
    }
62
63
    @Override
64
    public List<MonsterRewardItem> items() {
65
        return Collections.emptyList();
66
    }
67
68
    @Override
69
    public MonsterReward grade(int gradeNumber) {
70 1
        return NULL_REWARD;
71
    }
72
}
73