Public Types | Static Public Member Functions | Static Public Attributes | List of all members
Direction Struct Reference
Collaboration diagram for Direction:
Collaboration graph
[legend]

Public Types

typedef short int value_t
 
typedef Dictionary< value_t, std::string > dict_t
 

Static Public Member Functions

static bool isDiagonal (value_t dir)
 

Static Public Attributes

static const value_t NONE = 0
 
static const value_t UP =1
 
static const value_t UP_RIGHT =2
 
static const value_t RIGHT =4
 
static const value_t DOWN_RIGHT =8
 
static const value_t DOWN =16
 
static const value_t DOWN_LEFT =32
 
static const value_t LEFT =64
 
static const value_t UP_LEFT =128
 
static const value_t RECTANGULAR = UP | RIGHT | DOWN | LEFT
 
static const value_t DIAGONAL = UP_RIGHT | DOWN_RIGHT | DOWN_LEFT | UP_LEFT
 
static const dict_t arrows
 
static const std::map< value_t, Positionoffset
 Opposite direction. More...
 

Member Data Documentation

◆ arrows

const Direction::dict_t arrows
static
Initial value:
= {
{NONE, {"o"}},
{UP, {"↑"}},
{UP_RIGHT, {"↗"}},
{RIGHT, {"→"}},
{DOWN_RIGHT, {"↘"}},
{DOWN, {"↓"}},
{DOWN_LEFT, {"↙"}},
{LEFT, {"←"}},
{UP_LEFT, {"↖"}}
}

◆ offset

const std::map< Direction::value_t, Position > offset
static
Initial value:
= {
{NONE, { 0, 0}},
{UP, { 0,-1}},
{UP_RIGHT, {+1,-1}},
{RIGHT, {+1, 0}},
{DOWN_RIGHT, {+1,+1}},
{DOWN, { 0,+1}},
{DOWN_LEFT, {-1,+1}},
{LEFT, {-1, 0}},
{UP_LEFT, {-1,-1}}
}

Opposite direction.

Turn 90 degrees left Turn 90 degrees right

static inline dir dir90CW(dir d){ return (d >> 2) | (d << 6); }


The documentation for this struct was generated from the following files: