PathfinderPlugin
A PathfinderPlugin is a piece of code that can be written to modify the behavior of the library to an extent not normally possible through regular usage of the Pathfinder API.
To load a plugin, you use Voyager.loadPlugin(PathfinderPlugin). This will load the plugin and call its onLoad(Voyager) method. You can also add plugins that load automatically every time a Voyager instance is created using Voyager.addAutoLoadPlugin(PathfinderPlugin).
This class is designed to be extended, allowing you to override its methods to inject custom logic at various points in Pathfinder's execution lifecycle.
Methods
getName()
Abstract method. Returns the name of the plugin. This can be any string you choose.
onLoad(Voyager voyager)
Called whenever the plugin is loaded by a Voyager instance.
voyager: TheVoyagerinstance that loaded this plugin.
preTick(Voyager voyager)
Called before every tick of the Voyager instance.
voyager: TheVoyagerinstance.
onTick(Voyager voyager)
Called immediately after every tick of the Voyager instance.
voyager: TheVoyagerinstance.
postTick(Voyager voyager)
Called after a tick, and after the recording and playback managers have been ticked.
voyager: TheVoyagerinstance.
preClear(Voyager voyager)
Called whenever the Voyager.clear() method is invoked, before the followers are actually cleared.
voyager: TheVoyagerinstance.
onClear(Voyager voyager)
Called whenever the Voyager.clear() method is invoked, after the followers are actually cleared.
voyager: TheVoyagerinstance.
onEnterZone(Voyager voyager, Zone zone)
Called whenever Pathfinder detects that the robot has entered a Zone.
voyager: TheVoyagerinstance.zone: TheZonethat was just entered.
onExitZone(Voyager voyager, Zone zone)
Called whenever Pathfinder detects that the robot has exited a Zone.
voyager: TheVoyagerinstance.zone: TheZonethat was just exited.
whileInsideZone(Voyager voyager, Zone zone)
Called whenever Pathfinder detects that the robot is currently inside a Zone.
voyager: TheVoyagerinstance.zone: TheZonethat Pathfinder is currently inside.
onStartFollower(Voyager voyager, Follower follower)
Called whenever Pathfinder detects that a new Follower has started execution.
voyager: TheVoyagerinstance.follower: TheFollowerthat was just started.
onFinishFollower(Voyager voyager, Follower follower)
Called whenever Pathfinder detects that a Follower has finished execution.
voyager: TheVoyagerinstance.follower: TheFollowerthat has just finished.