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