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)
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.
If possible, make it backwards compatible.