Add modular fight system components and configurations

Signed-off-by: Chaoscaot <max@maxsp.de>
This commit is contained in:
2026-03-17 18:30:53 +01:00
parent 5e19629df5
commit a37321d3b8
19 changed files with 638 additions and 3 deletions
@@ -0,0 +1,32 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2026 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
steamwar.kotlin
alias(libs.plugins.shadow)
}
java {
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
}
dependencies {
implementation(project(":ModularFightSystem:GameCore"))
}
@@ -0,0 +1,29 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2026 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.fightsystem
import de.steamwar.fightsystem.state.FightState
class FightSystem {
}
fun test() {
FightState.register()
}
@@ -0,0 +1,54 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2026 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.fightsystem.state
import de.steamwar.modularfightsystem.complement
import de.steamwar.modularfightsystem.enumSetAll
import de.steamwar.modularfightsystem.enumSetOf
import de.steamwar.modularfightsystem.state.FightStateMachine
enum class FightState {
PRE_LEADER_SETUP,
PRE_SCHEM_SETUP,
POST_SCHEM_SETUP,
PRE_RUNNING,
RUNNING,
SPECTATE;
companion object : FightStateMachine<FightState>(PRE_LEADER_SETUP) {
val All = enumSetAll<FightState>()
val PreLeaderSetup = enumSetOf(PRE_LEADER_SETUP)
val PreSchemSetup = enumSetOf(PRE_SCHEM_SETUP)
val PostSchemSetup = enumSetOf(POST_SCHEM_SETUP)
val PreRunning = enumSetOf(PRE_RUNNING)
val Running = enumSetOf(RUNNING)
val Spectate = enumSetOf(SPECTATE)
val Setup = enumSetOf(PRE_LEADER_SETUP, PRE_SCHEM_SETUP, POST_SCHEM_SETUP)
val Ingame = enumSetOf(PRE_RUNNING, RUNNING)
val TeamFix = enumSetOf(PRE_RUNNING, RUNNING, SPECTATE)
val Schem = enumSetOf(PRE_LEADER_SETUP, PRE_SCHEM_SETUP).complement()
val Recording = enumSetOf(PRE_LEADER_SETUP, PRE_SCHEM_SETUP, SPECTATE).complement()
val AntiRunning = enumSetOf(RUNNING).complement()
val AntiIngame = enumSetOf(PRE_RUNNING, RUNNING).complement()
val AntiSpectate = enumSetOf(SPECTATE).complement()
}
}