Add new game states

This commit is contained in:
Laurin
2025-12-04 15:01:10 +01:00
parent ac185e35ce
commit 2c10e3e7fd
10 changed files with 724 additions and 26 deletions

View File

@@ -1,13 +1,31 @@
package club.mcscrims.speedhg.game
import org.bukkit.plugin.java.JavaPlugin
import club.mcscrims.speedhg.SpeedHG
import club.mcscrims.speedhg.game.impl.WaitingState
class GameManager(
private val plugin: JavaPlugin
private val plugin: SpeedHG
) {
private var currentState: GameState? = null
fun initialize()
{
currentState = WaitingState(
this,
plugin,
plugin.schedulerManager,
plugin.pluginConfig.data.getDuration( "waiting" ).seconds
)
try {
currentState?.onEnter( null )
} catch ( e: Exception ) {
plugin.logger.severe("Error during onEnter for state ${currentState?.name}: ${e.message}")
e.printStackTrace()
}
}
fun transitionTo(
nextState: GameState
) {