direction.h
author tron
Thu, 15 Jun 2006 14:45:03 +0000
branch0.4
changeset 10035 23985f53225c
parent 10032 fcf09abbde96
permissions -rw-r--r--
(svn r5281) -Backport: r5124
-Fix: Be more strict what it means for an aircraft to be in a hangar: It's not just being stopped on a hangar tile
/* $Id$ */

#ifndef DIRECTION_H
#define DIRECTION_H


/* the 2 axis */
typedef enum Axis {
	AXIS_X = 0,
	AXIS_Y = 1,
	AXIS_END
} Axis;


static inline Axis DiagDirToAxis(uint d)
{
	return (Axis)(d & 1);
}


/*
 * Converts an Axis to a DiagDirection
 * Points always in the positive direction, i.e. S[EW]
 */
static inline uint AxisToDiagDir(Axis a)
{
	return (uint)(2 - a);
}

#endif