コード例 #1
0
ファイル: Record+Fields.cs プロジェクト: libcs/game-estates
        public static INTVField ReadINTV(this BinaryFileReader r, int length)
        {
            switch (length)
            {
            case 1: return(new INTVField {
                    Value = r.ReadByte()
                });

            case 2: return(new INTVField {
                    Value = r.ReadInt16()
                });

            case 4: return(new INTVField {
                    Value = r.ReadInt32()
                });

            case 8: return(new INTVField {
                    Value = r.ReadInt64()
                });

            default: throw new NotImplementedException($"Tried to read an INTV subrecord with an unsupported size ({length})");
            }
        }