Add invalid coord variables
This commit is contained in:
parent
da1cb32583
commit
a6e1319fad
2 changed files with 15 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
#ifndef _GAME_TYPES_H_
|
#ifndef _GAME_TYPES_H_
|
||||||
#define _GAME_TYPES_H_
|
#define _GAME_TYPES_H_
|
||||||
|
|
||||||
|
#include <limits> // std::numeric_limits
|
||||||
|
|
||||||
// Type for a team IDs
|
// Type for a team IDs
|
||||||
typedef unsigned short team_id_t;
|
typedef unsigned short team_id_t;
|
||||||
|
|
||||||
|
@ -16,4 +18,11 @@ typedef char unitType_c;
|
||||||
// Typedef for unit visual representations
|
// Typedef for unit visual representations
|
||||||
typedef char unitVis_c;
|
typedef char unitVis_c;
|
||||||
|
|
||||||
|
// Invalid data for above types
|
||||||
|
static const team_id_t team_id_invalid = std::numeric_limits<team_id_t>::max();
|
||||||
|
static const player_id_t player_id_invalid = std::numeric_limits<player_id_t>::max();
|
||||||
|
static const unit_id_t unit_id_invalid = std::numeric_limits<unit_id_t>::max();
|
||||||
|
static const unitType_c unitType_invalid = std::numeric_limits<unitType_c>::max();
|
||||||
|
static const unitVis_c unitVis_invalid = std::numeric_limits<unitVis_c>::max();
|
||||||
|
|
||||||
#endif //_GAME_TYPES_H_
|
#endif //_GAME_TYPES_H_
|
|
@ -1,10 +1,16 @@
|
||||||
#ifndef _BASETYPES_H_
|
#ifndef _BASETYPES_H_
|
||||||
#define _BASETYPES_H_
|
#define _BASETYPES_H_
|
||||||
|
|
||||||
|
#include <limits> // std::numeric_limits
|
||||||
|
|
||||||
// Coordinate types
|
// Coordinate types
|
||||||
typedef short coord_t;
|
typedef short coord_t;
|
||||||
typedef unsigned short ucoord_t;
|
typedef unsigned short ucoord_t;
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
|
||||||
// Direction representation
|
// Direction representation
|
||||||
enum dir_t : char
|
enum dir_t : char
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue