本文整理汇总了C++中Shuttle::getLandingTime方法的典型用法代码示例。如果您正苦于以下问题:C++ Shuttle::getLandingTime方法的具体用法?C++ Shuttle::getLandingTime怎么用?C++ Shuttle::getLandingTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shuttle
的用法示例。
在下文中一共展示了Shuttle::getLandingTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _handleShuttleUpdate
bool WorldManager::_handleShuttleUpdate(uint64 callTime,void* ref)
{
ShuttleList::iterator shuttleIt = mShuttleList.begin();
while(shuttleIt != mShuttleList.end())
{
Shuttle* shuttle = (*shuttleIt);
// The Ticket Collector need a valid shuttle-object.
if (!shuttle->ticketCollectorEnabled())
{
TicketCollector* collector = dynamic_cast<TicketCollector*>(getObjectById(shuttle->getCollectorId()));
if (collector)
{
if (!collector->getShuttle())
{
// Enable the collector.
collector->setShuttle(shuttle);
}
shuttle->ticketCollectorEnable();
}
}
switch(shuttle->getShuttleState())
{
case ShuttleState_Away:
{
uint32 awayTime = shuttle->getAwayTime() + 1000;
if(awayTime >= shuttle->getAwayInterval())
{
uint32 awayTime = shuttle->getAwayTime() + 1000;
if(awayTime >= shuttle->getAwayInterval())
{
shuttle->states.setPosture(0);
shuttle->setAwayTime(0);
shuttle->setShuttleState(ShuttleState_AboutBoarding);
gMessageLib->sendPostureUpdate(shuttle);
gMessageLib->sendCombatAction(shuttle,NULL,opChange_Posture);
}
}
else
shuttle->setAwayTime(awayTime);
}
break;
case ShuttleState_Landing:
{
uint32 landingTime = shuttle->getLandingTime() + 1000;
if(landingTime >= SHUTTLE_LANDING_ANIMATION_TIME - 5000)
{
shuttle->setShuttleState(ShuttleState_AboutBoarding);
}
else
shuttle->setLandingTime(landingTime);
}
break;
case ShuttleState_AboutBoarding:
{
uint32 landingTime = shuttle->getLandingTime() + 1000;
if(landingTime >= SHUTTLE_LANDING_ANIMATION_TIME)
{
shuttle->setLandingTime(0);
shuttle->setShuttleState(ShuttleState_InPort);
}
else
shuttle->setLandingTime(landingTime);
}
break;
case ShuttleState_InPort:
{
uint32 inPortTime = shuttle->getInPortTime() + 1000;
if(inPortTime >= shuttle->getInPortInterval())
{
uint32 inPortTime = shuttle->getInPortTime() + 1000;
if(inPortTime >= shuttle->getInPortInterval())
{
shuttle->setInPortTime(0);
shuttle->setShuttleState(ShuttleState_Away);
shuttle->states.setPosture(2);
gMessageLib->sendPostureUpdate(shuttle);
gMessageLib->sendCombatAction(shuttle,NULL,opChange_Posture);
}
}
else
{
shuttle->setInPortTime(inPortTime);
}
}
break;
default:
break;
}
++shuttleIt;
}
//.........这里部分代码省略.........