diff options
Diffstat (limited to 'height-map-display/src/map/node.c')
-rw-r--r-- | height-map-display/src/map/node.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/height-map-display/src/map/node.c b/height-map-display/src/map/node.c new file mode 100644 index 0000000..eaf2877 --- /dev/null +++ b/height-map-display/src/map/node.c @@ -0,0 +1,20 @@ +#include "node.h" + +#include <stdio.h> +#include <stdlib.h> +#include <malloc.h> + +Node* create_node(int x, int y, float elevation) { + Node* node = (Node*)malloc(sizeof(Node)); + if (node != NULL) { + node->x = x; + node->y = y; + node->elevation = elevation; + } + return node; +} + +void change_node_height(Node* node, float diff) { + if (node != NULL) { node->elevation = node->elevation + diff; } +} + |