本文整理汇总了C++中HashString::c_str方法的典型用法代码示例。如果您正苦于以下问题:C++ HashString::c_str方法的具体用法?C++ HashString::c_str怎么用?C++ HashString::c_str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HashString
的用法示例。
在下文中一共展示了HashString::c_str方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
virtual void Execute(const DataObject &object)
{
// The current player is now in a blocking action.
RULE.Execute(shRuleBeginBlockingAction, DataObject(current()));
wxASSERT(1 <= object.numItems());
//retrieve the text to put in the MessageUI
DataObject input(0), output;
const HashString& state = gameData<HashString>(shState);
if(false == DecideHash(state, input, output))
{
wxLogError(
wxString::Format(wxT("Programmer Error: No State %s in ")
wxT("RuleRequestInitialRoadSeafarers"), state.cwx_str()));
return;
}
wxASSERT(3 == output.numItems());
wxString text1 = output.read<wxString>();
wxString text2 = output.read<wxString>(1);
HashString logic = HashString::Format(shLogicStringFormat.c_str(),
output.read<HashString>(2).c_str());
HashString rule = HashString::Format(shRuleStringFormat.c_str(),
output.read<HashString>(2).c_str());
//if this involves ships, do some crazy mojo
if(TRUE == gameData<wxInt32>(shInitialShip))
{
text1 = stPlaceAShip;
text2 = stWaitingPlaceAShip;
wxInt32 index = logic.find(shRoad);
wxASSERT(-1 != index);
logic.replace(index, 4, shShip);
logic = HashString(logic.c_str());
}
RULE.Execute(shRuleUpdateMessageUI,
DataObject(text1, text2));
RULE.Execute(shRuleLocateInitialRoad, DataObject(
object.read<wxInt32>(), logic, rule));
}