Esempio n. 1
0
 public static ReferenceInformationType ToReferenceInformationType(this RawString str)
 {
     if (str.SequenceEqual(FbxConstStrings.Direct()))
     {
         return(ReferenceInformationType.Direct);
     }
     else if (str.SequenceEqual(FbxConstStrings.IndexToDirect()))
     {
         return(ReferenceInformationType.IndexToDirect);
     }
     else
     {
         throw new FormatException();
     }
 }
Esempio n. 2
0
        public static ModelType ToModelType(this RawString str)
        {
            ReadOnlySpan <byte> Null = stackalloc byte[4] {
                (byte)'N', (byte)'u', (byte)'l', (byte)'l'
            };
            ReadOnlySpan <byte> LimbNode = stackalloc byte[8] {
                (byte)'L', (byte)'i', (byte)'m', (byte)'b', (byte)'N', (byte)'o', (byte)'d', (byte)'e'
            };
            ReadOnlySpan <byte> Mesh = stackalloc byte[4] {
                (byte)'M', (byte)'e', (byte)'s', (byte)'h'
            };

            return(str.SequenceEqual(Null) ? ModelType.Null
                 : str.SequenceEqual(LimbNode) ? ModelType.LimbNode
                 : str.SequenceEqual(Mesh) ? ModelType.Mesh
                 : ModelType.Unknown);
        }
Esempio n. 3
0
 public static MappingInformationType ToMappingInformationType(this RawString str)
 {
     if (str.SequenceEqual(FbxConstStrings.ByVertice()))
     {
         return(MappingInformationType.ByVertice);
     }
     else if (str.SequenceEqual(FbxConstStrings.ByPolygonVertex()))
     {
         return(MappingInformationType.ByPolygonVertex);
     }
     else if (str.SequenceEqual(FbxConstStrings.ByPolygonVertex()))
     {
         return(MappingInformationType.ByControllPoint);
     }
     else
     {
         throw new FormatException();
     }
 }
Esempio n. 4
0
        public static ConnectionType ToConnectionType(this RawString str)
        {
            ReadOnlySpan <byte> OO = stackalloc byte[2] {
                (byte)'O', (byte)'O'
            };
            ReadOnlySpan <byte> OP = stackalloc byte[2] {
                (byte)'O', (byte)'P'
            };

            if (str.SequenceEqual(OO))
            {
                return(ConnectionType.OO);
            }
            else if (str.SequenceEqual(OP))
            {
                return(ConnectionType.OP);
            }
            else
            {
                return(Throw());
Esempio n. 5
0
 private static void AssertEqual(RawString str1, RawString str2)
 {
     Assert.True(str1.SequenceEqual(str2));
     Assert.True(str1.AsSpan().SequenceEqual(str2.AsSpan()));
 }