use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class MacroGameLoop method act.
@Override
public void act(float delta) {
if (isPaused())
return;
Place entered = checkBattleStarts();
if (isAutoEnterCombat())
if (entered != null) {
combatStarts(entered);
return;
}
timeMaster.act(delta);
}
use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class MacroGameManager method getPlaceForPoint.
public Place getPlaceForPoint(String point) {
// Map<String, Place> map = new HashMap<>();
// get closest?
float minDistance = Float.MAX_VALUE;
Coordinates c = getGame().getPointMaster().getCoordinates(point);
Place place = null;
for (Place sub : getGame().getPlaces()) {
float distance = new Vector2(c.x, c.y).dst(new Vector2(sub.getX(), sub.getY()));
if (distance < minDistance) {
minDistance = distance;
place = sub;
}
// can we not attach click listeners to emtiterActors?!
}
return place;
}
use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class MacroManager method saveTheWorld.
public static void saveTheWorld() {
// all locations to regions, etc
for (Region region : getGame().getState().getRegions()) {
String places = "";
for (Place sub : getGame().getPlaces()) {
if (sub.getRegion() != region)
continue;
places += sub.getNameAndCoordinate() + ";";
}
region.setProperty(MACRO_PROPS.PLACES, places, true);
String parties = "";
for (MacroParty sub : getGame().getParties()) {
if (sub.getRegion() != region)
continue;
parties += sub.getNameAndCoordinate() + ";";
}
region.setProperty(MACRO_PROPS.PARTIES, parties, true);
}
XML_Writer.writeXML_ForTypeGroup(MACRO_OBJ_TYPES.REGION);
}
use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class WorldGenerator method createRoute.
private static Route createRoute(ObjType t) {
Route r = new Route(game, t, region.getRef());
Place orig = region.getPlace(r.getProperty(MACRO_PROPS.ORIGIN));
orig.addRoute(r);
Place dest = region.getPlace(r.getProperty(MACRO_PROPS.DESTINATION));
dest.addRoute(r);
r.setOrigin(orig);
r.setDestination(dest);
r.setParam(MACRO_PARAMS.ROUTE_LENGTH, TravelMasterOld.calculateRouteLength(r), true);
return r;
}
use of eidolons.game.module.adventure.map.Place in project Eidolons by IDemiurge.
the class MapActionHandler method partyAction.
public static void partyAction(MACRO_PARTY_ACTIONS action, MacroParty party) {
Set<Place> set;
Route route;
Place place;
switch(action) {
case AMBUSH:
party.setStatus(MACRO_STATUS.IN_AMBUSH);
// for 'encounters' to happen more likely...
break;
case CAMP:
RestMaster.startCamping(party);
break;
case EXPLORE:
// choose route? or choose current location to explore around...
party.setStatus(MACRO_STATUS.EXPLORING);
set = TravelMasterOld.getAvailableRoutesAsPlaces(party, null);
if (party.getCurrentLocation() != null) {
// else?
set.add(party.getCurrentLocation());
}
place = selectMapObj(set);
if (place == null) {
return;
}
party.setCurrentExploration(place);
break;
case TRAVEL:
// extract into effect???
party.setStatus(MACRO_STATUS.TRAVELING);
set = TravelMasterOld.getAvailablePlaces(party);
// set.addAll(TravelMaster.getAvailableRoutes(party));
place = selectMapObj(set);
if (place == null) {
return;
}
set = TravelMasterOld.getAvailableRoutesAsPlaces(party, place);
// MacroManager.getMapView().getMapComp().displayRoutes(set);
route = (Route) selectMapObj(set);
if (route == null) {
return;
}
party.setCurrentDestination(place);
if (route.getOrigin() == place) {
party.addProperty(G_PROPS.DYNAMIC_BOOLS, DYNAMIC_BOOLS.BACKWARDS_ROUTE_TRAVEL.toString());
} else {
party.removeProperty(G_PROPS.DYNAMIC_BOOLS, DYNAMIC_BOOLS.BACKWARDS_ROUTE_TRAVEL.toString());
}
party.setCurrentRoute(route);
break;
default:
break;
}
MacroManager.refreshGui();
}
Aggregations