You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
446 B
C
27 lines
446 B
C
19 years ago
|
/* $Id$ */
|
||
|
|
||
|
#ifndef ROAD_H
|
||
|
#define ROAD_H
|
||
|
|
||
|
typedef enum RoadBits {
|
||
19 years ago
|
ROAD_NW = 1U,
|
||
|
ROAD_SW = 2U,
|
||
|
ROAD_SE = 4U,
|
||
|
ROAD_NE = 8U,
|
||
19 years ago
|
ROAD_X = ROAD_SW | ROAD_NE,
|
||
|
ROAD_Y = ROAD_NW | ROAD_SE,
|
||
|
ROAD_ALL = ROAD_X | ROAD_Y
|
||
|
} RoadBits;
|
||
|
|
||
|
static inline RoadBits ComplementRoadBits(RoadBits r)
|
||
|
{
|
||
19 years ago
|
return (RoadBits)(ROAD_ALL ^ r);
|
||
19 years ago
|
}
|
||
|
|
||
|
static inline RoadBits DiagDirToRoadBits(DiagDirection d)
|
||
|
{
|
||
19 years ago
|
return (RoadBits)(1U << (3 ^ d));
|
||
19 years ago
|
}
|
||
|
|
||
18 years ago
|
#endif /* ROAD_H */
|