区画位置、方向、壁の有無を保持する構造体。
[詳解]
#include <Maze.h>
区画位置、方向、壁の有無を保持する構造体。
- 実体は 16bit の整数
- 探索の記録などに用いる
- サイズを小さくするためにビットフィールド構造体を用いている
◆ WallRecord() [1/3]
MazeLib::WallRecord::WallRecord |
( |
| ) |
|
|
inline |
◆ WallRecord() [2/3]
MazeLib::WallRecord::WallRecord |
( |
const int8_t |
x, |
|
|
const int8_t |
y, |
|
|
const Direction |
d, |
|
|
const bool |
b |
|
) |
| |
|
inline |
int y
区画のy座標
Definition: Maze.h:608
int x
区画のx座標
Definition: Maze.h:607
unsigned int b
壁の有無
Definition: Maze.h:610
unsigned int d
壁の方向
Definition: Maze.h:609
◆ WallRecord() [3/3]
MazeLib::WallRecord::WallRecord |
( |
const Position |
p, |
|
|
const Direction |
d, |
|
|
const bool |
b |
|
) |
| |
|
inline |
622 :
x(p.x),
y(p.y),
d(
d),
b(
b) {}
◆ getDirection()
const Direction MazeLib::WallRecord::getDirection |
( |
| ) |
const |
|
inline |
◆ getPosition()
const Position MazeLib::WallRecord::getPosition |
( |
| ) |
const |
|
inline |
区画の取得
624 {
return Position(
x,
y); }
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const WallRecord & |
obj |
|
) |
| |
|
friend |
表示
102 return os <<
"( " << std::setw(2) << +obj.x <<
", " << std::setw(2) << +obj.y
103 <<
", " << obj.getDirection().toChar() <<
", "
104 << (obj.b ?
"true" :
"false") <<
")";
unsigned int MazeLib::WallRecord::b |
unsigned int MazeLib::WallRecord::d |
struct { ... } uint16_t MazeLib::WallRecord::data |
データ全体へのアクセス用
611 } __attribute__((__packed__));
int MazeLib::WallRecord::x |
int MazeLib::WallRecord::y |
この構造体詳解は次のファイルから抽出されました: