示例#1
0
        public void SetupTree()
        {
            var mage         = new SkillNode(new Skill("Mage"));
            var fireball     = new SkillNode(new Skill("Fireball"));
            var electroshock = new SkillNode(new Skill("Electroshock"));
            var freeze       = new SkillNode(new Skill("Freeze"));
            var thunderbolt  = new SkillNode(new Skill("Thunderbolt"));
            var snowstorm    = new SkillNode(new Skill("Snowstorm"));;

            mage.AddChild(fireball);
            fireball.AddChild(electroshock, freeze);
            electroshock.AddChild(thunderbolt);
            freeze.AddChild(snowstorm);

            List <SkillNode> list = new List <SkillNode>
            {
                mage,
                fireball,
                electroshock,
                freeze,
                thunderbolt,
                snowstorm,
            };

            _skillsTree = new Skills.SkillsGraph(list);
        }
示例#2
0
        public void SetupGraph()
        {
            var warrior        = new SkillNode(new Skill("Warrior"));
            var strike         = new SkillNode(new Skill("Strike"));
            var hit            = new SkillNode(new Skill("Hit"));
            var doubleStrike   = new SkillNode(new Skill("Double Strike"));
            var slash          = new SkillNode(new Skill("Slash"));
            var knockout       = new SkillNode(new Skill("Knockout"));
            var roundHouseKick = new SkillNode(new Skill("Roundhouse Kick"));

            warrior.AddChild(strike, hit);
            strike.AddChild(doubleStrike, slash);
            slash.AddChild(roundHouseKick);
            hit.AddChild(knockout);
            knockout.AddChild(roundHouseKick);

            List <SkillNode> list = new List <SkillNode>
            {
                warrior,
                strike,
                hit,
                doubleStrike,
                slash,
                knockout,
                roundHouseKick
            };

            _skillsGraph = new Skills.SkillsGraph(list);
        }