Package com.deco2800.game.components
Class ItemPickupComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.ItemPickupComponent
- Direct Known Subclasses:
AuraPickupComponent
Generic pickup component for all items. Adpoted from Team 4's weapon pickup logic that is now
deleted to merge with this component
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionItemPickupComponent
(short targetLayer) Creates a component which allows an entity to be picked up from the map and put in inventory -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.void
pickUpJunit
(com.badlogic.gdx.physics.box2d.Fixture me, com.badlogic.gdx.physics.box2d.Fixture other) Pickup function used purely for Junit testing only.Methods inherited from class com.deco2800.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
ItemPickupComponent
public ItemPickupComponent(short targetLayer) Creates a component which allows an entity to be picked up from the map and put in inventory- Parameters:
targetLayer
- The physics layer of the target's collider.
-
-
Method Details
-
create
public void create()Description copied from class:Component
Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished. -
pickUpJunit
public void pickUpJunit(com.badlogic.gdx.physics.box2d.Fixture me, com.badlogic.gdx.physics.box2d.Fixture other) Pickup function used purely for Junit testing only.- Parameters:
me
- Fixture of the weapon that implements this component.other
- Fixture of the entity that is colliding with this weapon on the map.
-