MicroMouse Maze Library  3703225
公開メンバ関数 | 公開変数類 | フレンド | 全メンバ一覧
MazeLib::WallRecord 構造体

区画位置、方向、壁の有無を保持する構造体。 [詳解]

#include <Maze.h>

公開メンバ関数

 WallRecord ()
 コンストラクタ [詳解]
 
 WallRecord (const int8_t x, const int8_t y, const Direction d, const bool b)
 
 WallRecord (const Position p, const Direction d, const bool b)
 
const Position getPosition () const
 区画の取得 [詳解]
 
const Direction getDirection () const
 方向の取得 [詳解]
 

公開変数類

union {
   struct {
      int   x: 6
 区画のx座標 [詳解]
 
      int   y: 6
 区画のy座標 [詳解]
 
      unsigned int   d: 3
 壁の方向 [詳解]
 
      unsigned int   b: 1
 壁の有無 [詳解]
 
   }   data
 データ全体へのアクセス用 [詳解]
 
}; 
 データメンバの共用体 [詳解]
 

フレンド

std::ostream & operator<< (std::ostream &os, const WallRecord &obj)
 表示 [詳解]
 

詳解

区画位置、方向、壁の有無を保持する構造体。

構築子と解体子

◆ WallRecord() [1/3]

MazeLib::WallRecord::WallRecord ( )
inline

コンストラクタ

618 {}

◆ WallRecord() [2/3]

MazeLib::WallRecord::WallRecord ( const int8_t  x,
const int8_t  y,
const Direction  d,
const bool  b 
)
inline
620  : x(x), y(y), d(d), b(b) {}
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

方向の取得

626 { return d; }

◆ getPosition()

const Position MazeLib::WallRecord::getPosition ( ) const
inline

区画の取得

624 { return Position(x, y); }

フレンドと関連関数の詳解

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const WallRecord obj 
)
friend

表示

101  {
102  return os << "( " << std::setw(2) << +obj.x << ", " << std::setw(2) << +obj.y
103  << ", " << obj.getDirection().toChar() << ", "
104  << (obj.b ? "true" : "false") << ")";
105 }

メンバ詳解

◆ 

union { ... }

データメンバの共用体

◆ b

unsigned int MazeLib::WallRecord::b

壁の有無

◆ d

unsigned int MazeLib::WallRecord::d

壁の方向

◆ 

struct { ... } uint16_t MazeLib::WallRecord::data

データ全体へのアクセス用

606  {
607  int x : 6;
608  int y : 6;
609  unsigned int d : 3;
610  unsigned int b : 1;
611  } __attribute__((__packed__));

◆ x

int MazeLib::WallRecord::x

区画のx座標

◆ y

int MazeLib::WallRecord::y

区画のy座標


この構造体詳解は次のファイルから抽出されました: