src/road_type.h
author convert-repo
Mon, 07 Apr 2008 16:21:55 +0000
changeset 10076 dfd70e42c4ae
parent 8844 b4f9ff470b85
permissions -rw-r--r--
update tags
3069
0e6aca11c3da (svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
tron
parents:
diff changeset
     1
/* $Id$ */
0e6aca11c3da (svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
tron
parents:
diff changeset
     2
8844
b4f9ff470b85 (svn r11914) -Documentation: fix some @file statement
glx
parents: 8732
diff changeset
     3
/** @file road_type.h Enums and other types related to roads. */
6889
f7f6d9cb07a0 (svn r9523) -Cleanup: doxygen changes. Time to take care of "R"
belugas
parents: 6574
diff changeset
     4
8598
14ae80fe4c8f (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents: 8424
diff changeset
     5
#ifndef ROAD_TYPE_H
14ae80fe4c8f (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents: 8424
diff changeset
     6
#define ROAD_TYPE_H
3069
0e6aca11c3da (svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
tron
parents:
diff changeset
     7
8598
14ae80fe4c8f (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents: 8424
diff changeset
     8
#include "core/enum_type.hpp"
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
     9
7157
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    10
/**
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    11
 * The different roadtypes we support
7891
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    12
 *
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    13
 * @note currently only ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
7157
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    14
 */
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    15
enum RoadType {
7891
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    16
	ROADTYPE_ROAD = 0,      ///< Basic road type
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    17
	ROADTYPE_TRAM = 1,      ///< Trams
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    18
	ROADTYPE_HWAY = 2,      ///< Only a placeholder. Not sure what we are going to do with this road type.
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    19
	ROADTYPE_END,           ///< Used for iterations
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    20
	INVALID_ROADTYPE = 0xFF ///< flag for invalid roadtype
7157
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    21
};
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    22
DECLARE_POSTFIX_INCREMENT(RoadType);
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    23
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    24
/**
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    25
 * The different roadtypes we support, but then a bitmask of them
7891
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    26
 * @note currently only roadtypes with ROADTYPE_ROAD and ROADTYPE_TRAM are supported.
7157
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    27
 */
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    28
enum RoadTypes {
7891
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    29
	ROADTYPES_NONE     = 0,                                                 ///< No roadtypes
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    30
	ROADTYPES_ROAD     = 1 << ROADTYPE_ROAD,                                ///< Road
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    31
	ROADTYPES_TRAM     = 1 << ROADTYPE_TRAM,                                ///< Trams
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    32
	ROADTYPES_HWAY     = 1 << ROADTYPE_HWAY,                                ///< Highway (or whatever substitute)
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    33
	ROADTYPES_ROADTRAM = ROADTYPES_ROAD | ROADTYPES_TRAM,                   ///< Road + trams
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    34
	ROADTYPES_ROADHWAY = ROADTYPES_ROAD | ROADTYPES_HWAY,                   ///< Road + highway (or whatever substitute)
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    35
	ROADTYPES_TRAMHWAY = ROADTYPES_TRAM | ROADTYPES_HWAY,                   ///< Trams + highway (or whatever substitute)
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    36
	ROADTYPES_ALL      = ROADTYPES_ROAD | ROADTYPES_TRAM | ROADTYPES_HWAY,  ///< Road + trams + highway (or whatever substitute)
8732
b18f578f7c16 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8598
diff changeset
    37
	ROADTYPES_END,                                                          ///< Used for iterations?
b18f578f7c16 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8598
diff changeset
    38
	INVALID_ROADTYPES  = 0xFF                                               ///< Invalid roadtypes
7157
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    39
};
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    40
DECLARE_ENUM_AS_BIT_SET(RoadTypes);
8732
b18f578f7c16 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8598
diff changeset
    41
template <> struct EnumPropsT<RoadTypes> : MakeEnumPropsT<RoadTypes, byte, ROADTYPES_NONE, ROADTYPES_END, INVALID_ROADTYPES> {};
b18f578f7c16 (svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents: 8598
diff changeset
    42
typedef TinyEnumT<RoadTypes> RoadTypesByte;
7157
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    43
270bc5b64e08 (svn r9892) -Codechange: lots of ground work for allowing multiple types of "road" with multiple owners on a single tile.
rubidium
parents: 6889
diff changeset
    44
7891
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    45
/**
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    46
 * Enumeration for the road parts on a tile.
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    47
 *
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    48
 * This enumeration defines the possible road parts which
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    49
 * can be build on a tile.
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    50
 */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6442
diff changeset
    51
enum RoadBits {
7891
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    52
	ROAD_NONE = 0U,                  ///< No road-part is build
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    53
	ROAD_NW   = 1U,                  ///< North-west part
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    54
	ROAD_SW   = 2U,                  ///< South-west part
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    55
	ROAD_SE   = 4U,                  ///< South-east part
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    56
	ROAD_NE   = 8U,                  ///< North-east part
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    57
	ROAD_X    = ROAD_SW | ROAD_NE,   ///< Full road along the x-axis (south-west + north-east)
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    58
	ROAD_Y    = ROAD_NW | ROAD_SE,   ///< Full road along the y-axis (north-west + south-east)
5aac5be5fc2c (svn r10764) -Documentation: [FS#1099]: of road.h. Based on a patch by Progman.
rubidium
parents: 7187
diff changeset
    59
	ROAD_ALL  = ROAD_X  | ROAD_Y     ///< Full 4-way crossing
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6442
diff changeset
    60
};
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    61
DECLARE_ENUM_AS_BIT_SET(RoadBits);
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    62
8598
14ae80fe4c8f (svn r11663) -Codechange: moving of the road related types and functions.
rubidium
parents: 8424
diff changeset
    63
#endif /* ROAD_TYPE_H */