예제 #1
0
파일: RoomFactory.java 프로젝트: kerko/epic
  private void appendEntities(Room room, NodeList creatures, DeferredStorage.StorageType type)
      throws FactoryException {
    for (int c = 0; c < creatures.getLength(); ++c) {
      Node creatureLink = creatures.item(c);

      String strX = FactoryUtils.getValue(creatureLink, Attributes.ATTR_X);
      String strY = FactoryUtils.getValue(creatureLink, Attributes.ATTR_Y);
      String id = FactoryUtils.getValue(creatureLink, Attributes.ATTR_ID);
      int x = Integer.parseInt(strX);
      int y = Integer.parseInt(strY);

      storage.add(room, id, type, x, y);
    }
  }
예제 #2
0
파일: RoomFactory.java 프로젝트: kerko/epic
 public RoomFactory(TextAdventure adventure, EntityFactory<Door> doorFactory) {
   this.adventure = adventure;
   this.doorFactory = doorFactory;
   storage = DeferredStorage.getInstance();
 }