node implementation on spawn areas
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const std = @import("std");
|
||||
const rl = @import("raylib");
|
||||
const str_node = @import("../road/node.zig");
|
||||
const spawn_area = @import("spawn-area.zig");
|
||||
const structures = @import("../structures.zig");
|
||||
|
||||
@@ -75,4 +76,15 @@ pub const Areas = struct {
|
||||
|
||||
return valuesToRandomise;
|
||||
}
|
||||
|
||||
pub fn getNodes(self: *Areas) ![]str_node.Node {
|
||||
var nodes = try self.allocator.alloc(str_node.Node, self.areas.len);
|
||||
|
||||
for (0..self.areas.len) |i| {
|
||||
const node_location = self.areas[i].getNodeLocation();
|
||||
nodes[i] = str_node.Node.init(node_location);
|
||||
}
|
||||
|
||||
return nodes;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user