Example #1
0
void Cave::ConstructRooms( int caveRoom )
{
	rooms.clear();
	rooms.resize(caveRoom);

	int n = 1;
	for (auto it = rooms.begin(); it != rooms.end(); it++, ++n)
	{
		it->RoomID(n);
	}

	srand((unsigned int)time(nullptr));
	for (auto it = rooms.begin(); it != rooms.end(); it++)
	{
		while(it->ConnectTo(rooms[rand() % caveRoom]) != Room::full)
		{
			;
		}
	}
}
Example #2
0
/**
 * called back when we get a stop watching result from server
 */
void
RoomManager::OnStopWatchingForRoomsResult(RoomQualifier roomIDQualifier, UPCStatus status) {
	NXRoomInfo::NotifyListeners( Event::STOP_WATCHING_FOR_ROOMS_RESULT, roomIDQualifier, RoomID(), RoomRef(), status);
};