Пример #1
0
 // Add the passed MaterialInfo the to list if it is not already in the list
 public void AddUniqueImageInfo(ImageInfo imgInfo)
 {
     lock (Images) {
         ImageInfo existingImageInfo = null;
         if (!Images.TryGetValue(imgInfo.GetBHash(), out existingImageInfo))
         {
             // If not already in the list, add this MeshInfo
             Images.Add(imgInfo.GetBHash(), imgInfo.handle, imgInfo);
         }
     }
 }
Пример #2
0
 // Add the passed MeshInfo the to list if it is not already in the list
 public void AddUniqueMeshInfo(MeshInfo meshInfo)
 {
     lock (Meshes) {
         MeshInfo existingMeshInfo = null;
         if (!Meshes.TryGetValue(meshInfo.GetBHash(), out existingMeshInfo))
         {
             // If not already in the list, add this MeshInfo
             Meshes.Add(meshInfo.GetBHash(), meshInfo.handle, meshInfo);
         }
     }
 }
Пример #3
0
 // Add the passed MaterialInfo the to list if it is not already in the list
 public void AddUniqueMatInfo(MaterialInfo matInfo)
 {
     lock (Materials) {
         MaterialInfo existingMatInfo = null;
         if (!Materials.TryGetValue(matInfo.GetBHash(), out existingMatInfo))
         {
             // If not already in the list, add this MeshInfo
             Materials.Add(matInfo.GetBHash(), matInfo.handle, matInfo);
         }
     }
 }
Пример #4
0
 private bool TrackEntity(IEntity ent)
 {
     try {
         lock (this) {
             if (m_entityDictionary.ContainsKey(ent.Name.Name))
             {
                 m_log.Log(LogLevel.DWORLD, "Asked to add same entity again: " + ent.Name);
             }
             else
             {
                 m_entityDictionary.Add(ent.Name.Name, ent.LGID, ent);
                 return(true);
             }
         }
     }
     catch {
         // sometimes they send me the same entry twice
         m_log.Log(LogLevel.DWORLD, "Asked to add same entity again: " + ent.Name);
     }
     return(false);
 }