Class SpawnPositionComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.enemy.SpawnPositionComponent
Simple component that stores an entity's spawn position in world coordinates.
Intended as a fixed reference point, not the entity's live position. SpawnPos cannot be
mutated by external callers with defensive copying.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSpawnPositionComponent
(com.badlogic.gdx.math.Vector2 spawnPos) Create a spawn position component -
Method Summary
Modifier and TypeMethodDescriptioncom.badlogic.gdx.math.Vector2
Returns the spawn positionMethods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
SpawnPositionComponent
public SpawnPositionComponent(com.badlogic.gdx.math.Vector2 spawnPos) Create a spawn position component- Parameters:
spawnPos
- the spawn position in world coordinates
-
-
Method Details
-
getSpawnPos
public com.badlogic.gdx.math.Vector2 getSpawnPos()Returns the spawn position- Returns:
- a copy of the spawn position in world coordinates
-