Пример #1
0
 public bool TryGetValue(string name, out MeshEntry entry)
 {
     entry = default;
     if (library.TryGetValue(name, out MeshEntry? result) &&
         result.HasValue)
     {
         entry = result.Value;
     }
     return(entry.IsNull);
 }
Пример #2
0
 public bool Remove(MeshEntry entry)
 {
     if (TryGetValue(entry.Name, out MeshEntry result) &&
         entry.Mesh.Equals(result.Mesh))
     {
         library.Remove(entry.Name);
         return(true);
     }
     return(false);
 }
Пример #3
0
 public void Add(MeshEntry entry, bool replace = false)
 {
     if (entry.IsNull)
     {
         throw new ArgumentNullException(nameof(entry));
     }
     if (replace || !library.ContainsKey(entry.Name))
     {
         library.Add(entry.Name, entry);
     }
 }
Пример #4
0
 void ICollection <MeshEntry> .Add(MeshEntry entry)
 {
     Add(entry, false);
 }
Пример #5
0
 public bool Contains(MeshEntry entry)
 {
     return(Contains(entry.Name));
 }