use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class XML_Writer method saveAll.
public static void saveAll() {
for (String typeName : XML_Reader.getTypeMaps().keySet()) {
OBJ_TYPE type = ContentManager.getOBJ_TYPE(typeName);
if (isWritingBlocked(type)) {
continue;
}
writeXML_ForTypeGroup(type);
}
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class ListSizeCondition method check.
@Override
public boolean check(Ref ref) {
OBJ_TYPE TYPE = C_OBJ_TYPE.BF;
if (bfObj) {
TYPE = C_OBJ_TYPE.BF_OBJ;
}
if (filter == null) {
filter = new Filter<>(ref, c, TYPE);
} else {
filter.setRef(ref);
}
int size = new Formula(sizeFormula).getInt(ref);
return filter.getObjects().size() >= size;
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class DC_RequirementsManager method getRequirements.
@Override
public Requirements getRequirements(Entity type, int mode) {
Map<Entity, Requirements> map = getReqMap(mode);
if (map != null) {
if (// TODO
map.get(type) != null) {
return map.get(type);
}
}
Requirements req = null;
OBJ_TYPE TYPE = type.getOBJ_TYPE_ENUM();
if (TYPE instanceof DC_TYPE) {
switch((DC_TYPE) TYPE) {
case ARMOR:
req = generateItemRequirements(type, mode);
break;
case ITEMS:
req = generateItemRequirements(type, mode);
break;
case CLASSES:
req = generateClassRequirements(type, mode);
break;
case SKILLS:
req = generateSkillRequirements(type, mode);
break;
case SPELLS:
req = generateSpellRequirements(type, mode);
break;
case WEAPONS:
req = generateItemRequirements(type, mode);
break;
case UNITS:
break;
case ACTIONS:
break;
default:
break;
}
}
if (req == null) {
return null;
}
String additionalRequirements = type.getProperty(PROPS.REQUIREMENTS);
if (!StringMaster.isEmpty(additionalRequirements)) {
try {
req.addAll(toRequirements(additionalRequirements));
} catch (Exception e) {
LogMaster.log(1, type + "'s req failed! - " + additionalRequirements);
// main.system.ExceptionMaster.printStackTrace(e);
}
}
if (type.isUpgrade() && TYPE != null) {
Requirement baseTypeRequirement = getBaseTypeRequirement(type, TYPE);
if (baseTypeRequirement != null) {
req.add(baseTypeRequirement);
}
}
if (map != null) {
map.put(type, req);
}
return req;
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class StateManager method addObject.
public void addObject(Obj obj) {
state.objMap.put(obj.getId(), obj);
OBJ_TYPE TYPE = obj.getOBJ_TYPE_ENUM();
if (TYPE == null) {
LogMaster.log(1, obj.toString() + " has no TYPE!");
return;
}
Map<Integer, Obj> map = state.getObjMaps().get(TYPE);
if (map == null) {
return;
}
// if (!map.containsValue(obj))
map.put(obj.getId(), obj);
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class LE_Palette method newPalette.
public void newPalette() {
int optionChoice = DialogMaster.optionChoice("Choose object TYPE...", default_palette);
OBJ_TYPE TYPE;
List<ObjType> typeList;
if (optionChoice == -1) {
if (DialogMaster.confirm("Multi-type Palette?")) {
optionChoice = DialogMaster.optionChoice("Choose object multi TYPE...", multi_types);
if (optionChoice == -1) {
return;
}
TYPE = multi_types[optionChoice];
typeList = DataManager.getTypes(TYPE);
} else {
return;
}
} else {
TYPE = default_palette[optionChoice];
typeList = DataManager.getTypes(TYPE);
}
// int index = DialogMaster.optionChoice("Choose object TYPE...",
// palettes.toArray());
// PaletteWorkspace ws = palettes.getOrCreate(index);
List<String> listData = DataManager.toStringList(typeList);
List<String> secondListData = (TYPE instanceof C_OBJ_TYPE) ? new ArrayList<>() : DataManager.toStringList(typeList);
// if (ws != null) {
// secondListData = DataManager.convertToStringList(ws.getTypeList());
// }
String data = new ListChooser(listData, secondListData, false, TYPE).choose();
if (data == null) {
return;
}
List<ObjType> list = DataManager.toTypeList(data, TYPE);
String name = DialogMaster.inputText();
imagePath = new ImageChooser().launch(imagePath, "");
PaletteWorkspace ws = new PaletteWorkspace(name, list, imagePath);
addWorkspaceTab(ws);
saveWorkspace(ws);
}
Aggregations