Class ItemPickupComponent

java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.ItemPickupComponent
Direct Known Subclasses:
AuraPickupComponent

public class ItemPickupComponent extends Component
Generic pickup component for all items. Adpoted from Team 4's weapon pickup logic that is now deleted to merge with this component
  • 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.
      Overrides:
      create in class Component
    • 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.