use of provider.MapleData in project HeavenMS by ronancpl.
the class QuestAction method processData.
@Override
public void processData(MapleData data) {
for (MapleData qEntry : data) {
int questid = MapleDataTool.getInt(qEntry.getChildByPath("id"));
int stat = MapleDataTool.getInt(qEntry.getChildByPath("state"));
quests.put(questid, stat);
}
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class InfoExRequirement method processData.
@Override
public void processData(MapleData data) {
// Because we have to...
for (MapleData infoEx : data.getChildren()) {
MapleData value = infoEx.getChildByPath("value");
infoExpected.add(MapleDataTool.getString(value, ""));
}
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class WZFile method getData.
@Override
public synchronized MapleData getData(String path) {
try {
WZIMGFile imgFile = getImgFile(path);
if (imgFile == null) {
return null;
}
MapleData ret = imgFile.getRoot();
return ret;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class XMLDomMapleData method getChildByPath.
@Override
public MapleData getChildByPath(String path) {
String[] segments = path.split("/");
if (segments[0].equals("..")) {
return ((MapleData) getParent()).getChildByPath(path.substring(path.indexOf("/") + 1));
}
Node myNode = node;
for (int x = 0; x < segments.length; x++) {
NodeList childNodes = myNode.getChildNodes();
boolean foundChild = false;
for (int i = 0; i < childNodes.getLength(); i++) {
Node childNode = childNodes.item(i);
if (childNode.getNodeType() == Node.ELEMENT_NODE && childNode.getAttributes().getNamedItem("name").getNodeValue().equals(segments[x])) {
myNode = childNode;
foundChild = true;
break;
}
}
if (!foundChild) {
return null;
}
}
XMLDomMapleData ret = new XMLDomMapleData(myNode);
ret.imageDataDir = new File(imageDataDir, getName() + "/" + path).getParentFile();
return ret;
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class MapleItemInformationProvider method getName.
public String getName(int itemId) {
if (nameCache.containsKey(itemId)) {
return nameCache.get(itemId);
}
MapleData strings = getStringData(itemId);
if (strings == null) {
return null;
}
String ret = MapleDataTool.getString("name", strings, null);
nameCache.put(itemId, ret);
return ret;
}
Aggregations