#include "osl/config.h"
#include "osl/player.h"
#include <cassert>
#include <iosfwd>
ネームスペース | |
namespace | osl |
| |
マクロ定義 | |
#define | NEW_PTYPEO(player, ptype) static_cast<PtypeO>(static_cast<int>(ptype)-(16&static_cast<int>(player))) |
列挙型 | |
enum | osl::Ptype { osl::PTYPE_EMPTY = 0, osl::PTYPE_EDGE = 1, osl::PPAWN = 2, osl::PLANCE = 3, osl::PKNIGHT = 4, osl::PSILVER = 5, osl::PBISHOP = 6, osl::PROOK = 7, osl::KING = 8, osl::GOLD = 9, osl::PAWN = 10, osl::LANCE = 11, osl::KNIGHT = 12, osl::SILVER = 13, osl::BISHOP = 14, osl::ROOK = 15, osl::PTYPE_MIN = 0, osl::PTYPE_BASIC_MIN = KING, osl::PTYPE_PIECE_MIN = 2, osl::PTYPE_MAX = 15 } |
駒の種類を4ビットでコード化する [詳細] | |
enum | osl::PtypeO { osl::PTYPEO_MIN = PTYPE_EMPTY-16, osl::PTYPEO_MAX = 15 } |
Player + Ptype [-15, 15] PtypeO の O は Owner の O. [詳細] | |
関数 | |
std::istream & | osl::operator>> (std::istream &is, Ptype &ptype) |
std::ostream & | osl::operator<< (std::ostream &os, const Ptype ptype) |
bool | osl::isValid (Ptype ptype) |
int等からcastして作ったptypeが,正しい範囲に入っているかどうかのチェック | |
bool | osl::isPiece (Ptype ptype) |
ptypeが空白やEDGEでないかのチェック | |
bool | osl::isBasic (Ptype ptype) |
ptypeが基本型(promoteしていない)かのチェック | |
bool | osl::isPromoted (Ptype ptype) |
ptypeがpromote後の型かどうかのチェック | |
bool | osl::canPromote (Ptype ptype) |
ptypeがpromote可能な型かどうかのチェック promote済みの場合はfalseを返す | |
Ptype | osl::unpromote (Ptype ptype) |
ptypeがpromote後の型の時に,promote前の型を返す. promoteしていない型の時はそのまま返す | |
Ptype | osl::promote (Ptype ptype) |
promote可能なptypeに対して,promote後の型を返す promote不可のptypeを与えてはいけない. | |
bool | osl::isMajorBasic (Ptype ptype) |
bool | osl::isMajor (Ptype ptype) |
bool | osl::isMajorNonPieceOK (Ptype ptype) |
unsigned int | osl::ptypeOIndex (PtypeO ptypeo) |
PtypeO | osl::newPtypeO (Player player, Ptype ptype) |
Ptype | osl::getPtype (PtypeO ptypeO) |
PtypeO | osl::promote (PtypeO ptypeO) |
pieceをpromoteさせる. | |
PtypeO | osl::promoteWithMask (PtypeO ptypeO, int promoteMask) |
pieceを引数次第でpromoteさせる | |
PtypeO | osl::unpromote (PtypeO ptypeO) |
pieceをunpromoteさせる. | |
bool | osl::isValidPtypeO (int ptypeO) |
bool | osl::isPiece (PtypeO ptypeO) |
EMPTY, EDGEではない. | |
Player | osl::getOwner (PtypeO ptypeO) |
PtypeO | osl::captured (PtypeO ptypeO) |
unpromoteすると共に,ownerを反転する. | |
PtypeO | osl::alt (PtypeO ptypeO) |
owner を反転する | |
PtypeO | osl::altIfPiece (PtypeO ptypeO) |
Pieceの時にはowner を反転する. | |
bool | osl::canPromote (PtypeO ptypeO) |
bool | osl::isPromoted (PtypeO ptypeO) |
ptypeOが promote済みかどうか | |
std::ostream & | osl::operator<< (std::ostream &os, const PtypeO ptypeO) |
変数 | |
const int | osl::PTYPE_SIZE = PTYPE_MAX-PTYPE_MIN+1 |
const PtypeO | osl::PTYPEO_EMPTY = newPtypeO(BLACK,PTYPE_EMPTY) |
const PtypeO | osl::PTYPEO_EDGE = newPtypeO(WHITE,PTYPE_EDGE) |
const int | osl::PTYPEO_SIZE = PTYPEO_MAX-PTYPEO_MIN+1 |
#define NEW_PTYPEO | ( | player, | |||
ptype | ) | static_cast<PtypeO>(static_cast<int>(ptype)-(16&static_cast<int>(player))) |