コード例 #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();
 }