コード例 #1
0
        public override XmlElement SerializeData(XmlDocument doc)
        {
            XmlElement element = base.SerializeData(doc);

            element.SetAttribute("mass", string.Empty, Mass.ToString("G4"));
            element.SetAttribute("drag", string.Empty, Drag.ToString("G4"));
            element.SetAttribute("angular-drag", string.Empty, AngularDrag.ToString("G4"));
            element.SetAttribute("use-gravity", string.Empty, UseGravity.ToString());
            element.SetAttribute("constraints", string.Empty, Constraints.ToString());

            return(element);
        }
コード例 #2
0
        public void ParseTest()
        {
            string input = testClick.ToString() + "\n";

            input += testHover.ToString() + "\n";
            input += testDrag.ToString() + "\n";
            input += testKeystroke.ToString() + "\n";

            AutoClickerParser parser = SetUp(input.ToString());

            AutoClickerParser.InstructionsContext context = parser.instructions();
            AutoClickerVisitor visitor = new AutoClickerVisitor();
            List <Instructions.Instruction> instructions = (List <Instructions.Instruction>)visitor.Visit(context);

            Assert.IsTrue(instructions.Contains(testClick));
            Assert.IsTrue(instructions.Contains(testHover));
            Assert.IsTrue(instructions.Contains(testDrag));
            Assert.IsTrue(instructions.Contains(testKeystroke));
        }