forked from SteamWar/SteamWar
Merge pull request 'Add event grouping' (#57) from event-brackets into main
Reviewed-on: SteamWar/SteamWar#57 Reviewed-by: YoyoNow <yoyonow@noreply.localhost>
This commit is contained in:
+14
-3
@@ -33,6 +33,8 @@ import de.steamwar.fightsystem.states.OneShotStateDependent;
|
||||
import de.steamwar.fightsystem.winconditions.Wincondition;
|
||||
import de.steamwar.network.NetworkSender;
|
||||
import de.steamwar.network.packets.common.FightEndsPacket;
|
||||
import de.steamwar.sql.EventFight;
|
||||
import de.steamwar.sql.EventRelation;
|
||||
import de.steamwar.sql.SchematicNode;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import lombok.Getter;
|
||||
@@ -70,12 +72,21 @@ public class FightStatistics {
|
||||
}
|
||||
|
||||
private void setEventResult() {
|
||||
if (FightSystem.getLastWinner() == null)
|
||||
if (FightSystem.getLastWinner() == null) {
|
||||
Config.EventKampf.setErgebnis(0);
|
||||
else if (FightSystem.getLastWinner().isBlue())
|
||||
} else if (FightSystem.getLastWinner().isBlue()) {
|
||||
Config.EventKampf.setErgebnis(1);
|
||||
else
|
||||
} else {
|
||||
Config.EventKampf.setErgebnis(2);
|
||||
}
|
||||
|
||||
Config.EventKampf.getDependents().forEach(EventRelation::apply);
|
||||
|
||||
Config.EventKampf.getGroup().ifPresent(group -> {
|
||||
if (group.getLastFight().map(EventFight::getFightID).orElse(-1) == Config.EventKampf.getFightID() && !group.needsTieBreak()) {
|
||||
group.getDependents().forEach(EventRelation::apply);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void disable() {
|
||||
|
||||
Reference in New Issue
Block a user