Exemple #1
0
        public bool TryMathGate(string name, double[] answers)
        {
            MathGate gate = gates[name];

            if (gate.IsSolution(answers))
            {
                capabilities.Add(gate.Capability);
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public MathGateCollection(string dataFile, string schemaFile)
        {
            XPathNavigator navigator = openDocumentForReading(dataFile, schemaFile);

            if (!navigator.MoveToChild("mathGates", ""))
            {
                throw new Exception("XML Parsing error");
            }
            if (!navigator.MoveToChild("mathGate", ""))
            {
                throw new Exception("XML Parsing error");
            }

            do
            {
                MathGate gate = new MathGate(navigator.Clone());
                objectList.Add(gate);
            } while (navigator.MoveToNext());
        }