modified stdlib vector a bit, added matrix, removed ChrisTest

This commit is contained in:
Chris Fadden
2015-05-16 00:03:36 -04:00
parent 795f8715ff
commit d166dc9b5f
14 changed files with 562 additions and 440 deletions

View File

@@ -13,6 +13,14 @@ typedef vector<T> (Destructable) {
data = new<T>(8);
return this;
}
fun construct(newSize: int): vector<T>*{
size = newSize;
available = newSize;
data = new<T>(newSize);
return this;
}
fun destruct(): void {
delete<T>(data);
@@ -39,6 +47,8 @@ typedef vector<T> (Destructable) {
println("Vector access out of bounds! Retuning 0th element as sanest option");
print("Vector tried to access element: ");
println(index);
print("Max Index of vector: ");
println(size-1);
return data[0];
}
return data[index];