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-2019 Vincent Quatrevieux |
18
|
|
|
*/ |
19
|
|
|
|
20
|
|
|
package fr.quatrevieux.araknemu.game.fight.module; |
21
|
|
|
|
22
|
|
|
import fr.quatrevieux.araknemu.core.event.EventsSubscriber; |
23
|
|
|
import fr.quatrevieux.araknemu.game.fight.Fight; |
24
|
|
|
import fr.quatrevieux.araknemu.game.fight.castable.effect.EffectsHandler; |
25
|
|
|
import fr.quatrevieux.araknemu.game.fight.state.FightState; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* The fight module is used to register new effects, or listeners on the fight for extends its capabilities |
29
|
|
|
* The module instance is dedicated to one fight instance, and can safely be used as state object |
30
|
|
|
*/ |
31
|
|
|
public interface FightModule extends EventsSubscriber { |
32
|
|
|
/** |
33
|
|
|
* Register fight effects into the effect handle |
34
|
|
|
*/ |
35
|
1 |
|
public default void effects(EffectsHandler handler) {} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* The fight has changed its current state |
39
|
|
|
*/ |
40
|
1 |
|
public default void stateChanged(FightState newState) {} |
41
|
|
|
|
42
|
|
|
public static interface Factory { |
43
|
|
|
/** |
44
|
|
|
* Create the module for the given fight |
45
|
|
|
*/ |
46
|
|
|
public FightModule create(Fight fight); |
47
|
|
|
} |
48
|
|
|
} |
49
|
|
|
|