本文整理汇总了C++中Paddle::moving方法的典型用法代码示例。如果您正苦于以下问题:C++ Paddle::moving方法的具体用法?C++ Paddle::moving怎么用?C++ Paddle::moving使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paddle
的用法示例。
在下文中一共展示了Paddle::moving方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: logic
//.........这里部分代码省略.........
if(total_entries>0) {
char datestr[256];
char timestr[256];
struct tm* timeinfo = localtime ( &currtime );
strftime(datestr, 256, "%A, %B %d, %Y", timeinfo);
strftime(timestr, 256, "%X", timeinfo);
displaydate = datestr;
displaytime = timestr;
} else {
displaydate = "";
displaytime = "";
}
lasttime=currtime;
profile_stop();
} else {
//do small reads per frame if we havent buffered the next second
if(queued_entries.empty() || queued_entries.back()->timestamp <= currtime+1) {
readLog(50);
}
}
std::list<Paddle*> inactivePaddles;
//update paddles
for(auto& it: paddles) {
std::string paddle_token = it.first;
Paddle* paddle = it.second;
if(settings.paddle_mode > PADDLE_SINGLE && !paddle->moving() && !paddle->visible()) {
bool token_match = false;
//are there any requests that will match this paddle?
for(RequestBall* ball : balls) {
if( (settings.paddle_mode == PADDLE_VHOST && ball->le->vhost == paddle_token)
|| (settings.paddle_mode == PADDLE_PID && ball->le->pid == paddle_token)) {
token_match = true;
break;
}
}
//mark this paddle for deletion, continue
if(!token_match) {
inactivePaddles.push_back(paddle);
continue;
}
}
// find nearest ball to this paddle
if( (retarget || !paddle->getTarget())) {
RequestBall* ball = findNearest(paddle, paddle_token);
if(ball != 0) {
paddle->setTarget(ball);
} else if(!paddle->moving()) {
paddle->setTarget(0);
}
}