void RPG_Trigger::ServerTick(float const deltaTime) { // Entered for(int i = 0; i < m_enteredEntities.GetSize(); ++i) { VisBaseEntity_cl *const entity = m_enteredEntities.GetAt(i); ProcessEnter(entity); } m_enteredEntities.RemoveAll(); // Exited for(int i = 0; i < m_exitedEntities.GetSize(); ++i) { VisBaseEntity_cl *const entity = m_exitedEntities.GetAt(i); ProcessExit(entity); } m_exitedEntities.RemoveAll(); for(int index = 0; index < m_insideEntities.GetSize(); ++index) { VisBaseEntity_cl* entity = m_insideEntities.GetAt(index); ProcessInside(entity); } }
void ZmqWorker::Run() { while (!ProcessExit()) { _poller->poll(); if (_poller->events(*_taskQueue) & zmqpp::poller::poll_in) PerformWork(); } }
void ZmqMux::Run() { for (;;) { std::this_thread::sleep_for(std::chrono::milliseconds(50)); if (!_poller->poll()) break; if (ProcessExit()) break; Pipeline(_from, _to); } }
void ZmqListener::Run() { while (!ProcessExit()) { _poller->poll(); while (_poller->events(*_from) & zmqpp::poller::poll_in && _poller->events(*_to) & zmqpp::poller::poll_out) { zmqpp::message msg; _from->receive(msg); _to->send(msg); } } }
void WorldListener::Run() { while (!ProcessExit()) { _poller->poll(); if (_poller->events(*_worldSocket) & zmqpp::poller::poll_in) { int32 op1; do { zmqpp::message msg; _worldSocket->receive(msg); Dispatch(msg); _worldSocket->get(zmqpp::socket_option::events, op1); } while (op1 & zmqpp::poller::poll_in); } } }
void Process() { /* 游戏百世必须闪屏,因为没有触发,所以强制显示 */ if(iGameStatus == GameSplashScreen) { Show(); } /* 对用户按键做出相应的响应 */ if(GetAction()) { switch(iGameStatus) { case GameMainMenu: ProcessMenu(); break; case GameRunning: ProcessGame(); break; case GameWon: ProcessWon(); break; case GameLostLife: ProcessLostLife(); break; case GameLost: ProcessLost(); break; case GameExit: ProcessExit(); break; case GameSplashScreen: ProcessSplash(); break; default: break; }/* switch */ Show(); }/* if GetAction */ }
void sProcessExit (int num) { ProcessExit(num); }