本文整理汇总了C++中Action::Destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ Action::Destroy方法的具体用法?C++ Action::Destroy怎么用?C++ Action::Destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action::Destroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void ComBoard :: Load(const char *fileName, xBYTE I_bones)
{
Destroy();
this->I_bones = I_bones;
FileName = Filesystem::GetFullPath(fileName);
std::ifstream in;
in.open(FileName.c_str());
if (in.is_open())
{
std::string dir = Filesystem::GetParentDir(fileName);
char buffer[255];
int len;
AutoHint hint;
Action action;
Combo combo;
action.Clear();
combo.Clear();
enum LoadMode
{
LoadMode_None,
LoadMode_Auto,
LoadMode_Mirror,
LoadMode_Action,
LoadMode_Combo
} mode = LoadMode_None;
while (in.good())
{
in.getline(buffer, 255);
if (buffer[0] == 0 || buffer[0] == '#') continue;
len = strlen(buffer);
if (buffer[len - 1] == '\r') buffer[len - 1] = 0;
if (*buffer == '[')
{
if (StartsWith(buffer, "[action]"))
{
if (combo.SN_action.length())
action.L_combos.push_back(combo);
if (action.SN_name.length())
L_actions.push_back(action);
else
action.Destroy();
action.Clear();
combo.Clear();
mode = LoadMode_Action;
continue;
}
if (StartsWith(buffer, "[auto]"))
{
mode = LoadMode_Auto;
continue;
}
if (StartsWith(buffer, "[mirror]"))
{
mode = LoadMode_Mirror;
continue;
}
mode = LoadMode_None;
continue;
}
if (mode == LoadMode_Action || mode == LoadMode_Combo)
{
if (*buffer == '(')
{
if (mode != LoadMode_None && StartsWith(buffer, "(combo)"))
{
if (combo.SN_action.length())
action.L_combos.push_back(combo);
combo.Clear();
mode = LoadMode_Combo;
continue;
}
continue;
}
}
if (mode == LoadMode_Auto)
{
if (StartsWith(buffer, "stop"))
{
StopAction.SN_action = ReadSubstring(buffer+4);
continue;
}
if (StartsWith(buffer, "step"))
{
const char* params = NULL;
hint.SN_action = ReadSubstring(buffer+4, params);
if (params)
{
int flag = 1;
sscanf(params, "%f %d", &hint.S_max_change, &flag);
hint.FL_breakable = flag;
}
L_hint[AutoHint::HINT_STEP].push_back(hint);
continue;
}
if (StartsWith(buffer, "back"))
//.........这里部分代码省略.........