ScummVM API documentation
Tetraedge::micropather::Graph Class Referenceabstract

#include <micropather.h>

Public Member Functions

virtual float LeastCostEstimate (void *stateStart, void *stateEnd)=0
 
virtual void AdjacentCost (void *state, Common::Array< micropather::StateCost > *adjacent)=0
 
virtual void PrintStateInfo (void *state)=0
 

Detailed Description

A pure abstract class used to define a set of callbacks. The client application inherits from this class, and the methods will be called when MicroPather::Solve() is invoked.

The notion of a "state" is very important. It must have the following properties:

If the client application represents states as objects, then the state is usually just the object cast to a void*. If the client application sees states as numerical values, (x,y) for example, then state is an encoding of these values. MicroPather never interprets or modifies the value of state.

Member Function Documentation

◆ LeastCostEstimate()

virtual float Tetraedge::micropather::Graph::LeastCostEstimate ( void *  stateStart,
void *  stateEnd 
)
pure virtual

Return the least possible cost between 2 states. For example, if your pathfinding is based on distance, this is simply the straight distance between 2 points on the map. If you pathfinding is based on minimum time, it is the minimal travel time between 2 points given the best possible terrain.

◆ AdjacentCost()

virtual void Tetraedge::micropather::Graph::AdjacentCost ( void *  state,
Common::Array< micropather::StateCost > *  adjacent 
)
pure virtual

Return the exact cost from the given state to all its neighboring states. This may be called multiple times, or cached by the solver. It must return the same exact values for every call to MicroPather::Solve(). It should generally be a simple, fast function with no callbacks into the pather.

◆ PrintStateInfo()

virtual void Tetraedge::micropather::Graph::PrintStateInfo ( void *  state)
pure virtual

This function is only used in DEBUG mode - it dumps output to stdout. Since void* aren't really human readable, normally you print out some concise info (like "(1,2)") without an ending newline.


The documentation for this class was generated from the following file: