use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class InventoryTransactionManager method updateType.
public static void updateType(Unit hero) {
hero.setType(new ObjType(hero.getType()));
ObjType type = hero.getType();
// TODO init type?
hero.getGame().initType(type);
for (PROPERTY prop : INV_PROPS) {
type.copyValue(prop, hero);
// String property = hero.getProperty(prop);for (String item :
// StringMaster.openContainer(property)) {
// if (hero.getGame().getObjectById(StringMaster.getInteger(item))
// != null) {
// String string = hero.getGame()
// .getObjectById(StringMaster.getInteger(item))
// .getId().toString();
// // .getName();
// if (prop.isContainer())
// type.addProperty(prop, string);
// else
// type.setProperty(prop, string);
// }
// }
// type.setProperty(prop, property);
}
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class Level method getXml.
public String getXml() {
String xml = XML_Converter.openXmlFormatted("Level");
xml += XML_Converter.openXmlFormatted("Custom Props");
for (PROPERTY prop : location.getPropMap().keySet()) {
String value = location.getProperty(prop);
if (prop == G_PROPS.WORKSPACE_GROUP || prop == PROPS.ENEMY_SPAWN_COORDINATES || prop == PROPS.PARTY_SPAWN_COORDINATES || !value.equals(location.getType().getType().getProperty(prop))) // dungeon.getType().getType() - original type
{
xml += XML_Converter.wrapLeaf(prop.getName(), value);
}
}
xml += XML_Converter.closeXmlFormatted("Custom Props");
xml += XML_Converter.openXmlFormatted("Custom Params");
for (PARAMETER param : location.getParamMap().keySet()) {
String value = location.getParam(param);
if (!value.equals(location.getType().getType().getParam(param))) {
xml += XML_Converter.wrapLeaf(param.getName(), value);
}
}
xml += XML_Converter.closeXmlFormatted("Custom Params");
String wallObjData = getWallObjData();
xml += XML_Converter.wrapLeaf(DungeonBuilder.WALL_OBJ_DATA_NODE, wallObjData);
String facingMapData = getFacingMapData();
if (!facingMapData.isEmpty()) {
xml += XML_Converter.wrapLeaf(DungeonBuilder.DIRECTION_MAP_NODE, facingMapData);
}
String aiGroupData = getAiGroupData();
if (!aiGroupData.isEmpty()) {
xml += XML_Converter.wrapLeaf(LocationBuilder.AI_GROUPS_NODE, aiGroupData);
}
xml += location.getPlan().getXml();
xml += XML_Converter.closeXmlFormatted("Level");
return xml;
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class Mission method getData.
public String getData() {
String data = "";
// obj.setProperty(MACRO_PROPS.DUNGEON_LEVELS,
// StringMaster.constructContainer(ListMaster
// .toStringList(levels.toArray())));
data += XML_Converter.openXmlFormatted("Custom Props");
for (PROPERTY p : obj.getPropMap().keySet()) {
String value = obj.getProperty(p);
if (!StringMaster.compareByChar(value, obj.getType().getProperty(p))) {
// data += portrait.getName() + "=" + value + ",";
data += XML_Converter.wrapLeaf(p.getName(), value);
}
}
data += XML_Converter.closeXmlFormatted("Custom Props");
data += XML_Converter.openXmlFormatted("Custom Params");
for (PARAMETER p : obj.getParamMap().keySet()) {
String value = obj.getParam(p);
if (!StringMaster.compareByChar(value, obj.getType().getParam(p))) {
// data += portrait.getName() + "=" + value + ";";
data += XML_Converter.wrapLeaf(p.getName(), value);
}
}
data += XML_Converter.closeXmlFormatted("Custom Params");
// }
return data;
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class XML_Transformer method renameType.
public static void renameType(ObjType type, String newName, PROPERTY... props) {
// backUp();
// after files are read
boolean dynamic = false;
if (props == null) {
dynamic = true;
}
// props = getValuesForType(obj_type);
for (PROPERTY prop : props) {
if (dynamic) {
}
for (OBJ_TYPE key : ContentManager.getOBJ_TYPEsForValue(prop)) {
for (ObjType objType : DataManager.getTypes(key)) {
String value = objType.getProperty(prop);
value = value.replaceAll(type.getName(), newName);
objType.setProperty(prop, value);
}
XML_Writer.writeXML_ForTypeGroup(key);
}
}
type.setName(newName);
XML_Writer.writeXML_ForType(type, type.getOBJ_TYPE_ENUM());
// XML_File file = getFile(type.getOBJ_TYPE_ENUM());
// String newContents = file
// .getContents()
// .replaceAll(XML_Converter.openXML(type.getName()), XML_Converter
// .openXML(newName));
// newContents =
// file.getContents().replaceAll(XML_Converter.closeXML(type
// .getName()), XML_Converter.closeXML(newName));
// String nameOpen = XML_Converter.openXML(type.getName());
// String nameClose = XML_Converter.closeXML(type.getName());
// newContents = file.getContents().replaceFirst(nameOpen +
// type.getName()
// + nameClose, nameOpen + newName + nameClose);
// file.setContents(newContents);
// XML_Writer.write(file);
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class MC_ControlPanel method massEdit.
public static void massEdit(boolean emptyOnly) {
List<ObjType> types = DataManager.getTypes(AT_OBJ_TYPE.MUSIC_LIST);
VALUE prop = getMassFilterValue();
if (prop != null) {
String filterValue = inputMassValue(prop);
for (ObjType sub : new ArrayList<>(types)) // if (emptyOnly) {
{
if (!sub.checkContainerProp((PROPERTY) prop, filterValue, true)) {
types.remove(sub);
}
}
// } else if (!generic.checkValue(prop, filterValue))
// types.remove(generic);
}
prop = getMassEditValue();
if (prop == null) {
return;
}
if (emptyOnly) {
for (ObjType sub : new ArrayList<>(types)) {
if (sub.checkValue(prop)) {
types.remove(sub);
}
}
}
massEdit(types, prop);
}
Aggregations