public Matrix(NumberType type, int rows, int columns) { Type = type; Rows = rows; Columns = columns; Elements = Element.Elements(rows, columns); }
public bool IsImplicitlyConvertibleTo(NumberType to) { if (this == to) return true; if (this == Byte) return to == UShort || to == Short || to == UInt || to == Int || to == ULong || to == Long || to == Float || to == Double; if (this == SByte) return to == Short || to == Int || to == Long || to == Float || to == Double; if (this == UShort) return to == UInt || to == Int || to == ULong || to == Long | to == Float || to == Double; if (this == Short) return to == Int || to == Long || to == Float || to == Double; if (this == UInt) return to == ULong || to == Long || to == Float || to == Double; if (this == Int) return to == Long || to == Float || to == Double; if (this == ULong) return to == Float || to == Double; if (this == Long) return to == Float || to == Double; if (this == Half) return to == Float || to == Double; if (this == Float) return to == Double; return false; }
public Color(NumberType type) { Type = type; Components = new Component[] { new Component("R", 0), new Component("G", 1), new Component("B", 2), new Component("A", 3) }; }
private NumberType(string name, string clrName, string suffix, int size, bool clsCompliant, bool unsigned, bool real, NumberType realType = null, NumberType negativeType = null, NumberType positiveType = null) { Name = name; CLRName = clrName; Suffix = suffix; Size = size; IsCLSCompliant = clsCompliant; IsUnsigned = unsigned; IsReal = real; RealType = realType ?? this; NegativeType = negativeType ?? this; PositiveType = positiveType ?? this; }
public Line(NumberType type, int dimension) { Type = type; Dimension = dimension; }
public Plane(NumberType type) { Type = type; }
public Sphere(NumberType type) { Type = type; }
public bool IsImplicitlyConvertibleTo(NumberType to) { if (this == to) { return(true); } if (this == Byte) { return (to == UShort || to == Short || to == UInt || to == Int || to == ULong || to == Long || to == Float || to == Double); } if (this == SByte) { return (to == Short || to == Int || to == Long || to == Float || to == Double); } if (this == UShort) { return (to == UInt || to == Int || to == ULong || to == Long | to == Float || to == Double); } if (this == Short) { return (to == Int || to == Long || to == Float || to == Double); } if (this == UInt) { return (to == ULong || to == Long || to == Float || to == Double); } if (this == Int) { return (to == Long || to == Float || to == Double); } if (this == ULong) { return (to == Float || to == Double); } if (this == Long) { return (to == Float || to == Double); } if (this == Half) { return (to == Float || to == Double); } if (this == Float) { return (to == Double); } return(false); }
public Polygon(NumberType type, int dimension) { Type = type; Dimension = dimension; }
public Ellipse(NumberType type) { Type = type; }
public Quaternion(NumberType type) { Type = type; Components = Component.Components(4, false); }
public Vector(NumberType type, int dimension) { Type = type; Dimension = dimension; Components = Component.Components(Dimension); }
public Box(NumberType type) { Type = type; }
public Size(NumberType type, int dimension) { Type = type; Dimension = dimension; Components = Shapes.SizeComponents(Dimension); }
public Rectangle(NumberType type) { Type = type; }
public Ray(NumberType type) { Type = type; }
public Circle(NumberType type) { Type = type; }