Skip to content

Instantly share code, notes, and snippets.

@mstewartgallus
Created April 18, 2013 23:57
Show Gist options
  • Save mstewartgallus/5417124 to your computer and use it in GitHub Desktop.
Save mstewartgallus/5417124 to your computer and use it in GitHub Desktop.
SiegeLords Tree
struct Node<'self>
{
Valid : bool,
Parent : Option<&'self Node<'self>>
}
impl<'self> Node<'self>
{
fn new() -> Node<'self>
{
Node{Valid : true, Parent : None}
}
fn spawn_child(parent : &'self Node<'self>) -> Node<'self>
{
Node::<'self>{Valid : true, Parent : Some (parent)}
}
}
fn main()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment