Class ContainerBasedEntity<T extends Entity<?>>

java.lang.Object
com.codingame.gameengine.module.entities.Entity<T>
com.codingame.gameengine.module.entities.ContainerBasedEntity<T>
Type Parameters:
T - a subclass inheriting Entity, used in order to return this as a T instead of a ContainerBasedEntity.
Direct Known Subclasses:
BufferedGroup, Group

public abstract class ContainerBasedEntity<T extends Entity<?>> extends Entity<T>
  • Method Details

    • remove

      public void remove(Entity<?> entity)
      Separates the given entity from this ContainerBasedEntity.
      Parameters:
      entity - the Entity to be removed from this ContainerBasedEntity, if it is part of it.
    • add

      public void add(Entity<?>... entities)
      Adds the given Entity instances to this ContainerBasedEntity.

      The entities will be displayed within a container controlled by this ContainerBasedEntity.

      Parameters:
      entities - the Entity instances to be added to this ContainerBasedEntity.
      Throws:
      IllegalArgumentException - if at least one given Entity is already in a ContainerBasedEntity.