use of provider.MapleData in project HeavenMS by ronancpl.
the class ItemRequirement method processData.
@Override
public void processData(MapleData data) {
for (MapleData itemEntry : data.getChildren()) {
int itemId = MapleDataTool.getInt(itemEntry.getChildByPath("id"));
int count = MapleDataTool.getInt(itemEntry.getChildByPath("count"), 0);
items.put(itemId, count);
}
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class MobRequirement method processData.
/**
* @param data
*/
@Override
public void processData(MapleData data) {
for (MapleData questEntry : data.getChildren()) {
int mobID = MapleDataTool.getInt(questEntry.getChildByPath("id"));
int countReq = MapleDataTool.getInt(questEntry.getChildByPath("count"));
mobs.put(mobID, countReq);
}
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class WZIMGEntry 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));
}
MapleData ret = this;
for (int x = 0; x < segments.length; x++) {
boolean foundChild = false;
for (MapleData child : ret.getChildren()) {
if (child.getName().equals(segments[x])) {
ret = child;
foundChild = true;
break;
}
}
if (!foundChild) {
return null;
}
}
return ret;
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class XMLDomMapleData method getChildren.
@Override
public List<MapleData> getChildren() {
List<MapleData> ret = new ArrayList<MapleData>();
NodeList childNodes = node.getChildNodes();
for (int i = 0; i < childNodes.getLength(); i++) {
Node childNode = childNodes.item(i);
if (childNode.getNodeType() == Node.ELEMENT_NODE) {
XMLDomMapleData child = new XMLDomMapleData(childNode);
child.imageDataDir = new File(imageDataDir, getName());
ret.add(child);
}
}
return ret;
}
use of provider.MapleData in project HeavenMS by ronancpl.
the class MapleItemInformationProvider method getAllItems.
public List<Pair<Integer, String>> getAllItems() {
if (!itemNameCache.isEmpty()) {
return itemNameCache;
}
List<Pair<Integer, String>> itemPairs = new ArrayList<>();
MapleData itemsData;
itemsData = stringData.getData("Cash.img");
for (MapleData itemFolder : itemsData.getChildren()) {
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
}
itemsData = stringData.getData("Consume.img");
for (MapleData itemFolder : itemsData.getChildren()) {
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
}
itemsData = stringData.getData("Eqp.img").getChildByPath("Eqp");
for (MapleData eqpType : itemsData.getChildren()) {
for (MapleData itemFolder : eqpType.getChildren()) {
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
}
}
itemsData = stringData.getData("Etc.img").getChildByPath("Etc");
for (MapleData itemFolder : itemsData.getChildren()) {
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
}
itemsData = stringData.getData("Ins.img");
for (MapleData itemFolder : itemsData.getChildren()) {
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
}
itemsData = stringData.getData("Pet.img");
for (MapleData itemFolder : itemsData.getChildren()) {
itemPairs.add(new Pair<>(Integer.parseInt(itemFolder.getName()), MapleDataTool.getString("name", itemFolder, "NO-NAME")));
}
return itemPairs;
}
Aggregations