Exemple #1
0
AvatarSharedPointer AvatarHashMap::matchingOrNewAvatar(const QUuid& sessionUUID, const QWeakPointer<Node>& mixerWeakPointer) {
    AvatarSharedPointer matchingAvatar = _avatarHash.value(sessionUUID);
    
    if (!matchingAvatar) {
        // insert the new avatar into our hash
        matchingAvatar = newSharedAvatar();
    
        qDebug() << "Adding avatar with sessionUUID " << sessionUUID << "to AvatarHashMap.";
        
        matchingAvatar->setSessionUUID(sessionUUID);
        matchingAvatar->setOwningAvatarMixer(mixerWeakPointer);
        
        _avatarHash.insert(sessionUUID, matchingAvatar);
    }
    
    return matchingAvatar;
}
Exemple #2
0
void AvatarHashMap::insert(const QUuid& sessionUUID, AvatarSharedPointer avatar) {
    _avatarHash.insert(sessionUUID, avatar);
    avatar->setSessionUUID(sessionUUID);
}