summaryrefslogtreecommitdiff
path: root/vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'vector.h')
-rw-r--r--vector.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/vector.h b/vector.h
new file mode 100644
index 0000000..b4558a1
--- /dev/null
+++ b/vector.h
@@ -0,0 +1,30 @@
+#ifndef VECTOR
+#define VECTOR
+typedef struct Vector {
+ int mx;
+ int my;
+} vector_t;
+
+vector_t init_vector(int mx, int my);
+bool vector_equals(vector_t v1, vector_t v2);
+vector_t vector_add(vector_t v1, vector_t v2);
+vector_t vector_sub(vector_t v1, vector_t v2);
+
+typedef struct VectorP {
+ vector_t* vectors;
+ int length;
+} vectorp_t;
+
+vectorp_t init_vectorp(vector_t* vectors, int length);
+
+/* removes a vector from vectorp */
+vectorp_t remove_vector(vectorp_t vectorp, int index);
+vectorp_t remove_vectors(vectorp_t vectorp, int* indexes, int indexCount);
+typedef struct VectorPP {
+ vectorp_t* vectorps;
+ int length;
+} vectorpp_t;
+
+vectorpp_t init_vectorpp(vectorp_t* vectorps, int length);
+
+#endif