Class Arena
java.lang.Object
io.github.projectunified.minigamecore.base.FeatureUnit
io.github.projectunified.minigamecore.base.Arena
- All Implemented Interfaces:
- Initializer,- Runnable
- Direct Known Subclasses:
- BukkitArena,- StandaloneArena
The arena. The unit that handles the game
- 
Constructor SummaryConstructorsConstructorDescriptionArena(FeatureUnit... parent) Create a new arenaArena(List<FeatureUnit> parentList) Create a new arena
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleancallStateChanged(GameState oldStage, GameState newStage) Called when the arena's state is about to change.final voidclear()Clear the objectprotected voidClear the arenaGet the game state of the arenaGet the instance of the current game state of the arenaGet the next game state of the arenaGet the instance of the next game state of the arenafinal voidinit()Init the objectprotected voidInitialize the arenabooleanisValid()Check if the arena is valid.Load the featuresLoad the game statesfinal voidpostInit()Called on special event when all the objects are initializedprotected voidPost-initialize the arenafinal voidrun()voidsetNextState(Class<? extends GameState> stateClass) Set the next game state of the arena.Methods inherited from class io.github.projectunified.minigamecore.base.FeatureUnitgetFeature, getFeatures, getGameState, getGameStates, getParent, getParentList
- 
Constructor Details- 
ArenaCreate a new arena- Parameters:
- parentList- the parent- FeatureUnitlist
 
- 
ArenaCreate a new arena- Parameters:
- parent- the parent- FeatureUnit
 
 
- 
- 
Method Details- 
initArenaprotected void initArena()Initialize the arena- See Also:
 
- 
postInitArenaprotected void postInitArena()Post-initialize the arena- See Also:
 
- 
clearArenaprotected void clearArena()Clear the arena- See Also:
 
- 
callStateChangedCalled when the arena's state is about to change. This is usually used to perform actions or validations on state transitions. Return false to cancel the state change (e.g., if you manually set a new state viasetNextState(Class)).- Parameters:
- oldStage- the old state (may be null)
- newStage- the new state (may be null)
- Returns:
- true if the change should proceed, false to cancel it
 
- 
isValidpublic boolean isValid()Check if the arena is valid. Mainly called when the arena is being registered to the arena manager.- Returns:
- true if the arena is valid, otherwise false
 
- 
loadGameStatesDescription copied from class:FeatureUnitLoad the game states- Specified by:
- loadGameStatesin class- FeatureUnit
- Returns:
- the game states
 
- 
loadFeaturesDescription copied from class:FeatureUnitLoad the features- Specified by:
- loadFeaturesin class- FeatureUnit
- Returns:
- the features
 
- 
initpublic final void init()Description copied from interface:InitializerInit the object- Specified by:
- initin interface- Initializer
- Overrides:
- initin class- FeatureUnit
 
- 
postInitpublic final void postInit()Description copied from interface:InitializerCalled on special event when all the objects are initialized- Specified by:
- postInitin interface- Initializer
- Overrides:
- postInitin class- FeatureUnit
 
- 
clearpublic final void clear()Description copied from interface:InitializerClear the object- Specified by:
- clearin interface- Initializer
- Overrides:
- clearin class- FeatureUnit
 
- 
runpublic final void run()
- 
getCurrentStateGet the game state of the arena- Returns:
- the class of the game state
 
- 
getCurrentStateInstanceGet the instance of the current game state of the arena- Returns:
- the instance of the game state
 
- 
getNextStateGet the next game state of the arena- Returns:
- the class of the game state
 
- 
setNextStateSet the next game state of the arena.- Parameters:
- stateClass- the class of the game state
 
- 
getNextStateInstanceGet the instance of the next game state of the arena- Returns:
- the instance of the game state
 
 
-