use of eidolons.entity.DC_IdManager in project Eidolons by IDemiurge.
the class AT_Simulation method init.
@Override
public void init() {
game = this;
idManager = new DC_IdManager();
state = new AT_State(this);
master = new DC_GameMaster(null);
}
use of eidolons.entity.DC_IdManager in project Eidolons by IDemiurge.
the class Loader method createObjects.
private static List<Obj> createObjects(List<String> objectNodes) {
DC_Game game = DC_Game.game;
List<Obj> objects = new ArrayList<>();
// TODO ID ORDER MUST BE PRESERVED! put in parameter?
for (String typesNode : objectNodes) {
Document node = XML_Converter.getDoc(typesNode);
DC_TYPE TYPE = DC_TYPE.getType(node.getNodeName());
for (Node subNode : XML_Converter.getNodeList(node)) {
String sub = XML_Converter.getStringFromXML(subNode);
game.setIdManager(new DC_IdManager(game));
Map<PROPERTY, String> props = getPropsFromNode(sub);
Map<PARAMETER, String> params = getParamsFromNode(sub);
ObjType type = DataManager.getType(subNode.getNodeName(), TYPE);
// preset ID?! init containers by id... including buffs; but first create them
Ref ref = new Ref(game);
Node refNode = XML_Converter.findNode(sub, Saver.OBJ_NODE);
if (refNode != null)
for (String substring : StringMaster.open(refNode.getTextContent())) {
ref.setValue(KEYS.valueOf(substring.split("=")[0].toUpperCase()), substring.split("=")[1]);
}
String ownerName = null;
DC_Player owner = game.getBattleMaster().getPlayerManager().getPlayer(// property?
ownerName);
if (owner == null) {
owner = DC_Player.NEUTRAL;
}
Coordinates c = new Coordinates(params.get(G_PARAMS.POS_X) + "-" + params.get(G_PARAMS.POS_Y));
Obj object = createObj(type, c.x, c.y, owner, game, ref);
object.getPropMap().putAll(props);
object.getParamMap().putAll(params);
object.setId(StringMaster.getInteger(props.get(G_PROPS.ID)));
objects.add(object);
init(object);
}
}
return objects;
}
use of eidolons.entity.DC_IdManager in project Eidolons by IDemiurge.
the class MacroGame method init.
@Override
public void init() {
loop = new MacroGameLoop(this);
ref = new MacroRef(this);
state = new MacroGameState(this);
manager = new MacroGameManager(this);
master = new MacroGameMaster(this);
logManager = new Journal(this);
idManager = new DC_IdManager();
turnRules = new DequeImpl<>();
turnRules.add(new HungerRule());
initObjTypes();
ObjType cType = DataManager.getType(MacroManager.getCampaignName(), MACRO_OBJ_TYPES.CAMPAIGN);
campaign = new Campaign(this, cType, ref);
TimeMaster.setCampaign(campaign);
world = WorldGenerator.generateWorld(ref);
MacroManager.setWorldName(world.getName());
// Region region;
// region = world.getRegion(campaign.getProperty(MACRO_PROPS.REGION));
// ref.setID(MACRO_KEYS.REGION.toString(), region.getId());
// ref.setRegion(region);
pointMaster = new MapPointMaster();
routeMaster = new RouteMaster();
}
use of eidolons.entity.DC_IdManager in project Eidolons by IDemiurge.
the class DC_Game method initMasters.
private void initMasters() {
master = new DC_GameMaster(this);
// if (!CoreEngine.isArcaneVault()) {
manager = new DC_GameManager(getState(), this);
manager.init();
// } //TODO FIX classdefnotfound!
this.setIdManager(new DC_IdManager(this));
combatMaster = createCombatMaster();
requirementsManager = new DC_RequirementsManager(this);
valueManager = new DC_ValueManager(this);
visionMaster = new VisionMaster(this);
mathManager = new DC_MathManager(this);
effectManager = new DC_EffectManager(this);
animationManager = new AnimationManager(this);
droppedItemManager = new DroppedItemManager(this);
valueHelper = new ValueHelper(this);
setTestMaster(new TestMasterContent(this));
conditionMaster = new DC_ConditionMaster();
logManager = new DC_LogManager(this);
rules = new DC_Rules(this);
dungeonMaster = createDungeonMaster();
battleMaster = createBattleMaster();
if (!CoreEngine.isCombatGame())
return;
musicMaster = MusicMaster.getInstance();
if (musicMaster.isRunning()) {
musicMaster.resume();
} else {
musicMaster.startLoop();
}
}
Aggregations