public class GameObjectManager
extends java.lang.Object
Constructor and Description |
---|
GameObjectManager(Profile profile)
Accepts the player's profile to re-create some GameObjects using save data.
|
Modifier and Type | Method and Description |
---|---|
<T> void |
freeGameObject(GameObject gameObject,
java.lang.Class<T> goClass)
Frees a gameObject back inside the manager's internal GameObject pools.
|
<T> T |
getGameObject(java.lang.Class<T> goClass)
Gets a tree GameObject of the given class cached inside one of the Manager's pools.
|
Player |
getPlayer()
Returns the Player GameObject being managed by the manager.
|
Earthquake |
spawnEarthquake(float x,
float y,
Human.Direction direction)
Spawns an Earthquake instance at the given bottom-center (x,y) position.
|
ItemObject |
spawnItemObject(float x,
float y,
float velocityMultiplier,
Human.Direction direction)
Spawns an ItemObject at the given position.
|
public GameObjectManager(Profile profile)
public Player getPlayer()
public ItemObject spawnItemObject(float x, float y, float velocityMultiplier, Human.Direction direction)
velocityMultiplier
- Multiplier which allows certain items to fly further or closer when spawned.direction
- Specifies the direction in which the item will fly when spawned.public Earthquake spawnEarthquake(float x, float y, Human.Direction direction)
public <T> T getGameObject(java.lang.Class<T> goClass)
T
- The type of GameObject that wants to be retrieved.public <T> void freeGameObject(GameObject gameObject, java.lang.Class<T> goClass)