api: add some new functions
This commit is contained in:
parent
92c762a586
commit
ca94e31472
2 changed files with 23 additions and 1 deletions
|
|
@ -42,4 +42,10 @@ public:
|
|||
|
||||
// force bot to go to selected origin
|
||||
virtual void setBotGoalOrigin (int entity, float *origin) = 0;
|
||||
|
||||
// checks whether graph nodes is available on map
|
||||
virtual bool hasGraph () = 0;
|
||||
|
||||
// get's the graph node flags
|
||||
virtual int getNodeFlags (int node) = 0;
|
||||
};
|
||||
|
|
@ -9,6 +9,9 @@
|
|||
|
||||
// module interface implementation
|
||||
class YaPBModule : public IYaPBModule {
|
||||
public:
|
||||
virtual ~YaPBModule () override = default;
|
||||
|
||||
private:
|
||||
Bot *getBot (int index) {
|
||||
if (index < 1) {
|
||||
|
|
@ -36,7 +39,7 @@ public:
|
|||
// gets the node nearest to origin
|
||||
virtual int getNearestNode (float *origin) override {
|
||||
if (graph.length () > 0) {
|
||||
return graph.getNearestNoBuckets (origin);
|
||||
return graph.getNearest (origin);
|
||||
}
|
||||
return kInvalidNodeIndex;
|
||||
}
|
||||
|
|
@ -84,6 +87,19 @@ public:
|
|||
return bot->sendBotToOrigin (origin);
|
||||
}
|
||||
}
|
||||
|
||||
// checks whether graph nodes is available on map
|
||||
virtual bool hasGraph () override {
|
||||
return graph.length () > 0;
|
||||
}
|
||||
|
||||
// get's the graph node flags
|
||||
virtual int getNodeFlags (int node) override {
|
||||
if (graph.length () > 0 && graph.exists (node)) {
|
||||
return graph[node].flags;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
// export all the stuff, maybe add versioned interface ?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue