迷路上の方向を表す。
[詳解]
#include <Maze.h>
|
enum | AbsoluteDirection : int8_t {
East
, NorthEast
, North
, NorthWest
,
West
, SouthWest
, South
, SouthEast
} |
| 絶対方向の列挙型。 0-7 の整数 [詳解]
|
|
enum | RelativeDirection : int8_t {
Front
, Left45
, Left
, Left135
,
Back
, Right135
, Right
, Right45
} |
| 相対方向の列挙型。 0-7 の整数 [詳解]
|
|
|
static constexpr const int8_t | Max = 8 |
| 方向の総数。for文などで使える。 [詳解]
|
|
迷路上の方向を表す。
実体は 8bit の整数。 絶対方向 or 相対方向の8方位を表現することができる。 コンストラクタにより8方位(0-7)に自動的に収められるので、 加法、減法により相対方向を計算することができる。
+-----------+-------+-----------+
+ + + +
+ + + +
+-----------+-------+-----------+
+-----------+-------+-----------+
+ + + +
+ + + +
+-----------+-------+-----------+
AbsoluteDirection
絶対方向の列挙型。 0-7 の整数
Definition: Maze.h:150
@ North
Definition: Maze.h:153
@ NorthWest
Definition: Maze.h:154
@ NorthEast
Definition: Maze.h:152
@ East
Definition: Maze.h:151
@ West
Definition: Maze.h:155
RelativeDirection
相対方向の列挙型。 0-7 の整数
Definition: Maze.h:163
@ Back
Definition: Maze.h:168
@ Left45
Definition: Maze.h:165
@ Right45
Definition: Maze.h:171
@ Right135
Definition: Maze.h:169
@ Right
Definition: Maze.h:170
@ Left
Definition: Maze.h:166
@ Front
Definition: Maze.h:164
@ Left135
Definition: Maze.h:167
◆ AbsoluteDirection
絶対方向の列挙型。 0-7 の整数
列挙値 |
---|
East | |
NorthEast | |
North | |
NorthWest | |
West | |
SouthWest | |
South | |
SouthEast | |
@ SouthEast
Definition: Maze.h:158
@ South
Definition: Maze.h:157
@ SouthWest
Definition: Maze.h:156
◆ RelativeDirection
相対方向の列挙型。 0-7 の整数
列挙値 |
---|
Front | |
Left45 | |
Left | |
Left135 | |
Back | |
Right135 | |
Right | |
Right45 | |
◆ Direction() [1/2]
デフォルトコンストラクタ。絶対方向をそのまま格納。
◆ Direction() [2/2]
constexpr MazeLib::Direction::Direction |
( |
const int8_t |
d | ) |
|
|
inlineconstexpr |
整数を引数としたコンストラクタ。
相対方向などの計算結果を 0-7 の整数に直して格納する。
- 引数
-
◆ Along4()
static constexpr const std::array<Direction, 4> MazeLib::Direction::Along4 |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ Diag4()
static constexpr const std::array<Direction, 4> MazeLib::Direction::Diag4 |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ isAlong()
bool MazeLib::Direction::isAlong |
( |
| ) |
const |
|
inline |
◆ isDiag()
bool MazeLib::Direction::isDiag |
( |
| ) |
const |
|
inline |
◆ operator int8_t()
constexpr MazeLib::Direction::operator int8_t |
( |
| ) |
const |
|
inlineconstexpr |
◆ toChar()
char MazeLib::Direction::toChar |
( |
| ) |
const |
|
inline |
表示用char型へのキャスト
206 {
return ">'^`<,v.X"[d]; }
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const Direction |
d |
|
) |
| |
|
friend |
stream 表示
211 return os << d.toChar();
◆ Max
constexpr const int8_t MazeLib::Direction::Max = 8 |
|
staticconstexpr |
このクラス詳解は次のファイルから抽出されました: