Freeciv21
Develop your civilization from humble roots to a global empire
temperature_map.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors. This file is
3  part of Freeciv21. Freeciv21 is free software: you can
4  ^oo^ redistribute it and/or modify it under the terms of the GNU
5  (..) General Public License as published by the Free Software
6  () () Foundation, either version 3 of the License, or (at your
7  ()__() option) any later version. You should have received
8  a copy of the GNU General Public License along with Freeciv21. If not,
9  see https://www.gnu.org/licenses/.
10 **************************************************************************/
11 #pragma once
12 
13 // utility
14 #include "support.h" // bool type
15 
16 /*
17  * temperature_map[] stores the temperature of each tile
18  * values on tmap can get one of these 4 values
19  * there is 4 extra values as macros combining the 4 basics ones
20  */
21 typedef int temperature_type;
22 
23 #define TT_FROZEN 1
24 #define TT_COLD 2
25 #define TT_TEMPERATE 4
26 #define TT_TROPICAL 8
27 
28 #define TT_NFROZEN (TT_COLD | TT_TEMPERATE | TT_TROPICAL)
29 #define TT_ALL (TT_FROZEN | TT_NFROZEN)
30 #define TT_NHOT (TT_FROZEN | TT_COLD)
31 #define TT_HOT (TT_TEMPERATE | TT_TROPICAL)
32 
34 bool tmap_is(const struct tile *ptile, temperature_type tt);
35 bool is_temperature_type_near(const struct tile *ptile, temperature_type tt);
36 void destroy_tmap();
37 void create_tmap(bool real);
Definition: tile.h:42
int temperature_type
bool temperature_is_initialized()
Returns one line (given by the y coordinate) of the temperature map.
bool tmap_is(const struct tile *ptile, temperature_type tt)
Return true if the tile has tt temperature type.
void destroy_tmap()
Free the tmap.
bool is_temperature_type_near(const struct tile *ptile, temperature_type tt)
Return true if at least one tile has tt temperature type.
void create_tmap(bool real)
Initialize the temperature_map if arg is FALSE, create a dummy tmap == map_colatitude to be used if h...