public CustomDataRange(long start, long count, bool autoEnd, long end, TypeOfValues typeOfValues, string name = "") { Name = name; Start = start; Count = count; AutoEnd = autoEnd; End = end; Type = typeOfValues; }
public override TypeConversion CanConvert(Identifier To) { if (TypeOfValues.CanConvert(To) != TypeConversion.Nonconvertable) { return(TypeConversion.Convertable); } return(base.CanConvert(To)); }
public Shader(TypeOfValues type = TypeOfValues.Double, Endianness endianness = Endianness.Little, string name = "") { Length = 0; Name = name; this.endianness = endianness; switch (type) { case TypeOfValues.Double: valuesD = new List<double>(); typeOfValues = TypeOfValues.Double; break; case TypeOfValues.Float: valuesF = new List<float>(); typeOfValues = TypeOfValues.Float; break; case TypeOfValues.Byte: valuesB = new List<byte>(); typeOfValues = TypeOfValues.Byte; break; case TypeOfValues.Int16: valuesI16 = new List<short>(); typeOfValues = TypeOfValues.Int16; break; case TypeOfValues.Int32: valuesI32 = new List<int>(); typeOfValues = TypeOfValues.Int32; break; case TypeOfValues.Int64: valuesI64 = new List<long>(); typeOfValues = TypeOfValues.Int64; break; case TypeOfValues.UInt16: valuesUI16 = new List<ushort>(); typeOfValues = TypeOfValues.UInt16; break; case TypeOfValues.UInt32: valuesUI32 = new List<uint>(); typeOfValues = TypeOfValues.UInt32; break; case TypeOfValues.UInt64: valuesUI64 = new List<ulong>(); typeOfValues = TypeOfValues.UInt64; break; } }
public static int SizeOf(TypeOfValues type) { switch (type) { case TypeOfValues.Double: case TypeOfValues.Int64: case TypeOfValues.UInt64: return 8; case TypeOfValues.Float: case TypeOfValues.Int32: case TypeOfValues.UInt32: return 4; case TypeOfValues.Int16: case TypeOfValues.UInt16: return 2; case TypeOfValues.Byte: return 1; default: throw new ArgumentOutOfRangeException(); } }