本文整理汇总了C++中Hashtable::getSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Hashtable::getSize方法的具体用法?C++ Hashtable::getSize怎么用?C++ Hashtable::getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hashtable
的用法示例。
在下文中一共展示了Hashtable::getSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: opCreateRoomImplementation
OperationRequestParameters Peer::opCreateRoomImplementation(const JString& gameID, bool isVisible, bool isOpen, nByte maxPlayers, const Hashtable& customRoomProperties, const Hashtable& customLocalPlayerProperties, const JVector<JString>& propsListedInLobby)
{
OperationRequestParameters op;
if(gameID.length())
op.put(ParameterCode::ROOM_NAME, ValueObject<JString>(gameID));
Hashtable roomProps(Utils::stripToCustomProperties(customRoomProperties));
if(!isOpen)
roomProps.put(Properties::Room::IS_OPEN, isOpen);
if(!isVisible)
roomProps.put(Properties::Room::IS_VISIBLE, isVisible);
if(maxPlayers)
roomProps.put(Properties::Room::MAX_PLAYERS, maxPlayers);
JString* propsListedInLobbyArr = allocateArray<JString>(propsListedInLobby.getSize());
for(unsigned int i=0; i<propsListedInLobby.getSize(); ++i)
propsListedInLobbyArr[i] = propsListedInLobby[i];
roomProps.put(Properties::Room::PROPS_LISTED_IN_LOBBY, propsListedInLobbyArr, propsListedInLobby.getSize());
deallocateArray(propsListedInLobbyArr);
op.put(ParameterCode::ROOM_PROPERTIES, ValueObject<Hashtable>(roomProps));
Hashtable playerProperties = Utils::stripToCustomProperties(customLocalPlayerProperties);
if(playerProperties.getSize())
op.put(ParameterCode::PLAYER_PROPERTIES, ValueObject<Hashtable>(playerProperties));
op.put(ParameterCode::BROADCAST, ValueObject<bool>(true));
op.put(ParameterCode::CLEANUP_CACHE_ON_LEAVE, ValueObject<bool>(true));
return op;
}
示例2: opJoinRoomImplementation
OperationRequestParameters Peer::opJoinRoomImplementation(const JString& gameID, const Hashtable& customLocalPlayerProperties)
{
OperationRequestParameters op;
op.put(ParameterCode::ROOM_NAME, ValueObject<JString>(gameID));
Hashtable playerProps = Utils::stripToCustomProperties(customLocalPlayerProperties);
if(playerProps.getSize())
op.put(ParameterCode::PLAYER_PROPERTIES, ValueObject<Hashtable>(playerProps));
op.put(ParameterCode::BROADCAST, ValueObject<bool>(true));
return op;
}
示例3: mergeCustomProperties
void MutablePlayer::mergeCustomProperties(const Hashtable& customProperties)
{
Hashtable stripDict = Utils::stripToCustomProperties(customProperties);
if(!stripDict.getSize())
return;
Hashtable oldDict = mCustomProperties;
mCustomProperties.put(stripDict);
mCustomProperties = Utils::stripKeysWithNullValues(mCustomProperties);
if(mCustomProperties != oldDict)
mLoadBalancingClient->opSetPropertiesOfPlayer(mNumber, stripDict);
}
示例4: mergeCustomProperties
void MutableRoom::mergeCustomProperties(const Hashtable& customProperties)
{
Hashtable stripDict = Peer::stripToCustomProperties(customProperties);
if(!stripDict.getSize())
return;
Hashtable oldDict = mCustomProperties;
mCustomProperties.put(stripDict);
mCustomProperties = Peer::stripKeysWithNullValues(mCustomProperties);
if(mCustomProperties != oldDict)
mLoadBalancingPeer->opSetPropertiesOfRoom(stripDict);
}