Files
SteamWar/GameCore/README.md
T
Chaoscaot 12e085600e Move arena runtime configuration into GameCore
- Replace FightSystem runtime properties with shared GameConfig
- Update dependent modules, commands, states, and tests
2026-07-24 12:51:03 +02:00

36 lines
1.4 KiB
Markdown

# GameCore
GameCore is the Kotlin runtime library shared by SteamWar game-mode plugins.
Its implementation is based on FightSystem, the most exhaustive game mode, and
contains the mechanics that do not depend on a specific arena:
- restartable Bukkit countdown scheduling, FightSystem milestone behavior,
message/sound/level presentation policy, and shared skip behavior;
- generic team contracts, team lookup, readiness, and opposite-team handling;
- reusable winner/draw results and score/last-remaining evaluation;
- the complete state-dependent lifecycle (one-shots, tasks, listeners, commands,
and countdowns);
- the FightSystem arena modes and shared JVM runtime configuration;
- observable, generic game-state transitions.
GameCore intentionally does not define a game-state enum. Each consumer supplies
its own enum to `GameStateMachine<S>` and the generic state-dependent classes, so
each game mode controls its valid states while sharing the lifecycle behavior.
```kotlin
enum class State { WAITING, RUNNING, END }
val lifecycle = GameStateMachine(State.WAITING)
StateDependentListener(
lifecycle,
true,
setOf(State.RUNNING),
plugin,
ingameListener,
)
```
FightSystem, MissileWars, TNTLeague, and TowerRun retain their own messages,
inventories, listeners, schematics, and concrete win rules. They depend on the
GameCore plugin at runtime; GameCore itself depends on KotlinCore.