当前位置: 首页>>代码示例>>C++>>正文


C++ Quest::getState方法代码示例

本文整理汇总了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;
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:26,代码来源:GetProcessor.cpp

示例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;
}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:16,代码来源:Quest.cpp

示例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;
	}
开发者ID:BackupTheBerlios,项目名称:dsa-hl-svn,代码行数:101,代码来源:ConditionProcessor.cpp


注:本文中的Quest::getState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。