27 lines
625 B
C
27 lines
625 B
C
#include "kubo_wall.h"
|
|
|
|
struct kubo_wall *kubo_wall_init() {
|
|
struct kubo_wall *wall = malloc(sizeof(struct kubo_wall));
|
|
|
|
if (!wall)
|
|
return NULL;
|
|
|
|
wall->state = KUBO_WALL_INIT;
|
|
|
|
kubo_vector2_arr_init(&wall->vertices);
|
|
|
|
return wall;
|
|
}
|
|
|
|
void kubo_wall_cleanup(struct kubo_wall *wall) {
|
|
kubo_vector2_arr_free(&wall->vertices);
|
|
free(wall);
|
|
}
|
|
|
|
bool kubo_wall_add_vertex(struct kubo_wall *wall, Vector2 vec) {
|
|
return kubo_vector2_arr_add(&wall->vertices, vec);
|
|
}
|
|
|
|
Vector2 kubo_wall_get_vertex(struct kubo_wall *wall, size_t index) {
|
|
return kubo_vector2_arr_get(&wall->vertices, index);
|
|
}
|