예제 #1
0
	Bool HsRobot::Init(const AString& sCfg)
	{
		HawkXmlFile xmlCfg;
		HawkXmlDocument<AString> xmlDoc;
		if (!xmlCfg.Open(sCfg, xmlDoc))
		{
			HawkPrint("Robot Open Config Error.");
			return false;
		}

		AXmlElement* pRoot  = xmlDoc.GetRoot();
		if (pRoot->GetChildAttribute("Robot", "Addr"))
			m_sSvrAddr = pRoot->GetChildAttribute("Robot", "Addr")->StringValue();

		if (pRoot->GetChildAttribute("Robot", "Count"))
			m_iCount = pRoot->GetChildAttribute("Robot", "Count")->IntValue();
		
		return true;
	}