public class SkillsFromXmlLoader extends Object
LowSkills
and Phases
with the objects of loaded low skills and phases.
TODO: is there any reason why this class is not a singleton? Especially when LowSkills and Phases are?Modifier and Type | Field and Description |
---|---|
(package private) Map<String,Double> |
constants |
(package private) File |
currentlyProcessed |
(package private) Phase |
currentPhase |
(package private) File |
directoryWithXmls |
(package private) Set<String> |
requiredPhases |
Constructor and Description |
---|
SkillsFromXmlLoader(File directoryWithXmls)
Creates a new loader object
|
Modifier and Type | Method and Description |
---|---|
private void |
appendEffectorsToPhase(Node effectorsNode)
Populates phases' effector list
|
private void |
appendToConstants(Node constant) |
private Double |
calculateNumericValue(String endAngle) |
private Phase |
createPhase(Node phaseNode) |
private LowSkill |
createSkill(Node lowSkillNode) |
private String |
getNodeAttribute(Node phaseNode,
String attribute) |
private boolean |
hasAttribute(Node phaseNode,
String attribute) |
void |
load()
Loads skills from xml files.
|
private void |
loadMoveCache() |
private void |
loadMovesFrom(File xml) |
private void |
populatePhaseAttributes(Node phaseNode,
Phase phase) |
private double |
roundToNearestTwenty(Double supplied)
Agent receives and sends data in a 20ms discrete tick.
|
private void |
saveMoveCache() |
private void |
validate(Phase phase) |
File currentlyProcessed
File directoryWithXmls
Phase currentPhase
public SkillsFromXmlLoader(File directoryWithXmls)
directoryWithXmls
- the directory from which the low skills will be loadedpublic void load() throws ParserConfigurationException, SAXException, IOException, XPathExpressionException
private void saveMoveCache() throws IOException
IOException
private void loadMoveCache() throws IOException
IOException
private void loadMovesFrom(File xml) throws ParserConfigurationException, SAXException, IOException, XPathExpressionException
private void appendToConstants(Node constant)
private void validate(Phase phase)
private double roundToNearestTwenty(Double supplied)
private void appendEffectorsToPhase(Node effectorsNode)