osl::psn Namespace Reference

gnushogi で使われるフォーマット. More...

## Classes

class | ParseError

## Functions

const Move | strToMove (const std::string &, const SimpleState &)
const Square | strToPos (const std::string &)
Ptype | charToPtype (char)
const std::string | show (Move)
const std::string | show (Square)
char | show (Ptype)
const std::string | showXP (Move)
| decorate capture by 'x', promote by '+', and unpromote by '='

## Detailed Description

gnushogi で使われるフォーマット.

何種類かある．

## Function Documentation

## charToPtype()

osl::Ptype osl::psn::charToPtype | ( | char | c | ) |

Definition at line 125 of file usi.cc.

References osl::BISHOP, osl::GOLD, osl::KING, osl::KNIGHT, osl::LANCE, osl::PAWN, osl::PTYPE_EMPTY, osl::ROOK, and osl::SILVER.

Referenced by osl::usi::charToPtypeO(), and strToMove().

## show() [1/3]

const std::string osl::psn::show | ( | Move | m | ) |

Definition at line 38 of file usi.cc.

References osl::Move::from(), osl::Square::isPieceStand(), osl::Move::promoteMask(), osl::Move::ptype(), show(), and osl::Move::to().

Referenced by show(), osl::usi::show(), osl::usi::show(), and showXP().

## show() [2/3]

char osl::psn::show | ( | Ptype | ptype | ) |

Definition at line 19 of file usi.cc.

References osl::BISHOP, osl::GOLD, osl::KING, osl::KNIGHT, osl::LANCE, osl::PAWN, osl::ROOK, and osl::SILVER.

## show() [3/3]

const std::string osl::psn::show | ( | Square | pos | ) |

Definition at line 8 of file usi.cc.

References osl::Square::x(), and osl::Square::y().

## showXP()

const std::string osl::psn::showXP | ( | Move | m | ) |

decorate capture by 'x', promote by '+', and unpromote by '='

Definition at line 57 of file usi.cc.

References osl::canPromote(), osl::Square::canPromote(), osl::Move::capturePtype(), osl::Move::from(), osl::Move::isInvalid(), osl::Move::isPass(), osl::Square::isPieceStand(), osl::Move::isPromotion(), osl::Move::player(), osl::Move::ptype(), osl::PTYPE_EMPTY, show(), and osl::Move::to().

## strToMove()

const osl::Move osl::psn::strToMove | ( | const std::string & | str,
|  | const SimpleState & | s )

Definition at line 86 of file usi.cc.

References osl::captured(), charToPtype(), osl::isPiece(), osl::SimpleState::pieceOnBoard(), osl::promote(), osl::Piece::ptype(), strToPos(), and osl::SimpleState::turn().

Referenced by osl::usi::strToMove().

## strToPos()

const osl::Square osl::psn::strToPos | ( | const std::string & | str | ) |

Definition at line 114 of file usi.cc.

Referenced by strToMove().