示例#1
0
bool OUGUIObject::OnLoadFromXml(TiXmlElement* pElement, OUGUIObject* pWillParent)
{
    if(pWillParent)
    {
        OUPOINT ParentSize = pWillParent->GetSize();
        SetMoveRange(0, 0, ParentSize.m_fX, ParentSize.m_fY);
    }

    int id;
    pElement->QueryIntAttribute("id", &id);
    string key;
    key = pElement->Attribute("name");

    SetID(id);
    SetKey(key);

    //TiXmlElement* pNode;
    //for(pNode = pElement->FirstChildElement(); pNode != NULL; pNode = pNode->NextSiblingElement())
    //{
    //    Assert(pNode->Value(), "Empty node value.");
    //    OUStringFunc str = pNode->Value();
    //    str.ToUppercase();

    //    if(str.GetString() == "ID")
    //    {
    //        SetID(atoi(pNode->GetText()));
    //    }
    //    else
    //    if(str.GetString() == "NAME")
    //    {
    //        SetKey(pNode->GetText());
    //    }
    //}

    return true;
}
GoUctAdditiveKnowledgeFuego::GoUctAdditiveKnowledgeFuego(const GoBoard& bd)
    : GoUctAdditiveKnowledgeStdProb(bd)
{
    // Knowledge applies to all moves
    SetMoveRange(0, 10000); 
}