Package transientlibs.maps.utils.pathfinding

Examples of transientlibs.maps.utils.pathfinding.PathFinder


        HP.setup(creatures.maxHP, creatures.maxHP);
        HP.min = -10000;

        Log.info("now hp: " + HP.now.value);

        pathfinder = new PathFinder(mapCoords, setMap);

        maxActionPoints.value = creatures.movementSpeed;
        actionPoints.value = maxActionPoints.value;

        pathfinder.currentMovementReach = actionPoints;
View Full Code Here


    if (progressPoints.value >= progressPointsNeeded.value) {finishTask();}
}

public void calculateMovementCoords (Coords fromCoords, TilelessMap fromMap) {

        PathFinder pathfinder = new PathFinder(fromCoords, fromMap);

        Coords adjustedCoords;

        int counter;
        int setX;
        int setY;
        int bestResult = 999999999;
        int bestDirection = -1;

        BasicMap onMap = Maps.currentMap;

        for (counter = 1; counter < 10; counter++) {

        adjustedCoords = targetCoords.returnAdjustedCoords(counter);
        setX = adjustedCoords.getIntX();
        setY = adjustedCoords.getIntY();

        onMap.pathfindingGoalX = setX;
        onMap.pathfindingGoalY = setY;

        pathfinder.goalX = setX;
        pathfinder.goalY = setY;

        pathfinder.updatePath();

        if (pathfinder.path != null) {
            if (pathfinder.path.getLength() < bestResult) {
                bestResult = pathfinder.path.getLength();
                bestDirection = counter;
View Full Code Here

        HP.setup(creature.maxHP, creature.maxHP);
        HP.min = -10000;

        Log.info("now hp: " + HP.now.value);

        pathfinder = new PathFinder(mapCoords, setMap);

        maxActionPoints.value = creature.movementSpeed;
        actionPoints.value = maxActionPoints.value;

        pathfinder.currentMovementReach = actionPoints;
View Full Code Here

    public Landmark returnClosestLandmark(Coords fromCoords, int landmarkType, Landmark fromLandmark) {

        boolean skipFlag = false;

        PathFinder pathfinder = new PathFinder(fromCoords, this);

        Landmark bestLandmark = null;

        int bestResult = 999999999;


        if (fromLandmark != null) {
            skipFlag = true;
        }

        for (Landmark l : landmarks) {

            Log.info("Found: " + l.ofType + "; Looking for: " + landmarkType);

            if ((skipFlag == false) && (l.ofType == landmarkType)) {


                pathfindingGoalX = l.mapCoords.getIntX();
                pathfindingGoalY = l.mapCoords.getIntY();

                pathfinder.goalX = l.mapCoords.getIntX();
                pathfinder.goalY = l.mapCoords.getIntY();

                pathfinder.updatePath();

                if (pathfinder.path != null) {
                    //Log.info("Path exists");
                    if (pathfinder.path.getLength() < bestResult) {
                        //Log.info("Path is optimal");
View Full Code Here

TOP

Related Classes of transientlibs.maps.utils.pathfinding.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.