Package com.csse3200.game.components
Class ProximityActivationComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.ProximityActivationComponent
- Direct Known Subclasses:
FOVComponent
This component can be used to call an entry or exit method when on of the tracking
entities enters or exits a proximity.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ProximityActivationComponent.ProximityFunc
protected final ProximityActivationComponent.ProximityFunc
protected final float
-
Constructor Summary
ConstructorsConstructorDescriptionProximityActivationComponent
(float radius, ProximityActivationComponent.ProximityFunc entered, ProximityActivationComponent.ProximityFunc exited) ProximityActivationComponent
(float radius, Entity entity, ProximityActivationComponent.ProximityFunc entered, ProximityActivationComponent.ProximityFunc exited) ProximityActivationComponent
(float radius, List<Entity> entities, ProximityActivationComponent.ProximityFunc entered, ProximityActivationComponent.ProximityFunc exited) -
Method Summary
Modifier and TypeMethodDescriptionboolean
entityIsInProximity
(Entity entity) void
update()
Checks whether the entity has entered or exited the radius calls the relevant method if so.Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate
-
Field Details
-
radius
protected final float radius -
entered
-
exited
-
-
Constructor Details
-
ProximityActivationComponent
public ProximityActivationComponent(float radius, Entity entity, ProximityActivationComponent.ProximityFunc entered, ProximityActivationComponent.ProximityFunc exited) -
ProximityActivationComponent
public ProximityActivationComponent(float radius, List<Entity> entities, ProximityActivationComponent.ProximityFunc entered, ProximityActivationComponent.ProximityFunc exited) -
ProximityActivationComponent
public ProximityActivationComponent(float radius, ProximityActivationComponent.ProximityFunc entered, ProximityActivationComponent.ProximityFunc exited)
-
-
Method Details