本文整理汇总了C++中FileParser::tokenize方法的典型用法代码示例。如果您正苦于以下问题:C++ FileParser::tokenize方法的具体用法?C++ FileParser::tokenize怎么用?C++ FileParser::tokenize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileParser
的用法示例。
在下文中一共展示了FileParser::tokenize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* args[])
{
FileParser fp;
TokenList list = fp.tokenize(args[1]);
LevelCreator lc;
Course course = lc.createCourse(list);
// Start SDL
if (!init(argc, args)) {
system("pause");
exit(0);
}
// Load sound files for audio
if (!Audio::loadMedia()){
exit(0);
}
// Main Loop
else {
Mix_PlayMusic(Audio::gMusic, -1);
float start_time_ms = SDL_GetTicks();
float prev_time = start_time_ms;
float curr_time;
float delta_time = 10;
while (!quit) {
// Make sure we referance the correct level
Level test = course.levels[GameInfo::currLevel];
// Update game time
curr_time = SDL_GetTicks() - start_time_ms;
delta_time = curr_time - prev_time;
// Process Events
handleEvents(test);
// Update
update(delta_time, test);
// Draw
draw(test);
// Play music if stopped
if (Mix_PlayingMusic() == 0){
Mix_PlayMusic(Audio::gMusic, -1);
}
// Set previous time
prev_time = curr_time;
}
}
// Free and close
close();
return 0;
}