author | Tero Marttila <terom@fixme.fi> |
Fri, 18 Jul 2008 21:28:42 +0300 | |
changeset 11175 | 020c61e39c94 |
parent 8759 | eae56497cf83 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
8597
87f03bc9c8e4
(svn r11662) -Codechange: move some rail types/related functions around.
rubidium
parents:
8596
diff
changeset
|
3 |
/** @file rail_type.h The different types of rail */ |
2232
0c63dce21e30
(svn r2752) -Doc: Added some doxygen stuff to rail.h. I'm gonna mess around with this file and wanted to get rid of this first
celestar
parents:
2186
diff
changeset
|
4 |
|
8597
87f03bc9c8e4
(svn r11662) -Codechange: move some rail types/related functions around.
rubidium
parents:
8596
diff
changeset
|
5 |
#ifndef RAIL_TYPE_H |
87f03bc9c8e4
(svn r11662) -Codechange: move some rail types/related functions around.
rubidium
parents:
8596
diff
changeset
|
6 |
#define RAIL_TYPE_H |
1942
634961366cdc
(svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents:
diff
changeset
|
7 |
|
8759
eae56497cf83
(svn r11827) -Codechange: do not include enum_type.hpp unnecessary.
rubidium
parents:
8732
diff
changeset
|
8 |
#include "core/enum_type.hpp" |
eae56497cf83
(svn r11827) -Codechange: do not include enum_type.hpp unnecessary.
rubidium
parents:
8732
diff
changeset
|
9 |
|
7892
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
10 |
/** |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
11 |
* Enumeration for all possible railtypes. |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
12 |
* |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
13 |
* This enumeration defines all 4 possible railtypes. |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
14 |
*/ |
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6488
diff
changeset
|
15 |
enum RailType { |
7892
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
16 |
RAILTYPE_BEGIN = 0, ///< Used for iterations |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
17 |
RAILTYPE_RAIL = 0, ///< Standard non-electric rails |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
18 |
RAILTYPE_ELECTRIC = 1, ///< Electric rails |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
19 |
RAILTYPE_MONO = 2, ///< Monorail |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
20 |
RAILTYPE_MAGLEV = 3, ///< Maglev |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
21 |
RAILTYPE_END, ///< Used for iterations |
af0701f35fdf
(svn r10765) -Documentation [FS#1100]: of rail.h. Based on a patch by Progman.
rubidium
parents:
7831
diff
changeset
|
22 |
INVALID_RAILTYPE = 0xFF ///< Flag for invalid railtype |
6574
e1d1a12faaf7
(svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents:
6488
diff
changeset
|
23 |
}; |
4041
caf4fcb4e05b
(svn r5309) Partially fix the rail header dependency fiasco: rail_map.h now depends on rail.h and not the other way round anymore
tron
parents:
3900
diff
changeset
|
24 |
|
5838
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5726
diff
changeset
|
25 |
/** Allow incrementing of Track variables */ |
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5726
diff
changeset
|
26 |
DECLARE_POSTFIX_INCREMENT(RailType); |
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5726
diff
changeset
|
27 |
/** Define basic enum properties */ |
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5726
diff
changeset
|
28 |
template <> struct EnumPropsT<RailType> : MakeEnumPropsT<RailType, byte, RAILTYPE_BEGIN, RAILTYPE_END, INVALID_RAILTYPE> {}; |
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5726
diff
changeset
|
29 |
typedef TinyEnumT<RailType> RailTypeByte; |
9c3129cb019b
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents:
5726
diff
changeset
|
30 |
|
8732
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
31 |
/** |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
32 |
* The different roadtypes we support, but then a bitmask of them |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
33 |
*/ |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
34 |
enum RailTypes { |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
35 |
RAILTYPES_NONE = 0, ///< No rail types |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
36 |
RAILTYPES_RAIL = 1 << RAILTYPE_RAIL, ///< Non-electrified rails |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
37 |
RAILTYPES_ELECTRIC = 1 << RAILTYPE_ELECTRIC, ///< Electrified rails |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
38 |
RAILTYPES_MONO = 1 << RAILTYPE_MONO, ///< Monorail! |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
39 |
RAILTYPES_MAGLEV = 1 << RAILTYPE_MAGLEV, ///< Ever fast maglev |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
40 |
RAILTYPES_ALL = RAILTYPES_RAIL | RAILTYPES_ELECTRIC | RAILTYPES_MONO | RAILTYPES_MAGLEV, ///< All of them |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
41 |
RAILTYPES_END, ///< Used for iterations? |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
42 |
INVALID_RAILTYPES = 0xFF ///< Invalid railtypes |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
43 |
}; |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
44 |
DECLARE_ENUM_AS_BIT_SET(RailTypes); |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
45 |
template <> struct EnumPropsT<RailTypes> : MakeEnumPropsT<RailTypes, byte, RAILTYPES_NONE, RAILTYPES_END, INVALID_RAILTYPES> {}; |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
46 |
typedef TinyEnumT<RailTypes> RailTypesByte; |
b18f578f7c16
(svn r11800) -Codechange: move some functions to a more logical location + some type safety.
rubidium
parents:
8597
diff
changeset
|
47 |
|
8597
87f03bc9c8e4
(svn r11662) -Codechange: move some rail types/related functions around.
rubidium
parents:
8596
diff
changeset
|
48 |
#endif /* RAIL_TYPE_H */ |