예제 #1
0
        public void CreatedDirectionNode2()
        {
            string        filename = @"Content\FireDirection.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;

            Assert.IsNotNull(testFireNode.GetChild(ENodeName.direction));
            Assert.IsNotNull(testFireNode.GetChild(ENodeName.direction) as DirectionNode);
        }
예제 #2
0
        public void CreatedDirectionNode2()
        {
            var           filename = new Filename(@"FireDirection.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;

            Assert.IsNotNull(testFireNode.GetChild(ENodeName.direction));
            Assert.IsNotNull(testFireNode.GetChild(ENodeName.direction) as DirectionNode);
        }
예제 #3
0
        public void DirectionNodeSequence()
        {
            string        filename = @"Content\FireDirectionSequence.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(ENodeName.fire) as FireNode;
            DirectionNode testDirectionNode = testFireNode.GetChild(ENodeName.direction) as DirectionNode;

            Assert.AreEqual(ENodeType.sequence, testDirectionNode.NodeType);
        }
예제 #4
0
        public void SpeedNodeSequence()
        {
            var           filename = new Filename(@"FireSpeedSequence.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            SpeedNode  testSpeedNode  = testFireNode.GetChild(ENodeName.speed) as SpeedNode;

            Assert.AreEqual(ENodeType.sequence, testSpeedNode.NodeType);
        }
예제 #5
0
        public void GotActionRefNode4()
        {
            string        filename = @"Content\ActionRefEmpty.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode testBulletNode = testFireNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode.GetChild(ENodeName.actionRef) as ActionRefNode);
        }
예제 #6
0
        public void GotActionRefNode3()
        {
            var           filename = new Filename(@"ActionRefEmpty.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode testBulletNode = testFireNode.GetChild(ENodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode.GetChild(ENodeName.actionRef));
        }
예제 #7
0
        public void DirectionNodeAbsolute()
        {
            var           filename = new Filename(@"FireDirectionAbsolute.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(ENodeName.fire) as FireNode;
            DirectionNode testDirectionNode = testFireNode.GetChild(ENodeName.direction) as DirectionNode;

            Assert.AreEqual(ENodeType.absolute, testDirectionNode.NodeType);
        }
예제 #8
0
        public void GotParamNode2()
        {
            string        filename = @"Content\BulletRefParam.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode    testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletRefNode refNode        = testFireNode.GetChild(ENodeName.bulletRef) as BulletRefNode;

            Assert.IsNotNull(refNode.GetChild(ENodeName.param) as ParamNode);
        }
예제 #9
0
        public void SpeedNodeAbsolute()
        {
            string        filename = @"Content\FireSpeedAbsolute.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode   testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            SpeedNode  testSpeedNode  = testFireNode.GetChild(ENodeName.speed) as SpeedNode;

            Assert.AreEqual(ENodeType.absolute, testSpeedNode.NodeType);
        }
예제 #10
0
        public void GotParamNode2()
        {
            var           filename = TestUtils.GetFilePath(@"Content\BulletRefParam.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.Parse(filename);

            ActionNode    testActionNode = pattern.RootNode.GetChild(NodeName.action) as ActionNode;
            FireNode      testFireNode   = testActionNode.GetChild(NodeName.fire) as FireNode;
            BulletRefNode refNode        = testFireNode.GetChild(NodeName.bulletRef) as BulletRefNode;

            Assert.IsNotNull(refNode.GetChild(NodeName.param) as ParamNode);
        }
예제 #11
0
        public void FoundBulletNode1()
        {
            var           filename = new Filename(@"BulletRef.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode    testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletRefNode refNode        = testFireNode.GetChild(ENodeName.bulletRef) as BulletRefNode;

            Assert.IsNotNull(refNode.ReferencedBulletNode as BulletNode);
        }
예제 #12
0
        public void FoundCorrectBulletNode()
        {
            string        filename = @"Content\BulletRefTwoBullets.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode    testActionNode = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode   = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletRefNode refNode        = testFireNode.GetChild(ENodeName.bulletRef) as BulletRefNode;
            BulletNode    testBulletNode = refNode.ReferencedBulletNode as BulletNode;

            Assert.AreEqual("test2", testBulletNode.Label);
        }
예제 #13
0
        public void FoundActionNode2()
        {
            string        filename = @"Content\ActionRefEmpty.xml";
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode    testBulletNode    = testFireNode.GetChild(ENodeName.bullet) as BulletNode;
            ActionRefNode testActionRefNode = testBulletNode.GetChild(ENodeName.actionRef) as ActionRefNode;
            ActionNode    refNode           = testActionRefNode.ReferencedActionNode as ActionNode;

            Assert.AreEqual(refNode.Label, "test");
        }
예제 #14
0
        public void FoundCorrectActionNode()
        {
            var           filename = new Filename(@"ActionRefParam.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.ParseXML(filename.File);

            ActionNode    testActionNode    = pattern.RootNode.GetChild(ENodeName.action) as ActionNode;
            FireNode      testFireNode      = testActionNode.GetChild(ENodeName.fire) as FireNode;
            BulletNode    testBulletNode    = testFireNode.GetChild(ENodeName.bullet) as BulletNode;
            ActionRefNode testActionRefNode = testBulletNode.GetChild(ENodeName.actionRef) as ActionRefNode;
            ActionNode    refNode           = testActionRefNode.ReferencedActionNode as ActionNode;

            Assert.AreEqual(refNode.Label, "test2");
        }
예제 #15
0
        public void FoundCorrectActionNode()
        {
            var           filename = TestUtils.GetFilePath(@"Content\ActionRefParam.xml");
            BulletPattern pattern  = new BulletPattern();

            pattern.Parse(filename);

            ActionNode testActionNode = pattern.RootNode.GetChild(NodeName.action) as ActionNode;

            Assert.IsNotNull(testActionNode);
            FireNode testFireNode = testActionNode.GetChild(NodeName.fire) as FireNode;

            Assert.IsNotNull(testFireNode);
            BulletNode testBulletNode = testFireNode.GetChild(NodeName.bullet) as BulletNode;

            Assert.IsNotNull(testBulletNode);
            ActionRefNode testActionRefNode = testBulletNode.GetChild(NodeName.actionRef) as ActionRefNode;

            Assert.IsNotNull(testActionRefNode);
            ActionNode refNode = testActionRefNode.ReferencedActionNode;

            Assert.IsNotNull(testActionNode);
            Assert.AreEqual("test2", refNode.Label);
        }