project_files/frontlib/model/map.h
changeset 7275 15f722e0b96f
parent 7271 5608ac657362
child 7314 6171f0bad318
equal deleted inserted replaced
7273:8eed495fd8da 7275:15f722e0b96f
     1 /**
       
     2  * Data structure for defining a map. This contains the whole recipe to
       
     3  * exactly recreate a particular map. For named maps, you also need the
       
     4  * corresponding files.
       
     5  *
       
     6  * The required fields depend on the map generator, see the comments
       
     7  * at the struct for details.
       
     8  */
       
     9 
       
    10 #ifndef MODEL_MAP_H_
     1 #ifndef MODEL_MAP_H_
    11 #define MODEL_MAP_H_
     2 #define MODEL_MAP_H_
    12 
     3 
    13 #include <stdint.h>
     4 #include <stdint.h>
    14 #include <stdbool.h>
     5 #include <stdbool.h>
    30 #define MAZE_SIZE_LARGE_TUNNELS 2
    21 #define MAZE_SIZE_LARGE_TUNNELS 2
    31 #define MAZE_SIZE_SMALL_ISLANDS 3
    22 #define MAZE_SIZE_SMALL_ISLANDS 3
    32 #define MAZE_SIZE_MEDIUM_ISLANDS 4
    23 #define MAZE_SIZE_MEDIUM_ISLANDS 4
    33 #define MAZE_SIZE_LARGE_ISLANDS 5
    24 #define MAZE_SIZE_LARGE_ISLANDS 5
    34 
    25 
       
    26 /**
       
    27  * Data structure for defining a map. This contains the whole recipe to
       
    28  * exactly recreate a particular map. For named maps, you also need the
       
    29  * corresponding files.
       
    30  *
       
    31  * The required fields depend on the map generator, see the comments
       
    32  * at the struct for details.
       
    33  */
    35 typedef struct {
    34 typedef struct {
    36 	int _referenceCount;
    35 	int _referenceCount;
    37 	int mapgen;				// Always one of the MAPGEN_ constants
    36 	int mapgen;				// Always one of the MAPGEN_ constants
    38 	char *name;				// The name of the map for MAPGEN_NAMED, otherwise one of "+rnd+", "+maze+" or "+drawn+".
    37 	char *name;				// The name of the map for MAPGEN_NAMED, otherwise one of "+rnd+", "+maze+" or "+drawn+".
    39 	char *seed;				// Used for all maps
    38 	char *seed;				// Used for all maps
    40 	char *theme;			// Used for all except MAPGEN_NAMED
    39 	char *theme;			// Used for all maps
    41 	uint8_t *drawData;		// Used for MAPGEN_DRAWN
    40 	uint8_t *drawData;		// Used for MAPGEN_DRAWN
    42 	int drawDataSize;		// Used for MAPGEN_DRAWN
    41 	int drawDataSize;		// Used for MAPGEN_DRAWN
    43 	int templateFilter;		// Used for MAPGEN_REGULAR
    42 	int templateFilter;		// Used for MAPGEN_REGULAR
    44 	int mazeSize;			// Used for MAPGEN_MAZE
    43 	int mazeSize;			// Used for MAPGEN_MAZE
    45 } flib_map;
    44 } flib_map;