pathPositions.addAll(routePositionIds);
}
}
// create the object
Guard guard = new Guard(id, position, pathPositions, map);
for(int i = 0; i < rawList.getLength(); i++){
Node node = rawList.item(i);
// fill the belief base object:
if( node.getNodeType() == Node.ELEMENT_NODE &&
node.getNodeName().equals(STR_BELIEFBASE)
){
Element mind = (Element)node;
BeliefBase knowledge = guard.getBeliefBase();
knowledge.seenFromNear(XMLLoader.getPositions(mind, map));
}
// fill the inventory:
if( node.getNodeType() == Node.ELEMENT_NODE &&
node.getNodeName().equals(STR_INVENTORY)
){
Element inventory = (Element)node;
List<Item> items = XMLLoader.getItems(inventory, map);
map.addItems(items);
guard.addItems(items);
}
}
// add the uniform:
Uniform clothes = new Uniform(map.getNextID(), map);
guard.addItem(clothes);
map.addItem(clothes);
if(isStunned)
guard.daze();
return guard;
}