Package org.freerealm.map

Examples of org.freerealm.map.PathFinder


     */
    public CommandResult execute(Realm realm) {
        if (unit.getCoordinate().equals(coordinate)) {
            return new CommandResult(CommandResult.RESULT_OK, "");
        }
        PathFinder pathFinder = realm.getPathFinder();
        if (pathFinder == null) {
            return new CommandResult(CommandResult.RESULT_ERROR, "PathFinder for realm is null.");
        }
        Path path = pathFinder.findPath(unit, coordinate, true);
        if (path == null) {
            String errorMessage = "There is not any path from unit's current location to target tile\n";
            errorMessage = errorMessage + "Units location : " + unit.getCoordinate();
            errorMessage = errorMessage + " Target coordinate :" + coordinate;
            return new CommandResult(CommandResult.RESULT_ERROR, errorMessage);
View Full Code Here


     */
    public CommandResult execute(Realm realm) {
        if (unit.getCoordinate().equals(coordinate)) {
            return new CommandResult(CommandResult.RESULT_OK, "");
        }
        PathFinder pathFinder = realm.getPathFinder();
        if (pathFinder == null) {
            return new CommandResult(CommandResult.RESULT_ERROR, "PathFinder for realm is null.");
        }
        Path path = pathFinder.findPath(unit, coordinate, false);
        if (path == null) {
            String errorMessage = "There is not any path from unit's current location to target tile\n";
            errorMessage = errorMessage + "Units location : " + unit.getCoordinate();
            errorMessage = errorMessage + " Target coordinate :" + coordinate;
            return new CommandResult(CommandResult.RESULT_ERROR, errorMessage);
View Full Code Here

TOP

Related Classes of org.freerealm.map.PathFinder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.