Class LightningFinder

java.lang.Object
me.wobblyyyy.pathfinder.finders.LightningFinder
All Implemented Interfaces:
Generator

public class LightningFinder
extends java.lang.Object
implements Generator
The fastest pathfinder available. Or something like that.

This generator works by checking to see if the area in question of the field is empty or not. If the area is empty, this returns the start and the end points in an array. If the area is not empty, this returns an empty array, signifying that the next path generator in the queue should try to find a path instead.

When looking at performance analysis, we can see that the average execution time for the calculation of a given path is reduced dramatically when using this type of finder over another type, such as the Speed or the Xygum finder.

  • Average Lightning: 5ms
  • Average Speed: 7ms
  • Average Xygum: 20-133ms (depends on size)

Since:
0.1.0
Author:
Colin Robertson
  • Field Summary

    Fields
    Modifier and Type Field Description
    private PathfinderConfig config  
  • Constructor Summary

    Constructors
    Constructor Description
    LightningFinder​(PathfinderConfig config)
    Create a new lightning finder.
  • Method Summary

    Modifier and Type Method Description
    me.wobblyyyy.edt.DynamicArray<Point> getCoordinatePath​(Point start, Point end)
    Get a "path" from point A to B.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • LightningFinder

      public LightningFinder​(PathfinderConfig config)
      Create a new lightning finder.
      Parameters:
      config - the Pathfinder library's configuration.
  • Method Details

    • getCoordinatePath

      public me.wobblyyyy.edt.DynamicArray<Point> getCoordinatePath​(Point start, Point end)
      Get a "path" from point A to B.

      This generator works by checking to see if the area in question of the field is empty or not. If the area is empty, this returns the start and the end points in an array. If the area is not empty, this returns an empty array, signifying that the next path generator in the queue should try to find a path instead.

      Specified by:
      getCoordinatePath in interface Generator
      Parameters:
      start - the start coordinate.
      end - the end coordinate.
      Returns:
      a path (or not) from A to B.