summaryrefslogtreecommitdiffhomepage
path: root/digital
diff options
context:
space:
mode:
authorNicolas Schodet2013-04-05 01:48:51 +0200
committerNicolas Schodet2013-04-05 01:48:51 +0200
commite12d94361fa1e9cef8ef5dfdde492b747d79b74e (patch)
tree913a1cc22c1dcec1ef11b209153e0619c4fca3f2 /digital
parentcbdc34779606a227ab049d311e8b183e56128d72 (diff)
digital/io-hub/src/apbirthday: refine Path interface
Diffstat (limited to 'digital')
-rw-r--r--digital/io-hub/src/common-cc/path.hh14
1 files changed, 13 insertions, 1 deletions
diff --git a/digital/io-hub/src/common-cc/path.hh b/digital/io-hub/src/common-cc/path.hh
index 3c3cce9c..3c281e46 100644
--- a/digital/io-hub/src/common-cc/path.hh
+++ b/digital/io-hub/src/common-cc/path.hh
@@ -30,11 +30,23 @@
class Path
{
public:
+ /// Reset path computation, remove every obstacles.
void reset () { }
- void obstacle (int index, vect_t c, int r, int factor = 0) { }
+ /// Set an obstacle position, radius and factor.
+ void obstacle (int index, const vect_t &c, int r, int factor = 0) { }
+ /// Set path source and destination.
void endpoints (const vect_t &src, const vect_t &dst) { dst_ = dst; }
+ /// Compute path with the given escape factor.
void compute (int factor = 0) { }
+ /// Get next point in computed path, return false if none (no path found
+ /// or last point given yet).
bool get_next (vect_t &p) { p = dst_; return true; }
+ /// Prepare score compuration for the given source, with given escape
+ /// factor.
+ void prepare_score (const vect_t &src, int factor = 0);
+ /// Return score for a given destination, using a previous preparation
+ /// (also reuse previously given escape factor).
+ int get_score (const vect_t &dst);
private:
vect_t dst_;
};