本文整理汇总了C++中Quest::getState方法的典型用法代码示例。如果您正苦于以下问题:C++ Quest::getState方法的具体用法?C++ Quest::getState怎么用?C++ Quest::getState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quest
的用法示例。
在下文中一共展示了Quest::getState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
CeGuiString GetProcessor::process(DOMNode* node,Match* match, const CeGuiString& str, NaturalLanguageProcessor* nlp)
{
CeGuiString propertyType = XmlHelper::getAttributeValueAsString(
static_cast<DOMElement*>(node), "type" );
CeGuiString propertyName = XmlHelper::getAttributeValueAsString(
static_cast<DOMElement*>(node), "name" );
CeGuiString rVal;
if(propertyType == "quest")
{
Quest* quest = RulesSubsystem::getSingletonPtr()->getQuestBook()
->getQuest(propertyName);
if(quest != NULL)
{
rVal = quest->getState();
}
}
else
{
rVal = nlp->getPredicates().getPredicate(propertyName, "default");
}
return rVal;
}
示例2: getPartsDone
int Quest::getPartsDone() const
{
if (!hasSubquests())
return mPartsDone;
int done = 0;
for(QuestVector::const_iterator it = mSubquests.begin();
it != mSubquests.end(); it++)
{
Quest* cur = (*it);
if (cur->getState() == Quest::COMPLETED
|| cur->getState() == Quest::SUCCEEDED)
done++;
}
return done;
}
示例3: process
//.........这里部分代码省略.........
{
if ( childNode->getNodeType() == DOMNode::ELEMENT_NODE )
{
CeGuiString nodeName = XmlHelper::transcodeToString(
childNode->getNodeName());
if(nodeName.compare("li") == 0)
{
//tmpVal = XmlHelper::getAttributeValueAsInteger(
// static_cast<DOMElement*>(childNode), "value" );
CeGuiString strValue = XmlHelper::getAttributeValueAsString(
static_cast<DOMElement*>(childNode), "value" );
std::string sValue = XmlHelper::getAttributeValueAsStdString(
static_cast<DOMElement*>(childNode), "value" );
std::string id = XmlHelper::getAttributeValueAsStdString(
static_cast<DOMElement*>(childNode), "id" );
tmpVal = CEGUI::PropertyHelper::stringToInt(strValue);
bool conditionFulfilled = false;
// Add elements in <li> Tag only if <li>-value = return value of the named function
if(conditionContext == "selection")
{
conditionFulfilled = true;
}
else if(conditionType == "Predicate")
{
CeGuiString predicate = nlp->getPredicates().getPredicate(
conditionName, "default");
if(!predicate.empty())
{
conditionFulfilled = (predicate == strValue);
}
}
else if ( (conditionType == "Talent"
|| conditionType == "Eigenschaft")
)
{
if( (rVal > 0 && tmpVal > 0)
|| (rVal <= 0 && tmpVal == 0))
{
conditionFulfilled = true;
}
}
else if(quest != NULL)
{
conditionFulfilled = (tmpVal == quest->getState());
}
else
{
conditionFulfilled = (tmpVal == rVal);
}
if(conditionFulfilled)
{
CeGuiString temp = nlp->process(childNode, m, str);
if(conditionContext.empty())
{
// used for postprocessing of the option-tag when
// checking for skills(talents)
buffer += id + " " + temp;
}
else if(conditionContext == "selection")
{
buffer += "<li id=\"" + id + "\" ";
buffer += "value=\"" + sValue + "\" ";
buffer += ">";
buffer += temp;
buffer += "</li>";
}
else
{
buffer += "<li id=\"" + id + "\" ";
buffer += "value=\"" + sValue + "\" ";
buffer += "/>";
buffer += temp;
}
} // end if conditionFulfilled
} // end compare nodeName
} // end compare nodeType
else if( childNode->getNodeType() == DOMNode::TEXT_NODE )
{
CeGuiString text = XmlHelper::transcodeToString(
static_cast<DOMText*>(childNode)->getData());
if( !normalise(text).empty())
{
buffer += nlp->process(node, m, str);
return buffer;
}
}
} // end for loop
if(conditionChild)
{
buffer += "</option>";
}
return buffer;
}