1 /*
2  * Copyright (C) 2002-2020 by the Widelands Development Team
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  *
18  */
19 
20 #ifndef WL_LOGIC_NODECAPS_H
21 #define WL_LOGIC_NODECAPS_H
22 
23 namespace Widelands {
24 
25 enum NodeCaps {
26 	CAPS_NONE = 0,
27 	/** can we build normal buildings? (use BUILDCAPS_SIZEMASK for binary
28     * masking)*/
29 	BUILDCAPS_SMALL = 1,
30 	BUILDCAPS_MEDIUM = 2,
31 	BUILDCAPS_BIG = 3,
32 	BUILDCAPS_SIZEMASK = 3,
33 
34 	/** can we build a flag on this field?*/
35 	BUILDCAPS_FLAG = 4,
36 
37 	/** can we build a mine on this field (completely independent from build
38     * size!)*/
39 	BUILDCAPS_MINE = 8,
40 
41 	/** (only if BUILDCAPS_BIG): can we build a port on this field? This gets set
42     * for BUILDCAPS_BIG fields that have a Map::is_port_space() as well as a
43     * swimmable second-order neighbour
44     */
45 	BUILDCAPS_PORT = 16,
46 
47 	/** can we build any building on this field?*/
48 	BUILDCAPS_BUILDINGMASK = BUILDCAPS_SIZEMASK | BUILDCAPS_MINE | BUILDCAPS_PORT,
49 
50 	/// Can MapObjects walk or swim here? Also used for
51 	/// MapObjectDescr::movecaps. If MOVECAPS_WALK, any walking being can walk
52 	/// to this field.
53 	MOVECAPS_WALK = 32,
54 
55 	/// If MOVECAPS_SWIM, any swimming being (including ships) can go there.
56 	/// Additionally, swimming beings can temporarily visit nodes that are
57 	/// walkable but not swimmable if those nodes are at the start or end of
58 	/// their path. Without this clause, ports would be kind of impossible ;)
59 	/// This clause stops ducks from "swimwalking" along the coast.
60 	MOVECAPS_SWIM = 64,
61 };
62 }
63 
64 #endif  // end of include guard: WL_LOGIC_NODECAPS_H
65