osl::record::MiniBoard Class Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Static Public Attributes | Private Types | Private Attributes | Friends | List of all members
osl::record::MiniBoard Class Reference

More compact board than CompactBoard. More...

`#include <miniBoard.h>`

## Public Member Functions
| MiniBoard ()
| MiniBoard (const state::SimpleState &state)
SimpleState | getState () const
boost::dynamic_bitset | toBits () const
std::string | toBase64 () const

## Static Public Attributes
static const size_t | total_bits = 400

## Private Types
typedef osl::vector< OPSquare > | PawnArray
typedef osl::vector< OPSquare > | LanceArray
typedef osl::vector< OPSquare > | KnightArray
typedef osl::vector< OPSquare > | SilverArray
typedef osl::vector< OPSquare > | BishopArray
typedef osl::vector< OPSquare > | RookArray
typedef osl::vector< OSquare > | GoldArray
typedef osl::CArray< char, 2 > | KingArray

## Private Attributes
PawnArray | pawn_pieces
LanceArray | lance_pieces
KnightArray | knight_pieces
SilverArray | silver_pieces
BishopArray | bishop_pieces
RookArray | rook_pieces
GoldArray | gold_pieces
KingArray | king_pieces
Player | turn

## Friends
int | fromBase64 (const std::string &base64, MiniBoard &mb)
| Converts a base64 string to MiniBoard. More...

## Detailed Description

More compact board than CompactBoard.

400 bits. PAWNs 1 - 180 LANCEs 181 - 220 KNIGHTs 221 - 260 SILVERs 261 - 300 BISHOPs 301 - 320 ROOKs 321 - 340 GOLDs 341 - 376 Black KING 377 - 384 White KING 385 - 392 not used 393 - 399 turn 400 (0: Black; 1:White)

Definition at line 103 of file miniBoard.h.

## Member Typedef Documentation

typedef osl::vector<OPSquare> osl::record::MiniBoard::BishopArray
| private

Definition at line 117 of file miniBoard.h.

typedef osl::vector<OSquare> osl::record::MiniBoard::GoldArray
| private

Definition at line 119 of file miniBoard.h.

typedef osl::CArray<char, 2> osl::record::MiniBoard::KingArray
| private

Definition at line 120 of file miniBoard.h.

typedef osl::vector<OPSquare> osl::record::MiniBoard::KnightArray
| private

Definition at line 115 of file miniBoard.h.

typedef osl::vector<OPSquare> osl::record::MiniBoard::LanceArray
| private

Definition at line 114 of file miniBoard.h.

typedef osl::vector<OPSquare> osl::record::MiniBoard::PawnArray
| private

Definition at line 113 of file miniBoard.h.

typedef osl::vector<OPSquare> osl::record::MiniBoard::RookArray
| private

Definition at line 118 of file miniBoard.h.

typedef osl::vector<OPSquare> osl::record::MiniBoard::SilverArray
| private

Definition at line 116 of file miniBoard.h.

## Constructor & Destructor Documentation

osl::record::MiniBoard::MiniBoard | ( | ) |  |
| inline

Definition at line 107 of file miniBoard.h.

osl::record::MiniBoard::MiniBoard | ( | const state::SimpleState & | state) |  |
| explicit

## Member Function Documentation

SimpleState osl::record::MiniBoard::getState | ( | ) |  | const

Definition at line 112 of file miniBoard.cc.

References osl::BISHOP, bishop_pieces, osl::record::OPiece::bits2Square(), osl::BLACK, osl::GOLD, gold_pieces, osl::Piece::isPromoted(), osl::KING, king_pieces, osl::KNIGHT, knight_pieces, osl::LANCE, lance_pieces, osl::PAWN, pawn_pieces, osl::promote(), osl::ROOK, rook_pieces, osl::SILVER, silver_pieces, turn, and osl::WHITE.

std::string osl::record::MiniBoard::toBase64 | ( | ) |  | const

Definition at line 251 of file miniBoard.cc.

References osl::misc::base64Encode(), and toBits().

boost::dynamic_bitset osl::record::MiniBoard::toBits | ( | ) |  | const

Definition at line 178 of file miniBoard.cc.

References bishop_pieces, osl::BLACK, gold_pieces, king_pieces, knight_pieces, lance_pieces, pawn_pieces, rook_pieces, silver_pieces, osl::record::OSquare::total_bits, osl::record::OPSquare::total_bits, total_bits, and turn.

Referenced by toBase64().

## Friends And Related Function Documentation

int fromBase64 | ( | const std::string & | base64,
|  | MiniBoard & | mb
| ) |  |
| friend

Converts a base64 string to MiniBoard.

Returns
  0 (success); non-zero (failure)

Definition at line 257 of file miniBoard.cc.

## Member Data Documentation

BishopArray osl::record::MiniBoard::bishop_pieces
| private

Definition at line 127 of file miniBoard.h.

Referenced by osl::record::fromBase64(), getState(), and toBits().

GoldArray osl::record::MiniBoard::gold_pieces
| private

Definition at line 129 of file miniBoard.h.

Referenced by osl::record::fromBase64(), getState(), and toBits().

KingArray osl::record::MiniBoard::king_pieces
| private

Definition at line 130 of file miniBoard.h.

Referenced by osl::record::fromBase64(), getState(), and toBits().

KnightArray osl::record::MiniBoard::knight_pieces
| private

Definition at line 125 of file miniBoard.h.

Referenced by osl::record::fromBase64(), getState(), and toBits().

LanceArray osl::record::MiniBoard::lance_pieces
| private

Definition at line 124 of file miniBoard.h.

Referenced by osl::record::fromBase64(), getState(), and toBits().

PawnArray osl::record::MiniBoard::pawn_pieces
| private

Definition at line 123 of file miniBoard.h.

Referenced by osl::record::fromBase64(), getState(), and toBits().

RookArray osl::record::MiniBoard::rook_pieces
| private

Definition at line 128 of file miniBoard.h.

Referenced by osl::record::fromBase64(), getState(), and toBits().

SilverArray osl::record::MiniBoard::silver_pieces
| private

Definition at line 126 of file miniBoard.h.

Referenced by osl::record::fromBase64(), getState(), and toBits().

const size_t osl::record::MiniBoard::total_bits = 400
| static

Definition at line 106 of file miniBoard.h.

Referenced by osl::record::fromBase64(), and toBits().

Player osl::record::MiniBoard::turn
| private

Definition at line 131 of file miniBoard.h.

Referenced by osl::record::fromBase64(), getState(), and toBits().

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

- miniBoard.h
- miniBoard.cc