Esempio n. 1
0
		public static bool initialize(string insFileName)
		{
			// read the instruction file into prototype classes
			XmlElement docEl = XmlFiler.getDocumentElement(insFileName, "instructions", false);
			if (docEl == null)
			{
				Logger.getOnly().fail("Instruction prototype file " + insFileName + " not found or empty");
				return false;
			}
			XmlNodeList xnActive = XmlFiler.selectNodes(docEl, "active");
			if (xnActive == null)
			{
				Logger.getOnly().fail("Instruction prototype file " + insFileName + " contains no active instructions");
				return false;
			}
			m_actPrototypes = listChildren(xnActive[0]);
			if (m_actPrototypes == null)
			{
				Logger.getOnly().fail("Instruction prototype file " + insFileName + " contains not one active instruction!");
				return false;
			}

			XmlNodeList xnPassive = XmlFiler.selectNodes(docEl, "passive");
			if (xnPassive != null) m_pasPrototypes = listChildren(xnPassive[0]);

			XmlNodeList xnSuspended = XmlFiler.selectNodes(docEl, "suspended");
			if (xnSuspended != null) m_susPrototypes = listChildren(xnSuspended[0]);
			return true;
		}