Playing around with testing (unsuccessfully)
This commit is contained in:
@@ -2,6 +2,7 @@ const std = @import("std");
|
||||
const rl = @import("raylib");
|
||||
|
||||
const c = @import("../constants.zig");
|
||||
const e = @import("../errors.zig");
|
||||
const Road = @import("road.zig").Road;
|
||||
|
||||
pub const Node = struct {
|
||||
@@ -34,7 +35,7 @@ pub const Node = struct {
|
||||
pub fn referenceRoad(self: *Node, allocator: std.mem.Allocator, road_to_add: *Road) !void {
|
||||
// Note the road_to_add pointer must be one from the roads list as otherwise the pointer is dangling one
|
||||
for (self.roads.items) |road| {
|
||||
if (road.*.id == road_to_add.*.id) return error.RoadAlreadyReferenced;
|
||||
if (road == road_to_add) return e.Entity.AlreadyReferenced;
|
||||
}
|
||||
|
||||
try self.roads.append(allocator, road_to_add);
|
||||
|
||||
Reference in New Issue
Block a user