GameSystem ready!

hmm, im stumbling across this. Instead of a Hashmap, put an Arraylist in there and we’re done. I think its a good solution to the problem…



/**
    * Detach an entity from the GameSystem
    *
    * @param entity,
    *            the entity to detach
    */
   public void detachChild(Entity entity) {
      entityRemovalList.add(entity);
   }

   /**
    * Detach and entity from the GameSystem based on it's name
    *
    * @param name
    */
   public void detachChild(String name) {
      entityRemovalList.add(entityList.get(name));
   }



And a loop in the update:


// now loop through all entities that are to be removed
      for (int i = 0; i < entityRemovalList.size(); i++) {
         entityList.remove(entityRemovalList.get(i));
      }



DP

Hi DarkProphet





              Can you post a example.  I am trying to integrate the script language but i need to understand (better) the way that game system works.





tanks

DarkProphet has left jME a while ago - you may try to PM him, but it is possible you have to figure out on your own . . .