ttrts/source/maths/mathtypes.h

29 lines
587 B
C
Raw Normal View History

#ifndef _BASETYPES_H_
#define _BASETYPES_H_
2014-12-16 13:13:00 +00:00
#include <limits> // std::numeric_limits
#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
typedef short coord_t;
typedef unsigned short ucoord_t;
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
{
N = 'N',
S = 'S',
E = 'E',
W = 'W'
};
#endif //_BASETYPES_H_