本文整理汇总了C++中Operation::setSeconds方法的典型用法代码示例。如果您正苦于以下问题:C++ Operation::setSeconds方法的具体用法?C++ Operation::setSeconds怎么用?C++ Operation::setSeconds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operation
的用法示例。
在下文中一共展示了Operation::setSeconds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addOperationToQueue
/// \brief Add an operation to the ordered op queue.
///
/// Any time adjustment required is made to the operation, and it
/// is added to the apropriate place in the chronologically ordered
/// queue. The From attribute of the operation is set to the id of
/// the entity that is responsible for adding the operation to the
/// queue.
void OperationsDispatcher::addOperationToQueue(const Operation & op, LocatedEntity & ent)
{
assert(op.isValid());
assert(op->getFrom() != "cheat");
m_operation_queues_dirty = true;
op->setFrom(ent.getId());
if (!op->hasAttrFlag(Atlas::Objects::Operation::FUTURE_SECONDS_FLAG)) {
op->setSeconds(getTime());
m_immediateQueue.push(OpQueEntry(op, ent));
return;
}
double t = getTime() + (op->getFutureSeconds() * consts::time_multiplier);
op->setSeconds(t);
op->setFutureSeconds(0.);
m_operationQueue.push(OpQueEntry(op, ent));
if (debug_flag) {
std::cout << "WorldRouter::addOperationToQueue {" << std::endl;
debug_dump(op, std::cout);
std::cout << "}" << std::endl << std::flush;
}
}