-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.h
41 lines (32 loc) · 758 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
36
37
38
39
40
41
#ifndef MAP_H_INCLUDED
#define MAP_H_INCLUDED
#include "loc.h"
#include "perlin.h"
#include <stdio.h>
typedef struct Map Map;
typedef double (*MapShape) (Map * map, Loc where);
struct Map
{
double soft_size;
MapShape shape;
Perlin perlin;
};
typedef enum Terrain
{
DEEP_SEA,
WATER,
BEACH,
GRASS,
WOODS,
HILLS,
MOUNTAINS
} Terrain;
Map make_map (double soft_size, MapShape shape, Perlin perlin);
Terrain get_map_terrain (Map * map, Loc where);
int get_terrain_speed_penalty (Terrain terrain);
Loc find_passable_place (Map * map, Loc origin);
void write_map (Map * map, FILE * stream);
Map read_map (FILE * stream);
char *get_shape_name (MapShape shape);
MapShape get_shape_from_name (char *shape_name);
#endif