Yonaba / Jumper

Fast, lightweight and easy-to-use pathfinding library for grid-based games
http://yonaba.github.io/Jumper
MIT License
614 stars 124 forks source link

Separated pathfinding interfaces for each search algorithm #7

Open Yonaba opened 11 years ago

Yonaba commented 11 years ago

As the extra features is about to grow, and cannot be applied straight to all search algorithms, it might be interesting to separate pathfinders.

Basically, there can be a top level pathfinder class, from which the user cannot instantiate. This super class will implement the common features shared accross all finders.

And ideally, from this class we will have methods to derive all specialized finders, with their specific methods.

local Pathfinder = require '.?/pathfinder.lua'
local astarFinder = Pathfinder.newAstarFinder(grid, walkable)

If possible, make it backwards compatible.