Search in sources :

Example 1 with DC_IdManager

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);
}
Also used : DC_IdManager(eidolons.entity.DC_IdManager) DC_GameMaster(eidolons.game.core.game.DC_GameMaster)

Example 2 with DC_IdManager

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;
}
Also used : DC_TYPE(main.content.DC_TYPE) PROPERTY(main.content.values.properties.PROPERTY) Node(org.w3c.dom.Node) Coordinates(main.game.bf.Coordinates) ArrayList(java.util.ArrayList) DC_Game(eidolons.game.core.game.DC_Game) Document(org.w3c.dom.Document) DC_Player(eidolons.game.battlecraft.logic.battle.universal.DC_Player) Ref(main.entity.Ref) DC_IdManager(eidolons.entity.DC_IdManager) ObjType(main.entity.type.ObjType) DC_WeaponObj(eidolons.entity.item.DC_WeaponObj) DC_QuickItemObj(eidolons.entity.item.DC_QuickItemObj) DC_BuffObj(eidolons.entity.obj.attach.DC_BuffObj) DC_FeatObj(eidolons.entity.obj.attach.DC_FeatObj) DC_JewelryObj(eidolons.entity.item.DC_JewelryObj) DC_SpellObj(eidolons.entity.active.DC_SpellObj) Obj(main.entity.obj.Obj) DC_ArmorObj(eidolons.entity.item.DC_ArmorObj) PARAMETER(main.content.values.parameters.PARAMETER)

Example 3 with DC_IdManager

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();
}
Also used : MapPointMaster(eidolons.libgdx.screens.map.editor.MapPointMaster) DC_IdManager(eidolons.entity.DC_IdManager) ObjType(main.entity.type.ObjType) HungerRule(eidolons.game.module.adventure.rules.HungerRule)

Example 4 with DC_IdManager

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();
    }
}
Also used : VisionMaster(eidolons.game.battlecraft.logic.battlefield.vision.VisionMaster) TestMasterContent(eidolons.system.test.TestMasterContent) DC_RequirementsManager(eidolons.system.DC_RequirementsManager) DC_IdManager(eidolons.entity.DC_IdManager) DC_EffectManager(eidolons.ability.effects.DC_EffectManager) DC_LogManager(eidolons.system.text.DC_LogManager) AnimationManager(eidolons.system.graphics.AnimationManager) DC_MathManager(eidolons.system.math.DC_MathManager) DroppedItemManager(eidolons.game.battlecraft.logic.battlefield.DroppedItemManager) DC_ConditionMaster(eidolons.system.DC_ConditionMaster) ValueHelper(main.system.entity.ValueHelper) DC_ValueManager(eidolons.content.DC_ValueManager) DC_Rules(eidolons.game.battlecraft.rules.DC_Rules)

Aggregations

DC_IdManager (eidolons.entity.DC_IdManager)4 ObjType (main.entity.type.ObjType)2 DC_EffectManager (eidolons.ability.effects.DC_EffectManager)1 DC_ValueManager (eidolons.content.DC_ValueManager)1 DC_SpellObj (eidolons.entity.active.DC_SpellObj)1 DC_ArmorObj (eidolons.entity.item.DC_ArmorObj)1 DC_JewelryObj (eidolons.entity.item.DC_JewelryObj)1 DC_QuickItemObj (eidolons.entity.item.DC_QuickItemObj)1 DC_WeaponObj (eidolons.entity.item.DC_WeaponObj)1 DC_BuffObj (eidolons.entity.obj.attach.DC_BuffObj)1 DC_FeatObj (eidolons.entity.obj.attach.DC_FeatObj)1 DC_Player (eidolons.game.battlecraft.logic.battle.universal.DC_Player)1 DroppedItemManager (eidolons.game.battlecraft.logic.battlefield.DroppedItemManager)1 VisionMaster (eidolons.game.battlecraft.logic.battlefield.vision.VisionMaster)1 DC_Rules (eidolons.game.battlecraft.rules.DC_Rules)1 DC_Game (eidolons.game.core.game.DC_Game)1 DC_GameMaster (eidolons.game.core.game.DC_GameMaster)1 HungerRule (eidolons.game.module.adventure.rules.HungerRule)1 MapPointMaster (eidolons.libgdx.screens.map.editor.MapPointMaster)1 DC_ConditionMaster (eidolons.system.DC_ConditionMaster)1