Search in sources :

Example 1 with MAP_ZONES

use of eidolons.game.battlecraft.logic.dungeon.universal.DungeonMapGenerator.MAP_ZONES in project Eidolons by IDemiurge.

the class FacingAdjuster method getPartyMemberFacing.

public FACING_DIRECTION getPartyMemberFacing(Unit unit) {
    if (getGame().getGameMode() == GAME_MODES.DUNGEON_CRAWL) {
        return FacingMaster.getOptimalFacingTowardsEmptySpaces(unit);
    }
    Coordinates c = unit.getCoordinates();
    if (isAutoOptimalFacing())
        return getFacingOptimal(c, true);
    if (facingMap.containsKey(c)) {
        return facingMap.get(c);
    }
    MAP_ZONES zone = null;
    for (MAP_ZONES z : MAP_ZONES.values()) {
        for (String s : StringMaster.open(z.getCoordinates(), ",")) {
            if (c.toString().equals(s)) {
                zone = z;
                break;
            }
        }
    }
    if (zone != null) {
        switch(zone) {
            case SIDE_EAST:
                return FACING_DIRECTION.WEST;
            case SIDE_NORTH:
                return FACING_DIRECTION.SOUTH;
            case SIDE_SOUTH:
                return FACING_DIRECTION.NORTH;
            case SIDE_WEST:
                return FACING_DIRECTION.EAST;
        }
    }
    return FACING_DIRECTION.NORTH;
}
Also used : Coordinates(main.game.bf.Coordinates) MAP_ZONES(eidolons.game.battlecraft.logic.dungeon.universal.DungeonMapGenerator.MAP_ZONES)

Aggregations

MAP_ZONES (eidolons.game.battlecraft.logic.dungeon.universal.DungeonMapGenerator.MAP_ZONES)1 Coordinates (main.game.bf.Coordinates)1