Enable assigning an owner to navigation regions and links

This allows users of the server APIs to get back the nodes that created certain regions and links.
This commit is contained in:
Josh Jones
2022-09-30 23:49:39 -06:00
parent 39fe0bfdc3
commit 5769b0e8d8
15 changed files with 140 additions and 0 deletions

View File

@@ -108,6 +108,10 @@ public:
virtual void region_set_travel_cost(RID p_region, real_t p_travel_cost) const;
virtual real_t region_get_travel_cost(RID p_region) const;
/// Set the node which manages this region.
virtual void region_set_owner_id(RID p_region, ObjectID p_owner_id) const;
virtual ObjectID region_get_owner_id(RID p_region) const;
virtual bool region_owns_point(RID p_region, const Vector2 &p_point) const;
/// Set the map of this region.
@@ -160,6 +164,10 @@ public:
virtual void link_set_travel_cost(RID p_link, real_t p_travel_cost) const;
virtual real_t link_get_travel_cost(RID p_link) const;
/// Set the node which manages this link.
virtual void link_set_owner_id(RID p_link, ObjectID p_owner_id) const;
virtual ObjectID link_get_owner_id(RID p_link) const;
/// Creates the agent.
virtual RID agent_create() const;