-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.h
35 lines (27 loc) · 750 Bytes
/
map.h
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
33
34
35
#include "position.h"
#include <stddef.h>
#include <stdbool.h>
#ifndef MAP_H
#define MAP_H
typedef struct Map Map;
// Map utility functions.
Map *initialiseMap(size_t, size_t,
void (*mapGenerationFunction)(Map *));
void deallocateMap(Map *map);
size_t getRowSize(Map *);
size_t getColumnSize(Map *);
int isMapPositionValid(Map *, Position);
void setMapPositionValue(Map *, Position, bool);
int isMapPositionEmpty(Map *, Position);
size_t countMapEmptySpace(Map *);
Position getEmptyRandomPosition(Map *);
/*
Map generation functions.
Shared function signature:
- Return type: void
- Parameters: 1
- Parameter types: Map *
*/
void generateEmptyMap(Map *);
void generateEatenMap(Map *);
#endif