src/road_type.h
author Tero Marttila <terom@fixme.fi>
Fri, 19 Dec 2008 02:20:26 +0200
changeset 10441 d09735696a9e
parent 10011 eeec680fed23
permissions -rw-r--r--
don't generate a heightmap for <64 tile maps
8102
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     1
/* $Id$ */
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     2
8348
4d7c1c5055b3 (svn r11914) -Documentation: fix some @file statement
glx
parents: 8236
diff changeset
     3
/** @file road_type.h Enums and other types related to roads. */
8102
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     4
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     5
#ifndef ROAD_TYPE_H
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     6
#define ROAD_TYPE_H
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     7
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     8
#include "core/enum_type.hpp"
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
     9
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    10
/**
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    11
 * The different roadtypes we support
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    12
 *
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    13
 * @note currently only ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    14
 */
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    15
enum RoadType {
10011
eeec680fed23 (svn r14170) -Codechange: Missing enum for road type iteration.
peter1138
parents: 8348
diff changeset
    16
	ROADTYPE_BEGIN = 0,     ///< Used for iterations
8102
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    17
	ROADTYPE_ROAD = 0,      ///< Basic road type
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    18
	ROADTYPE_TRAM = 1,      ///< Trams
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    19
	ROADTYPE_HWAY = 2,      ///< Only a placeholder. Not sure what we are going to do with this road type.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    20
	ROADTYPE_END,           ///< Used for iterations
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    21
	INVALID_ROADTYPE = 0xFF ///< flag for invalid roadtype
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    22
};
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    23
DECLARE_POSTFIX_INCREMENT(RoadType);
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    24
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    25
/**
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    26
 * The different roadtypes we support, but then a bitmask of them
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    27
 * @note currently only roadtypes with ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    28
 */
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    29
enum RoadTypes {
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    30
	ROADTYPES_NONE     = 0,                                                 ///< No roadtypes
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    31
	ROADTYPES_ROAD     = 1 << ROADTYPE_ROAD,                                ///< Road
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    32
	ROADTYPES_TRAM     = 1 << ROADTYPE_TRAM,                                ///< Trams
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    33
	ROADTYPES_HWAY     = 1 << ROADTYPE_HWAY,                                ///< Highway (or whatever substitute)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    34
	ROADTYPES_ROADTRAM = ROADTYPES_ROAD | ROADTYPES_TRAM,                   ///< Road + trams
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    35
	ROADTYPES_ROADHWAY = ROADTYPES_ROAD | ROADTYPES_HWAY,                   ///< Road + highway (or whatever substitute)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    36
	ROADTYPES_TRAMHWAY = ROADTYPES_TRAM | ROADTYPES_HWAY,                   ///< Trams + highway (or whatever substitute)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    37
	ROADTYPES_ALL      = ROADTYPES_ROAD | ROADTYPES_TRAM | ROADTYPES_HWAY,  ///< Road + trams + highway (or whatever substitute)
8236
8a5dd0b42e47 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8102
diff changeset
    38
	ROADTYPES_END,                                                          ///< Used for iterations?
8a5dd0b42e47 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8102
diff changeset
    39
	INVALID_ROADTYPES  = 0xFF                                               ///< Invalid roadtypes
8102
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    40
};
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    41
DECLARE_ENUM_AS_BIT_SET(RoadTypes);
8236
8a5dd0b42e47 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8102
diff changeset
    42
template <> struct EnumPropsT<RoadTypes> : MakeEnumPropsT<RoadTypes, byte, ROADTYPES_NONE, ROADTYPES_END, INVALID_ROADTYPES> {};
8a5dd0b42e47 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8102
diff changeset
    43
typedef TinyEnumT<RoadTypes> RoadTypesByte;
8102
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    44
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    45
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    46
/**
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    47
 * Enumeration for the road parts on a tile.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    48
 *
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    49
 * This enumeration defines the possible road parts which
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    50
 * can be build on a tile.
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    51
 */
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    52
enum RoadBits {
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    53
	ROAD_NONE = 0U,                  ///< No road-part is build
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    54
	ROAD_NW   = 1U,                  ///< North-west part
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    55
	ROAD_SW   = 2U,                  ///< South-west part
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    56
	ROAD_SE   = 4U,                  ///< South-east part
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    57
	ROAD_NE   = 8U,                  ///< North-east part
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    58
	ROAD_X    = ROAD_SW | ROAD_NE,   ///< Full road along the x-axis (south-west + north-east)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    59
	ROAD_Y    = ROAD_NW | ROAD_SE,   ///< Full road along the y-axis (north-west + south-east)
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    60
	ROAD_ALL  = ROAD_X  | ROAD_Y     ///< Full 4-way crossing
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    61
};
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    62
DECLARE_ENUM_AS_BIT_SET(RoadBits);
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    63
906a3d3b6df1 (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents:
diff changeset
    64
#endif /* ROAD_TYPE_H */