From e72aa8fc5fca9c5397eb24bd75f1468eb5905fbb Mon Sep 17 00:00:00 2001 From: Marto Date: Wed, 29 Apr 2026 23:57:23 +0200 Subject: [PATCH] Road splitting setup (intersection data) --- src/common/structures.zig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/common/structures.zig b/src/common/structures.zig index 3feeba5..ad2bc6a 100644 --- a/src/common/structures.zig +++ b/src/common/structures.zig @@ -1,3 +1,5 @@ +const Vector2 = @import("raylib").Vector2; + const Road = @import("../infrastructure/road.zig").Road; const Node = @import("../infrastructure/node.zig").Node; @@ -5,4 +7,13 @@ const Node = @import("../infrastructure/node.zig").Node; pub const Entity = union(enum) { node: *Node, road: *Road, +}; + +/// Represents intersection data, mainly used in cases where we draw over existing roads +/// and wish to see data about such intersections or collisions +pub const IntersectionData = struct { + /// Tracks the location of the intersection + pos: Vector2, + /// Points to the road where the intersection occured + road: *Road, }; \ No newline at end of file