void CUiAnimation::Free() { if(getSingletonPtr()) { delete getSingletonPtr(); } }
void PlayerRegistry::RemovePlayer(PlayerID id) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); registry->removePlayer(id); }
void PlayerRegistry::AddRemotePlayer(PlayerID id, const RakNetGUID& guid) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); registry->addPlayer(id, s_MaxLocalPlayers, guid); }
void PlayerRegistry::RemovePlayersFrom(const RakNetGUID& guid) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); registry->removePlayersFrom(guid); }
PlayerRegistry::const_local_player_iterator PlayerRegistry::LocalPlayersEnd() { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); return const_local_player_iterator(registry->m_ByLocalIndex.end()); }
bool PlayerRegistry::IsLocal(PlayerID net_index) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); return registry->getPlayerByNetID(net_index).LocalIndex < s_MaxLocalPlayers; }
PlayerRegistry::const_player_iterator PlayerRegistry::PlayersBegin() { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); return const_player_iterator(registry->m_ByNetID.begin()); }
const PlayerInfo &PlayerRegistry::GetPlayerByLocalIndex(unsigned int index) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); return registry->getPlayerByLocalIndex(index); }
std::vector<PlayerInfo> PlayerRegistry::GetPlayersBySystem(const RakNetGUID& guid) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); return registry->getPlayersBySystem(guid); }
const PlayerInfo &PlayerRegistry::GetPlayer(PlayerID id) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); return registry->getPlayerByNetID(id); }
unsigned int PlayerRegistry::GetLocalPlayerCount() { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); return registry->getLocalPlayerCount(); }
void PlayerRegistry::Clear() { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); registry->clear(); }
void PlayerRegistry::RemoveLocalPlayer(unsigned int local_index) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); registry->removeLocalPlayer(local_index); }
boost::signals2::connection PlayerRegistry::ConnectToPlayerRemoved(RegistryChangedSigType::slot_type slot) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); return registry->SignalPlayerRemoved.connect(slot); }
void PlayerRegistry::AddLocalPlayer(PlayerID id, unsigned int local_index) { PlayerRegistry *registry = getSingletonPtr(); FSN_ASSERT_MSG(registry != NULL, "Tried to use un-initialised PlayerRegistry"); registry->addPlayer(id, local_index, UNASSIGNED_RAKNET_GUID); }
HRESULT CUiAnimation::Init() { SASSERT(!getSingletonPtr()); // Create Animation Timer SComPtr<IUIAnimationTimer> pAnimationTimer; HRESULT hr = CoCreateInstance( __uuidof(UIAnimationTimer), NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pAnimationTimer) ); if (SUCCEEDED(hr)) { //创建一个UIAnimation的单例 new CUiAnimation(pAnimationTimer); } return hr; }
static SFCTypesManager &getSingleton( void ) { assert( getSingletonPtr() != 0 ); return *getSingletonPtr(); }
static void initSingleton( SFC::CompoundStatement compoundStatement ) { if ( getSingletonPtr() != 0 ) delete getSingletonPtr(); getSingletonPtr() = new SFCTypesManager( compoundStatement ); }
//----------------------------------------------------------------------- XmlSerializeManager& XmlSerializeManager::getSingleton(void) { return (*getSingletonPtr()); }
DataPoolManager& DataPoolManager::getSingleton(void) { return (*getSingletonPtr()); }
OPAL_SOUND_MGR void SoundManager::selfDestruct( void ) { if ( getSingletonPtr() ) delete getSingletonPtr(); }
static bool isInit() { return getSingletonPtr() != 0; }
GameManager& GameManager::getSingleton() { return *getSingletonPtr(); }