Class EntityCollectAction


  • public class EntityCollectAction
    extends EntityAction
    An entity action for when an entity collects another entity.
    Author:
    Tim Neumann
    • Constructor Detail

      • EntityCollectAction

        public EntityCollectAction​(long tickNumber,
                                   Entity entity,
                                   CollectableEntity collected,
                                   Position collectorPos,
                                   Position collectedPos)
        Create an entity collect action.
        Parameters:
        tickNumber - the tick the action happened at
        entity - the entity that caused the action
        collected - the entity that was collected
        collectorPos - the position the collector was at while collecting
        collectedPos - the position the collected entity was at while being collected
    • Method Detail

      • getCollectedEntity

        public CollectableEntity getCollectedEntity()
        Returns:
        the entity that was collected
      • getCollectedEntityPosition

        public Position getCollectedEntityPosition()
        Returns:
        the position the collected entity was at while being collected
      • getCollectorPosition

        public Position getCollectorPosition()
        Returns:
        the position the collector was at while collecting
      • getDescription

        public String getDescription()
        Specified by:
        getDescription in class Action
        Returns:
        the description of this action