use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class SessionMaster method generateSessionTypes.
public static void generateSessionTypes() {
for (ObjType type : DataManager.getTypes(AT_OBJ_TYPE.DIRECTION)) {
String name = type.getName() + " Session";
ObjType e = DataManager.getType(name, AT_OBJ_TYPE.DIRECTION);
if (e != null) {
continue;
}
e = new ObjType(name, AT_OBJ_TYPE.SESSION);
e.setProperty(AT_PROPS.SESSION_TYPE, TEMPLATE);
DataManager.addType(e);
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class SessionMaster method newSession.
private static Session newSession(int option) {
ObjType type;
switch(option) {
case 0:
return createSessionFromText();
case 1:
ObjType directionType = ListChooser.chooseType_(AT_OBJ_TYPE.DIRECTION);
type = new ObjType(directionType.getName() + " Session", AT_OBJ_TYPE.SESSION);
type.setGame(ArcaneTower.getSimulation());
type.setProperty(AT_PROPS.DIRECTION, directionType.getName());
return newSession(type, true);
case 2:
return continueSession(false);
case 3:
return continueSession(true);
}
return null;
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class ZeitMaster method checkCreateTimeTypes.
public static void checkCreateTimeTypes() {
// getOrCreate last day, week, month...
Entity era = getLatest(DataManager.getTypes(AT_OBJ_TYPE.ERA));
boolean create = era == null;
if (!create) {
create = era.checkProperty(AT_PROPS.ERA_STATUS, "Concluded");
}
if (create) {
int n = DataManager.getTypes(AT_OBJ_TYPE.ERA).size() + 1;
String name = DialogMaster.inputText("New Era's Name?", "The " + n + StringMaster.getOrdinalEnding(n) + " Era");
era = new ObjType(name, AT_OBJ_TYPE.ERA);
DataManager.addType((ObjType) era);
}
createPeriod(era, AT_OBJ_TYPE.DAY);
createPeriod(era, AT_OBJ_TYPE.WEEK);
createPeriod(era, AT_OBJ_TYPE.MONTH);
ArcaneTower.saveAll();
// for (t t : DataManager.getTypes(AT_OBJ_TYPE.DAY)){
// }
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class ZeitMaster method createPeriod.
/*
* markTime()
* paused()
* getTotalTime()
*/
private static void createPeriod(Entity era, AT_OBJ_TYPE T) {
boolean create;
List<? extends Entity> list = DataManager.getTypes(T);
Entity last = getLatest(list);
create = last == null;
if (!create) {
create = checkCreateNeeded(last, T);
}
if (create) {
ObjType type = new ObjType(getNameForPeriod(era, T), T);
initTimeOfCreation(type);
DataManager.addType(type);
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class AV_DataManager method back.
public void back(ObjType type) {
Stack<ObjType> stack = stackMap.get(type);
if (stack != null) {
if (stack.isEmpty()) {
return;
}
ObjType prev = stack.pop();
type.getGame().initType(prev);
type.cloneMaps(prev);
}
}
Aggregations