use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class DC_StateManager method removeObject.
public void removeObject(Integer id) {
Obj obj = game.getObjectById(id);
if (obj == null) {
return;
}
if (obj instanceof BattleFieldObject) {
if (obj instanceof Structure) {
getGame().getStructures().remove(obj);
}
if (obj instanceof Unit) {
getGame().getUnits().remove(obj);
}
removeAttachedObjects((Unit) obj);
}
Map<Integer, Obj> map = state.getObjMaps().get(obj.getOBJ_TYPE_ENUM());
if (map != null) {
map.remove(id);
}
// super.removeObject(id);
}
use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class DC_StateManager method checkCellBuffs.
private void checkCellBuffs() {
for (BattleFieldObject unit : getGame().getBfObjects()) {
if (unit.isDead()) {
continue;
}
Obj cell = game.getCellByCoordinate(unit.getCoordinates());
if (cell == null) {
continue;
}
if (cell.getBuffs() == null) {
continue;
}
for (BuffObj buff : game.getCellByCoordinate(unit.getCoordinates()).getBuffs()) {
if (unit.hasBuff(buff.getName())) {
continue;
}
if (buff.isAppliedThrough()) {
Condition retainCondition = new PositionCondition(KEYS.SOURCE.toString(), cell);
getGame().getManager().copyBuff(buff, unit, retainCondition);
}
}
}
}
use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class Loader method initializeObjects.
private static void initializeObjects(List<Obj> objects) {
DC_Game game = DC_Game.game;
DC_GameState state = game.getState();
for (Obj obj : objects) {
state.addObject(obj);
}
}
use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class MapComp method highlight.
public void highlight(Collection<Obj> targets) {
for (Obj o : targets) {
MapObjComp component = getComponent(o);
component.setHighlighted(true);
component.refresh();
}
}
use of main.entity.obj.Obj in project Eidolons by IDemiurge.
the class MapComp method highlightsOff.
public void highlightsOff() {
for (Obj o : placeComps.keySet()) {
MapObjComp component = placeComps.get(o);
component.setHighlighted(false);
}
for (Obj o : routeComps.keySet()) {
MapObjComp component = routeComps.get(o);
component.setHighlighted(false);
}
}
Aggregations