use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class ListChooser method chooseObj.
public static String chooseObj(List list, SELECTION_MODE MODE) {
OBJ_TYPE T = ((Entity) list.get(0)).getOBJ_TYPE_ENUM();
sortingDisabled = true;
return new ListChooser(MODE, ListMaster.toNameList(list), T).getString();
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class VendorListsPanel method initListMap.
public Map<String, HC_PagedListPanel> initListMap(String tabName) {
List<String> group = getListGroup(tabName);
ArrayList<String> specialLists = new ArrayList<>();
Map<String, HC_PagedListPanel> map = new XLinkedMap<>();
for (String listName : group) {
if (checkSpecial(listName)) {
specialLists.add(listName);
continue;
}
if (!responsive) {
if (!checkList(listName, false)) {
continue;
}
}
if (!showAll) {
if (!checkList(listName, true)) {
continue;
}
}
List<String> types = DataManager.getTypesSubGroupNames(TYPE, listName);
if (Launcher.ILYA_MODE) {
if (TYPE == DC_TYPE.SPELLS || TYPE == DC_TYPE.SKILLS) {
FilterMaster.filterByProp(types, G_PROPS.WORKSPACE_GROUP.getName(), "" + MetaEnums.WORKSPACE_GROUP.DESIGN, TYPE, true);
FilterMaster.filterByProp(types, G_PROPS.WORKSPACE_GROUP.getName(), "" + MetaEnums.WORKSPACE_GROUP.IMPLEMENT, TYPE, true);
FilterMaster.filterByProp(types, PROPS.ITEM_SHOP_CATEGORY.getName(), "" + ItemEnums.ITEM_SHOP_CATEGORY.SPECIAL, TYPE, true);
// so you see, it wouldn't be hard to filter the items for
// each shop in macro
}
}
if (types == null) {
// shot in the leg!
continue;
}
if (types.isEmpty()) {
continue;
}
List<ObjType> data;
// if (checkSpecial(listName))
// data = getSpecialData();
// else {
OBJ_TYPE T = TYPE;
if (T instanceof C_OBJ_TYPE) {
if (tabName.equalsIgnoreCase(DC_TYPE.JEWELRY.getName())) {
T = DC_TYPE.JEWELRY;
}
if (tabName.equalsIgnoreCase(ItemEnums.ITEM_TYPE.ALCHEMY.toString())) {
T = DC_TYPE.ITEMS;
}
// if (TYPE != OBJ_TYPES.SPELLS)
if (tabName.equalsIgnoreCase(ItemEnums.ARMOR_TYPE.LIGHT.toString()) || tabName.equalsIgnoreCase(ItemEnums.ARMOR_TYPE.HEAVY.toString())) {
T = DC_TYPE.ARMOR;
}
}
// TODO is there a
data = DataManager.toTypeList(types, T);
if (getFilter() != null) {
data = getFilter().filter(data);
}
if (getSpecialFilter() != null) {
data = getSpecialFilter().filter(data);
}
if (getSorter() != null) {
try {
Collections.sort(data, getSorter());
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
// main.system.ExceptionMaster.printStackTrace(e);
}
}
putList(listName, data, map);
}
for (String listName : specialLists) {
List<ObjType> data = getSpecialData();
if (getSorter() != null) {
Collections.sort(data, getSorter());
}
putList(listName, data, map);
}
return map;
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class Saver method getObjNodeXml.
private static String getObjNodeXml(DC_GameState state) {
StringBuilder builder = new StringBuilder(80000);
builder.append(XML_Converter.openXml(OBJ_NODE));
for (OBJ_TYPE TYPE : state.getObjMaps().keySet()) {
if (state.getObjMaps().get(TYPE).isEmpty())
continue;
builder.append(XML_Converter.openXml(TYPE.getName()));
for (Integer id : state.getObjMaps().get(TYPE).keySet()) {
Obj obj = state.getObjMaps().get(TYPE).get(id);
obj.setProperty(G_PROPS.ID, id + "");
builder.append(XML_Converter.openXmlFormatted(obj.getName()));
builder.append(XML_Converter.openXml(PROPS_NODE));
for (PROPERTY property : obj.getPropMap().keySet()) {
if (property.isDynamic() || !obj.getProperty(property).equals(obj.getType().getProperty(property))) {
// only write values that aren't at base
builder.append(XML_Formatter.getValueNode(obj, property));
}
}
builder.append(XML_Converter.closeXml(PROPS_NODE));
builder.append(XML_Converter.openXml(PARAMS_NODE));
for (PARAMETER parameter : obj.getParamMap().keySet()) {
if (parameter.isDynamic() || !obj.getParam(parameter).equals(obj.getType().getParam(parameter))) {
// only write values that aren't at base
builder.append(XML_Formatter.getValueNode(obj, parameter));
}
}
builder.append(XML_Converter.closeXml(PARAMS_NODE));
// REF !
builder.append(XML_Converter.closeXmlFormatted(obj.getName()));
}
builder.append(XML_Converter.closeXml(TYPE.getName()));
}
builder.append(XML_Converter.closeXml(OBJ_NODE));
return builder.toString();
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class StateCloner method cloneMaps.
private void cloneMaps(DC_GameState state, DC_GameState clone) {
for (OBJ_TYPE TYPE : state.getObjMaps().keySet()) {
Map<Integer, Obj> cloneMap = getObjMap();
Map<Integer, Obj> map = state.getObjMaps().get(TYPE);
if (map == null) {
continue;
}
for (Obj e : map.values()) {
Obj cloneObj = cloneObj(e);
cloneMap.put(cloneObj.getId(), cloneObj);
}
clone.getObjMaps().put(TYPE, cloneMap);
}
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class MacroManager method saveCustomTypes.
public static void saveCustomTypes() {
// saveCopyTypes();
for (OBJ_TYPE t : custom_OBJ_TYPES) {
String content = XML_Converter.openXmlFormatted(t.getName());
for (ObjType type : customTypes) {
if (type.getOBJ_TYPE_ENUM() == t) {
content += XML_Writer.getIncompleteTypeXML(type, type.getType());
}
}
content += XML_Converter.closeXmlFormatted(t.getName());
String path = getTypeDataPath();
String fileName = t.getName() + ".xml";
XML_Writer.write(content, path, fileName);
}
}
Aggregations