public TalentTreeNode(string name, bool learned) { this.name = name; this.learned = learned; Left = null; Right = null; }
static void Main(string[] args) { Level0 = new TalentTreeNode("Magic") { HasLearned = true }; Level1_0 = new TalentTreeNode("Fireball") { HasLearned = true }; Level1_1 = new TalentTreeNode("Magic Arrow") { HasLearned = false }; Level2_00 = new TalentTreeNode("Crazy Big Fireball") { HasLearned = false }; Level2_01 = new TalentTreeNode("1000 Tiny Fireballs") { HasLearned = true }; Level2_10 = new TalentTreeNode("Ice Arrow") { HasLearned = false }; Level2_11 = new TalentTreeNode("Exploding Arrow") { HasLearned = false }; Level1_0.LeftNode = Level2_00; Level1_0.RightNode = Level2_01; Level1_1.LeftNode = Level2_10; Level1_1.RightNode = Level2_11; Level0.LeftNode = Level1_0; Level0.RightNode = Level1_1; Console.WriteLine(" All Possible Talents"); Console.WriteLine("=================================="); Level0.ListAllAbilities(); Console.WriteLine(); Console.WriteLine(" All Known Talents"); Console.WriteLine("=================================="); Level0.ListKnownAbilities(); Console.WriteLine(); Console.WriteLine(" All Unknown but Possible Talents"); Console.WriteLine("=================================="); Level0.ListPossibleAbilities(); Console.WriteLine(); }
static void Main(string[] args) { TalentTreeNode root = new TalentTreeNode("Assassin", true); TalentTreeNode rootA = new TalentTreeNode("Bow", true); TalentTreeNode rootB = new TalentTreeNode("Throwing Dagger", false); TalentTreeNode rootAA = new TalentTreeNode("Double Arrow", false); TalentTreeNode rootAB = new TalentTreeNode("Fire Arrow", true); TalentTreeNode rootBA = new TalentTreeNode("Fan of Daggers", false); TalentTreeNode rootBB = new TalentTreeNode("Poison Dagger", false); root.Left = rootA; root.Right = rootB; rootA.Left = rootAA; rootA.Right = rootAB; rootB.Left = rootBA; rootB.Right = rootBB; Console.WriteLine("All abilities:"); root.ListAllAbilities(); Console.WriteLine("\nAll known abilites:"); root.ListKnownAbilities(); Console.WriteLine("\nAll possible abilites:"); root.ListPossibleAbilities(); }