Skip to content

Instantly share code, notes, and snippets.

@MasterQ32
Created December 4, 2019 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MasterQ32/a9ba424dc7ede969a82b0a85a8af0968 to your computer and use it in GitHub Desktop.
Save MasterQ32/a9ba424dc7ede969a82b0a85a8af0968 to your computer and use it in GitHub Desktop.
TileMap Node Self Reference
Node = struct {
const This = @This();
const Child = union(enum) {
leaf: *Chunk,
branch: [2][2]?*This,
};
type: Child,
left: isize,
right: isize,
top: isize,
bottom: isize,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment