osl::book::MiniBoard Class Reference

More compact board than CompactBoard. More...

`#include <miniBoard.h>`

## Public Member Functions

| MiniBoard ()
| MiniBoard (const 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 std::vector< OPSquare > | PawnArray
typedef std::vector< OPSquare > | LanceArray
typedef std::vector< OPSquare > | KnightArray
typedef std::vector< OPSquare > | SilverArray
typedef std::vector< OPSquare > | BishopArray
typedef std::vector< OPSquare > | RookArray
typedef std::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.

## 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

## BishopArray

typedef std::vector<OPSquare> osl::book::MiniBoard::BishopArray

private

Definition at line 117 of file miniBoard.h.

## GoldArray

typedef std::vector<OSquare> osl::book::MiniBoard::GoldArray

private

Definition at line 119 of file miniBoard.h.

## KingArray

typedef osl::CArray<char, 2> osl::book::MiniBoard::KingArray

private

Definition at line 120 of file miniBoard.h.

## KnightArray

typedef std::vector<OPSquare> osl::book::MiniBoard::KnightArray

private

Definition at line 115 of file miniBoard.h.

## LanceArray

typedef std::vector<OPSquare> osl::book::MiniBoard::LanceArray

private

Definition at line 114 of file miniBoard.h.

## PawnArray

typedef std::vector<OPSquare> osl::book::MiniBoard::PawnArray

private

Definition at line 113 of file miniBoard.h.

## RookArray

typedef std::vector<OPSquare> osl::book::MiniBoard::RookArray

private

Definition at line 118 of file miniBoard.h.

## SilverArray

typedef std::vector<OPSquare> osl::book::MiniBoard::SilverArray

private

Definition at line 116 of file miniBoard.h.

## Constructor & Destructor Documentation

## MiniBoard() [1/2]

osl::book::MiniBoard::MiniBoard | ( |  | ) |

inline

Definition at line 107 of file miniBoard.h.

Referenced by fromBase64.

## MiniBoard() [2/2]

osl::book::MiniBoard::MiniBoard | ( | const SimpleState & | state | ) |

explicit

Definition at line 53 of file miniBoard.cc.

References osl::BISHOP, bishop_pieces, osl::BLACK, osl::GOLD, gold_pieces, osl::KING, king_pieces, osl::KNIGHT, knight_pieces, osl::LANCE, lance_pieces, osl::Piece::owner(), osl::PAWN, pawn_pieces, osl::SimpleState::pieceOf(), osl::book::OPiece::position2Bits(), osl::Piece::ptype(), osl::ROOK, rook_pieces, osl::SILVER, silver_pieces, osl::Piece::square(), osl::PieceMask::test(), turn, osl::SimpleState::turn(), osl::unpromote(), and osl::SimpleState::usedMask().

## Member Function Documentation

## getState()

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

Definition at line 112 of file miniBoard.cc.

References osl::BISHOP, bishop_pieces, osl::book::OPiece::bits2Square(), osl::BLACK, osl::GOLD, gold_pieces, osl::SimpleState::init(), osl::KING, king_pieces, osl::KNIGHT, knight_pieces, osl::LANCE, lance_pieces, osl::PAWN, pawn_pieces, osl::promote(), osl::ROOK, rook_pieces, osl::SimpleState::setPiece(), osl::SimpleState::setTurn(), osl::SILVER, silver_pieces, turn, and osl::WHITE.

## toBase64()

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

Definition at line 251 of file miniBoard.cc.

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

## toBits()

boost::dynamic_bitset osl::book::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, total_bits, osl::book::OPSquare::total_bits, osl::book::OSquare::total_bits, and turn.

Referenced by toBase64().

## Friends And Related Symbol Documentation

## fromBase64

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.

References osl::misc::base64Decode(), bishop_pieces, osl::BLACK, gold_pieces, king_pieces, knight_pieces, lance_pieces, MiniBoard(), pawn_pieces, rook_pieces, silver_pieces, total_bits, osl::book::OPSquare::total_bits, osl::book::OSquare::total_bits, turn, and osl::WHITE.

## Member Data Documentation

## bishop_pieces

BishopArray osl::book::MiniBoard::bishop_pieces

private

Definition at line 127 of file miniBoard.h.

Referenced by fromBase64, getState(), MiniBoard(), and toBits().

## gold_pieces

GoldArray osl::book::MiniBoard::gold_pieces

private

Definition at line 129 of file miniBoard.h.

Referenced by fromBase64, getState(), MiniBoard(), and toBits().

## king_pieces

KingArray osl::book::MiniBoard::king_pieces

private

Definition at line 130 of file miniBoard.h.

Referenced by fromBase64, getState(), MiniBoard(), and toBits().

## knight_pieces

KnightArray osl::book::MiniBoard::knight_pieces

private

Definition at line 125 of file miniBoard.h.

Referenced by fromBase64, getState(), MiniBoard(), and toBits().

## lance_pieces

LanceArray osl::book::MiniBoard::lance_pieces

private

Definition at line 124 of file miniBoard.h.

Referenced by fromBase64, getState(), MiniBoard(), and toBits().

## pawn_pieces

PawnArray osl::book::MiniBoard::pawn_pieces

private

Definition at line 123 of file miniBoard.h.

Referenced by fromBase64, getState(), MiniBoard(), and toBits().

## rook_pieces

RookArray osl::book::MiniBoard::rook_pieces

private

Definition at line 128 of file miniBoard.h.

Referenced by fromBase64, getState(), MiniBoard(), and toBits().

## silver_pieces

SilverArray osl::book::MiniBoard::silver_pieces

private

Definition at line 126 of file miniBoard.h.

Referenced by fromBase64, getState(), MiniBoard(), and toBits().

## total_bits

const size_t osl::book::MiniBoard::total_bits = 400

static

Definition at line 106 of file miniBoard.h.

Referenced by fromBase64, and toBits().

## turn

Player osl::book::MiniBoard::turn

private

Definition at line 131 of file miniBoard.h.

Referenced by fromBase64, getState(), MiniBoard(), and toBits().

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

- miniBoard.h
- miniBoard.cc