Beispiel #1
0
 @Override
 public void spawnEntity(Entity entity) {
   if (entity == null) throw new NullPointerException();
   synchronized (entities) {
     if (!entities.contains(entity)) entities.add(entity);
   }
 }
Beispiel #2
0
 @Override
 public void despawnEntity(Entity entity) {
   if (entity == null) throw new NullPointerException();
   synchronized (entities) {
     entities.remove(entity);
   }
 }
Beispiel #3
0
 @Override
 public Entity[] getEntities() {
   synchronized (entities) {
     return entities.toArray(new Entity[entities.size()]);
   }
 }