2006-04-12 05:26:36 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#ifndef ROAD_H
|
|
|
|
#define ROAD_H
|
|
|
|
|
|
|
|
typedef enum RoadBits {
|
2006-05-09 10:35:13 +00:00
|
|
|
ROAD_NW = 1U,
|
|
|
|
ROAD_SW = 2U,
|
|
|
|
ROAD_SE = 4U,
|
|
|
|
ROAD_NE = 8U,
|
2006-04-12 05:26:36 +00:00
|
|
|
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)
|
|
|
|
{
|
2006-05-27 16:12:16 +00:00
|
|
|
return (RoadBits)(ROAD_ALL ^ r);
|
2006-04-12 05:26:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline RoadBits DiagDirToRoadBits(DiagDirection d)
|
|
|
|
{
|
2006-05-27 16:12:16 +00:00
|
|
|
return (RoadBits)(1U << (3 ^ d));
|
2006-04-12 05:26:36 +00:00
|
|
|
}
|
|
|
|
|
2006-09-28 18:42:35 +00:00
|
|
|
#endif /* ROAD_H */
|