Code cleanup.
This commit is contained in:
@@ -367,11 +367,11 @@ namespace Cryville.Crtr {
|
||||
static readonly Type[] stringTypeArray = new Type[] { typeof(string) };
|
||||
static readonly Type[] floatArrayTypeArray = new Type[] { typeof(float[]) };
|
||||
public static Vector Construct(Type type, string s) {
|
||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException(); // TODO
|
||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException("Type is not vector");
|
||||
return (Vector)type.GetConstructor(stringTypeArray).Invoke(new object[] { s });
|
||||
}
|
||||
public static Vector Construct(Type type, float[] values) {
|
||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException(); // TODO
|
||||
if (!typeof(Vector).IsAssignableFrom(type)) throw new ArgumentException("Type is not vector");
|
||||
return (Vector)type.GetConstructor(floatArrayTypeArray).Invoke(new object[] { values });
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user