Interface EntityCollector

  • All Known Implementing Classes:
    GreedyEntity

    public interface EntityCollector
    An entity which can collect CollectableEntity.
    Author:
    Tim Neumann
    • Method Detail

      • canCarry

        boolean canCarry​(Class<? extends CollectableEntity> type)
        Check if this can collect and drop the given collectable entity type.
        Parameters:
        type - The type to check; must not be null
        Returns:
        true if this entity collector can collect or drop the given entity type
      • drop

        void drop​(CollectableEntity entity,
                  Position pos)
        Drop the given entity.
        Parameters:
        entity - The entity to drop;must not be null; must be droppable by this
        pos - The position to drop the entity at; must not be null
        Throws:
        CannotDropEntityException - if the given entity cannot be dropped right now for any reason
        IllegalArgumentException - if an argument is null