Class FeatureUnit
java.lang.Object
io.github.projectunified.minigamecore.base.FeatureUnit
- All Implemented Interfaces:
Initializer
- Direct Known Subclasses:
Arena,ArenaManager
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureUnit(FeatureUnit... parent) Create a newFeatureUnitFeatureUnit(List<FeatureUnit> parentList) Create a newFeatureUnit -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the object<T extends Feature>
TgetFeature(Class<T> featureClass) Get the instance of the featuregetFeatures(boolean deep) Get all classes of the features<T extends GameState>
TgetGameState(Class<T> gameStateClass) Get the instance of the game stategetGameStates(boolean deep) Get all classes of the game statesGet the parentFeatureUnit.Get the parentFeatureUnitlistvoidinit()Init the objectLoad the featuresLoad the game statesvoidpostInit()Called on special event when all the objects are initialized
-
Constructor Details
-
FeatureUnit
Create a newFeatureUnit- Parameters:
parentList- the parentFeatureUnitlist
-
FeatureUnit
Create a newFeatureUnit- Parameters:
parent- the parentFeatureUnit
-
-
Method Details
-
loadGameStates
Load the game states- Returns:
- the game states
-
loadFeatures
Load the features- Returns:
- the features
-
getParent
Get the parentFeatureUnit. It takes the first element from the result ofgetParentList(). If the result is empty, it will return null- Returns:
- the parent
FeatureUnitor null if not present
-
getParentList
Get the parentFeatureUnitlist- Returns:
- the parent
FeatureUnitlist
-
init
public void init()Description copied from interface:InitializerInit the object- Specified by:
initin interfaceInitializer
-
postInit
public void postInit()Description copied from interface:InitializerCalled on special event when all the objects are initialized- Specified by:
postInitin interfaceInitializer
-
clear
public void clear()Description copied from interface:InitializerClear the object- Specified by:
clearin interfaceInitializer
-
getGameState
Get the instance of the game state- Type Parameters:
T- the type of the game state- Parameters:
gameStateClass- the class of the game state- Returns:
- the instance of the game state
-
getFeature
Get the instance of the feature- Type Parameters:
T- the type of the feature- Parameters:
featureClass- the class of the feature- Returns:
- the instance of the feature
-
getGameStates
Get all classes of the game states- Parameters:
deep- if true, it will get all classes of the game states from the parent- Returns:
- the classes
-
getFeatures
Get all classes of the features- Parameters:
deep- if true, it will get all classes of the features from the parent- Returns:
- the classes
-