2014-12-16 13:12:53 +00:00
|
|
|
#ifndef _BASETYPES_H_
|
|
|
|
#define _BASETYPES_H_
|
|
|
|
|
2014-12-16 13:13:00 +00:00
|
|
|
#include <limits> // std::numeric_limits
|
|
|
|
|
2014-12-16 13:13:00 +00:00
|
|
|
#include "stdlib.h" // for size_t
|
|
|
|
|
|
|
|
template<class T, size_t N>
|
|
|
|
constexpr size_t _countof(T (&)[N]) { return N; }
|
|
|
|
|
2014-12-16 13:12:59 +00:00
|
|
|
// Coordinate types
|
2014-12-16 13:12:54 +00:00
|
|
|
typedef short coord_t;
|
|
|
|
typedef unsigned short ucoord_t;
|
2014-12-16 13:12:53 +00:00
|
|
|
|
2014-12-16 13:13:00 +00:00
|
|
|
// Invalid values
|
|
|
|
static const coord_t coord_invalid = std::numeric_limits<coord_t>::max();
|
|
|
|
static const ucoord_t ucoord_invalid = std::numeric_limits<ucoord_t>::max();
|
|
|
|
|
2014-12-16 13:12:59 +00:00
|
|
|
// Direction representation
|
2014-12-21 11:14:20 +00:00
|
|
|
enum class dir_c : char
|
2014-12-16 13:12:55 +00:00
|
|
|
{
|
|
|
|
N = 'N',
|
|
|
|
S = 'S',
|
|
|
|
E = 'E',
|
2014-12-16 13:13:01 +00:00
|
|
|
W = 'W'
|
2014-12-16 13:12:55 +00:00
|
|
|
};
|
|
|
|
|
2014-12-16 13:13:01 +00:00
|
|
|
#endif //_BASETYPES_H_
|