use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class LE_ObjMaster method replace.
public static void replace() {
ObjType type = ArcaneVault.getSelectedType();
List<Coordinates> coordinates = LE_MapMaster.pickCoordinates();
if (!ListMaster.isNotEmpty(coordinates)) {
return;
}
ObjType type2 = ArcaneVault.getSelectedType();
if (type2 == type) {
type2 = DataManager.getType(ListChooser.chooseType(type.getOBJ_TYPE_ENUM()), type.getOBJ_TYPE_ENUM());
}
replace(type, type2, coordinates);
}
use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class LE_ObjMaster method moveObjects.
private static boolean moveObjects(boolean copy, List<Coordinates> coordinates, boolean mirror) {
Coordinates destination = LevelEditor.getMouseMaster().pickCoordinate();
if (destination == null) {
return false;
}
int offsetY = destination.y - CoordinatesMaster.getMinY(coordinates);
int offsetX = destination.x - CoordinatesMaster.getMinX(coordinates);
moveObjects(destination, coordinates, offsetX, offsetY, copy, mirror);
return true;
}
use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class LE_ObjMaster method moveSelectedObj.
public static void moveSelectedObj() {
Coordinates c = LE_MapMaster.pickCoordinate();
Obj selectedObj = LevelEditor.getMouseMaster().getSelectedObj();
int offsetX = c.x - selectedObj.getX();
int offsetY = c.y - selectedObj.getY();
moveObj(selectedObj.getCoordinates(), offsetX, offsetY);
}
use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class LE_ObjMaster method addObj.
public Unit addObj(ObjType type, boolean stack, Coordinates... coordinates) {
Unit obj = null;
for (Coordinates c : coordinates) {
List<Unit> list = LevelEditor.getSimulation().getObjectsOnCoordinate(c);
if (!StackingRule.checkCanPlace(c, type, list)) {
// replace cases? if 1 coordinate, prompt...
if (LevelEditor.getCurrentLevel().isInitialized()) {
SoundMaster.playStandardSound(STD_SOUNDS.DIS__BLOCKED);
// DialogMaster.inform(type +
// " cannot be placed onto wall - " + c);
}
continue;
}
obj = getObject(type, c);
List<Unit> objects = LevelEditor.getSimulation().getUnitMap().get(c);
if (objects == null) {
objects = new ArrayList<>();
LevelEditor.getSimulation().getUnitMap().put(c, objects);
}
objects.add(obj);
LevelEditor.getCurrentLevel().addObj(obj, c, stack);
if (obj.isOverlaying()) {
LE_ObjMaster.setDirection(obj, c);
}
try {
if (LE_MapViewComp.isMinimapMode()) {
LevelEditor.getMainPanel().getMiniGrid().refreshComp(null, c);
} else {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
LevelEditor.getGrid().refresh();
}
});
}
// LevelEditor.getGrid().repaintComp(c);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
}
// preCheck wall ?
return obj;
}
use of main.game.bf.Coordinates in project Eidolons by IDemiurge.
the class LE_ObjMaster method replace.
public static void replace(ObjType type, ObjType type2, List<Coordinates> coordinates) {
cache();
for (Coordinates coordinate : coordinates) {
List<Unit> objects = LevelEditor.getSimulation().getUnitMap().get(coordinate);
// .getObjects();
if (objects != null) {
for (Unit obj : new ArrayList<>(objects)) {
if (obj.getType().equals(type)) {
objects.remove(obj);
objects.add(getObject(type2, coordinate));
}
}
}
}
LevelEditor.getMainPanel().getMapViewComp().getGrid().refresh();
}
Aggregations