diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-06-13 21:53:32 +0100 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-06-13 21:53:32 +0100 |
| commit | 1e7a924874050674a103f6927f4a3c5ef6459222 (patch) | |
| tree | 68f8f4b5dd34ff19b8a7cb6778a556775ed45b83 /game/network/network.h | |
| parent | Handle edge cases (diff) | |
| download | ilt-1e7a924874050674a103f6927f4a3c5ef6459222.tar.bz2 ilt-1e7a924874050674a103f6927f4a3c5ef6459222.tar.xz ilt-1e7a924874050674a103f6927f4a3c5ef6459222.zip | |
Create a list of snap points for the existing networkbetter-network
These form key positions in the world to ease neat creation.
Diffstat (limited to 'game/network/network.h')
| -rw-r--r-- | game/network/network.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/game/network/network.h b/game/network/network.h index d3370b3..7bfd2ce 100644 --- a/game/network/network.h +++ b/game/network/network.h @@ -35,6 +35,19 @@ struct CreationDefinition { CreationDefinitionEnd toEnd; }; +struct SnapPoint : CreationDefinitionEnd { + template<typename... CDE> + requires std::is_constructible_v<CreationDefinitionEnd, CDE...> + explicit SnapPoint(GlobalPosition3D snapPosition, CDE &&... cde) : + CreationDefinitionEnd {std::forward<CDE>(cde)...}, snapPosition(snapPosition) + { + } + + GlobalPosition3D snapPosition; +}; + +using SnapPoints = std::vector<SnapPoint>; + class Network { public: using LinkEnd = std::pair<Link::Ptr, unsigned char>; @@ -55,6 +68,7 @@ public: [[nodiscard]] static Link::Nexts routeFromTo(const Link::End &, const Node::Ptr &); [[nodiscard]] virtual float findNodeDirection(Node::AnyCPtr) const = 0; + [[nodiscard]] virtual SnapPoints getSnapPoints() const = 0; [[nodiscard]] Link::Collection create(const GeoData *, const CreationDefinition &); [[nodiscard]] Link::Collection createChain(const GeoData *, std::span<const GlobalPosition3D>); |
