forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapgen_functions.h
90 lines (78 loc) · 3.46 KB
/
mapgen_functions.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#pragma once
#ifndef CATA_SRC_MAPGEN_FUNCTIONS_H
#define CATA_SRC_MAPGEN_FUNCTIONS_H
#include <functional>
#include <iosfwd>
#include <map>
#include <utility>
#include "coordinates.h"
#include "mapdata.h"
#include "type_id.h"
class map;
class mapgendata;
class mission;
struct mapgen_parameters;
struct point;
struct tripoint;
using mapgen_update_func = std::function<void( const tripoint_abs_omt &map_pos3, mission *miss )>;
class JsonObject;
/**
* Calculates the coordinates of a rotated point.
* Should match the `mapgen_*` rotation.
*/
tripoint rotate_point( const tripoint &p, int rotations );
int terrain_type_to_nesw_array( oter_id terrain_type, bool array[4] );
using building_gen_pointer = void ( * )( mapgendata & );
building_gen_pointer get_mapgen_cfunction( const std::string &ident );
ter_id grass_or_dirt();
ter_id clay_or_sand();
// helper functions for mapgen.cpp, so that we can avoid having a massive switch statement (sorta)
void mapgen_null( mapgendata &dat );
void mapgen_crater( mapgendata &dat );
void mapgen_field( mapgendata &dat );
void mapgen_forest( mapgendata &dat );
void mapgen_forest_trail_straight( mapgendata &dat );
void mapgen_forest_trail_curved( mapgendata &dat );
void mapgen_forest_trail_tee( mapgendata &dat );
void mapgen_forest_trail_four_way( mapgendata &dat );
void mapgen_hive( mapgendata &dat );
void mapgen_river_center( mapgendata &dat );
void mapgen_road( mapgendata &dat );
//void mapgen_bridge( mapgendata &dat );
void mapgen_railroad( mapgendata &dat );
void mapgen_railroad_bridge( mapgendata &dat );
void mapgen_highway( mapgendata &dat );
void mapgen_river_curved_not( mapgendata &dat );
void mapgen_river_straight( mapgendata &dat );
void mapgen_river_curved( mapgendata &dat );
void mapgen_cave( mapgendata &dat );
void mapgen_cave_rat( mapgendata &dat );
void mapgen_rock( mapgendata &dat );
void mapgen_rock_partial( mapgendata &dat );
void mapgen_open_air( mapgendata &dat );
void mapgen_rift( mapgendata &dat );
void mapgen_hellmouth( mapgendata &dat );
void mapgen_subway( mapgendata &dat );
void mapgen_sewer_curved( mapgendata &dat );
void mapgen_sewer_four_way( mapgendata &dat );
void mapgen_sewer_straight( mapgendata &dat );
void mapgen_sewer_tee( mapgendata &dat );
void mapgen_lake_shore( mapgendata &dat );
void mapgen_ravine_edge( mapgendata &dat );
// Temporary wrappers
void mremove_trap( map *m, const point &, trap_id type );
void mtrap_set( map *m, const point &, trap_id type, bool avoid_creatures = false );
void madd_field( map *m, const point &, field_type_id type, int intensity );
void mremove_fields( map *m, const point & );
mapgen_update_func add_mapgen_update_func( const JsonObject &jo, bool &defer );
bool run_mapgen_update_func( const update_mapgen_id &, const tripoint_abs_omt &omt_pos,
mission *miss = nullptr, bool cancel_on_collision = true,
bool mirror_horizontal = false, bool mirror_vertical = false, int rotation = 0 );
bool run_mapgen_update_func( const update_mapgen_id &, mapgendata &dat,
bool cancel_on_collision = true );
bool run_mapgen_func( const std::string &mapgen_id, mapgendata &dat );
std::pair<std::map<ter_id, int>, std::map<furn_id, int>> get_changed_ids_from_update(
const update_mapgen_id &, ter_id const &base_ter = t_dirt );
mapgen_parameters get_map_special_params( const std::string &mapgen_id );
void resolve_regional_terrain_and_furniture( const mapgendata &dat );
#endif // CATA_SRC_MAPGEN_FUNCTIONS_H