use of main.entity.type.ObjAtCoordinate in project Eidolons by IDemiurge.
the class WaveAssembler method applyLevel.
public void applyLevel() {
// TODO foreach unit add level and break if exceeding power
unitLevel++;
wave.setUnitLevel(unitLevel);
for (ObjAtCoordinate type : typeMap) {
ObjType newType = new UnitLevelManager().getLeveledType(type.getType(), 1, true);
type.setType(newType);
if (!checkPowerAdjustmentNeeded()) {
return;
}
}
}
use of main.entity.type.ObjAtCoordinate in project Eidolons by IDemiurge.
the class LE_PlanPanel method newGroup.
private void newGroup() {
Coordinates coordinate = LE_MapMaster.pickCoordinate();
if (coordinate == null) {
return;
}
Coordinates coordinate2 = LE_MapMaster.pickCoordinate();
if (coordinate2 == null) {
return;
}
List<ObjAtCoordinate> group = LE_ObjMaster.newUnitGroup(coordinate, Math.abs(coordinate.x - coordinate2.x), Math.abs(coordinate.y - coordinate2.y), false);
String name = DialogMaster.inputText("group's name?", lastUnitGroupName + " " + n);
if (name == null) {
return;
}
// TODO next file version?
if (!StringMaster.contains(name, lastUnitGroupName)) {
n = 0;
}
// n will be +1
lastUnitGroupName = name.replace(" " + n, "");
if (name.contains(lastUnitGroupName + " " + (n))) {
n++;
}
LE_DataMaster.saveUnitGroup(name, group, "");
}
use of main.entity.type.ObjAtCoordinate in project Eidolons by IDemiurge.
the class LE_AiMaster method newGroup.
private static void newGroup(Obj obj) {
AiGroupData aiGroup = new AiGroupData(obj);
while (true) {
Coordinates c = LevelEditor.getMouseMaster().pickCoordinate();
if (c == null) {
break;
}
// per level!
for (Obj u : LevelEditor.getSimulation().getUnitsForCoordinates(c)) {
ObjAtCoordinate objAtCoordinate = new ObjAtCoordinate(u.getType(), c);
aiGroup.add(objAtCoordinate);
}
}
LevelEditor.getCurrentLevel().getAiGroups().add(aiGroup);
}
use of main.entity.type.ObjAtCoordinate in project Eidolons by IDemiurge.
the class LE_DataMaster method saveUnitGroup.
public static void saveUnitGroup(String name, List<ObjAtCoordinate> units, String pathPrefix) {
String content = "";
for (ObjAtCoordinate obj : units) {
content += DC_ObjInitializer.getObjString(obj) + DC_ObjInitializer.OBJ_SEPARATOR;
}
XML_Writer.write(content, PathFinder.getUnitGroupPath() + pathPrefix, name + ".xml");
}
Aggregations