示例#1
0
        ///<inheritdoc/>
        public bool TryGet <TComponent>(string typeName, out IComponentBuffer <TComponent> buffer) where TComponent : struct, IEquatable <TComponent>
        {
            bool ret = _registry.TryGet(typeName, out IComponentBuffer temp);

            buffer = temp as IComponentBuffer <TComponent>;
            return(ret);
        }
示例#2
0
 ///<inheritdoc/>
 public int Register(IComponentBuffer buffer)
 {
     if (buffer == null)
     {
         throw new ArgumentNullException(nameof(buffer));
     }
     return(_registry.Add(buffer.TypeName, buffer));
 }
示例#3
0
 ///<inheritdoc/>
 public int GetID(IComponentBuffer buffer)
 {
     if (buffer == null)
     {
         throw new ArgumentNullException(nameof(buffer));
     }
     return(_registry.GetIDFromName(buffer.TypeName));
 }
示例#4
0
 ///<inheritdoc/>
 public void Remove(IComponentBuffer buffer)
 {
     if (buffer == null)
     {
         throw new ArgumentNullException(nameof(buffer));
     }
     _registry.RemoveAt(buffer.TypeName);
 }
示例#5
0
 ///<inheritdoc/>
 public string GetName(IComponentBuffer buffer)
 {
     return(_registry.GetName(buffer));
 }