Exemple #1
0
        public static unsafe void Map(Type vertexType, int index, VertexSpecialField specialField)
        {
            var typeData = VertexMarshalHelper.GetVertexTypeData(vertexType);
            var field    = typeData.GetField(specialField);

            MapPrivate(index, field, typeData.VertexSize);
        }
Exemple #2
0
 public VertexFieldData GetField(VertexSpecialField specialField)
 {
     if (TryGetField(specialField, out var field) == false)
     {
         ThrowSpecialFieldNotFound(specialField);
     }
     return(field);
 }
Exemple #3
0
 public bool TryGetField(VertexSpecialField specialField, [MaybeNullWhen(false)] out VertexFieldData field)
 {
     foreach (var f in _fields)
     {
         if (f.SpecialField == specialField)
         {
             field = f;
             return(true);
         }
     }
     field = null;
     return(false);
 }
Exemple #4
0
 private static void ThrowSpecialFieldNotFound(VertexSpecialField specialField) => throw new InvalidOperationException($"The special field is not found. (Special Field: {specialField})");
Exemple #5
0
 public static unsafe void Map <TVertex>(int index, VertexSpecialField specialField) where TVertex : unmanaged
 {
     Map(typeof(TVertex), index, specialField);
 }
Exemple #6
0
 public void Map(Type vertexType, int index, VertexSpecialField specialField)
 {
     if (vertexType is null)
     {
         ThrowNullArg();