Add new game states
This commit is contained in:
@@ -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
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user