blob: 132b43ccb2f7fcf389773cb186d15cc8ece93610 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#ifndef SQUARE_H
#define SQUARE_H
#include <stdbool.h>
#include "node.h" // Include node.h to use Node type.
// Define the Terrain_Type enum
typedef enum {
TERRAIN_FAIRWAY,
TERRAIN_ROUGH,
TERRAIN_GREEN,
} Terrain_Type;
// Define the Square struct
typedef struct Square {
Terrain_Type terrain;
Node *node_tl;
Node *node_tr;
Node *node_bl;
Node *node_br;
bool selected;
} Square;
// Function prototypes
Square* init_square(Node *tl, Node *tr, Node *bl, Node *br, Terrain_Type terrain, bool selected);
void change_square_height(Square* square, float diff);
void change_square_terrain(Square* square, Terrain_Type terrain);
Square* find_selected_square(Square*** squares, int x, int y);
#endif
|