use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class MacroTimeMaster method processMapObjects.
private void processMapObjects() {
Coordinates c = MacroGame.getGame().getPlayerParty().getCoordinates();
for (Place place : MacroGame.getGame().getState().getPlaces()) {
MAP_OBJ_INFO_LEVEL infoLevel = MAP_OBJ_INFO_LEVEL.UNKNOWN;
if (place.getCoordinates().dst(c) < 500) {
infoLevel = MAP_OBJ_INFO_LEVEL.KNOWN;
place.setDetected(true);
}
place.setInfoLevel(infoLevel);
}
// for (MacroParty party : MacroGame.getGame().getState().getParties()) {
// if (party.getCurrentDestination() == null)
// continue;
// TravelManager.travel(delta);
// TravelMaster.travel(party, delta);
// }
}
use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class WorldGenerator method createPlace.
private static Place createPlace(MacroRef ref, String s) {
s = formatPointVarString(s);
String typeName = VariableManager.removeVarPart(s);
ObjType t = DataManager.getType(typeName, MACRO_OBJ_TYPES.PLACE);
if (t == null) {
return null;
}
Place place = new Place(game, t, ref);
if (VariableManager.getVarPart(s).contains("-")) {
Coordinates c = new Coordinates(true, VariableManager.getVarPart(s));
place.setCoordinates(c);
} else {
place.resetCoordinates();
}
// DungeonMaster.generateDungeonsForPlace(place);
return place;
}
use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class WorldGenerator method createRegion.
public static Region createRegion(ObjType type, MacroRef ref) {
// template
// add places, towns and routes
region = new Region(game, type, ref);
// init default towns/places ; then add randomized
for (String s : StringMaster.open(region.getProperty(MACRO_PROPS.AREAS))) {
type = DataManager.getType(s, MACRO_OBJ_TYPES.AREA);
Area area = new Area(ref.getGame(), type, ref);
region.getAreas().add(area);
}
for (String s : StringMaster.open(region.getProperty(MACRO_PROPS.PARTIES))) {
try {
MacroParty party = createParty(ref, s);
region.addParty(party);
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
}
}
for (String s : StringMaster.open(region.getProperty(MACRO_PROPS.PLACES))) {
Place place = createPlace(ref, s);
if (place != null)
region.addPlace(place);
}
for (String s : StringMaster.open(region.getProperty(MACRO_PROPS.TOWNS))) {
Town town = createTown(ref, s);
region.addTown(town);
}
generateRoutes();
return region;
/*
* r.getProperty(MACRO_PROPS.PLACES) Places - Power level ++ will be
* appearing as the game progresses
*
* Routes - there should be at least 1 between each 2 places as
* "default" (preset) and then we can generate additional randomized
* routes For non-preset Places, we can use some metrics...
*/
}
use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class MapObjStage method bindEvents.
protected void bindEvents() {
GuiEventManager.bind(CREATE_PARTY, param -> {
MacroParty party = (MacroParty) param.get();
if (party == null) {
return;
}
PartyActor partyActor = PartyActorFactory.getParty(party);
addActor(partyActor);
if (party.isMine()) {
setMainParty(party);
setMainPartyActor(partyActor);
MapScreen.getInstance().getGuiStage().setMainPartyMarker(PartyActorFactory.getParty(party));
}
parties.add(partyActor);
wanderAi.update();
});
GuiEventManager.bind(CREATE_PLACE, param -> {
Place place = (Place) param.get();
PlaceActor placeActor = PlaceActorFactory.getPlace(place);
addActor(placeActor);
places.add(placeActor);
});
GuiEventManager.bind(REMOVE_MAP_OBJ, param -> {
MapActor actor = (MapActor) param.get();
actor.remove();
wanderAi.update();
});
}
use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class TravelMasterOld method getAvailablePlaces.
public static Set<Place> getAvailablePlaces(MacroParty party) {
Set<Place> list = new HashSet<>();
// via available routes! across Areas...
Set<Route> routes = getAvailableRoutes(party);
for (Route r : routes) {
// if (r.getDestination())
list.add(r.getDestination());
list.add(r.getOrigin());
}
return list;
}
Aggregations