DrunkenBishop implementation.
More...
|
| Impl () |
| Default is an empty board.
|
|
void | compute (const std::string &data_r, const std::string &title_r, unsigned height_r=Auto, unsigned width_r=Auto) |
| Build up a new board.
|
|
std::ostream & | dumpOn (std::ostream &str, const std::string &prefix_r, Options options_r) const |
| Render board to a stream.
|
|
|
void | move (Direction direction_r) |
| Move Bishop from _e into direction_r and update the _board.
|
|
bool | atTL () const |
| Whether _e is in the top left corner.
|
|
bool | atTR () const |
| Whether _e is in the top right corner.
|
|
bool | atBL () const |
| Whether _e is in the bottom left corner.
|
|
bool | atBR () const |
| Whether _e is in the bottom right corner.
|
|
bool | atT () const |
| Whether _e is in the top row.
|
|
bool | atB () const |
| Whether _e is in the bottom row.
|
|
bool | atL () const |
| Whether _e is in the left column.
|
|
bool | atR () const |
| Whether _e is in the right column.
|
|
const char * | color (std::uint8_t idx_r) const |
| ANSI color heatmap.
|
|
std::ostream & | renderTitleOn (std::ostream &str, const std::string &title_r) const |
| Render non empty title strings.
|
|
std::ostream & | renderOn (std::ostream &str, bool useColor_r, unsigned pos_r) const |
| Render board numbers to printable chars.
|
|
|
static unsigned | odd (unsigned val_r) |
| Increment even width/height values.
|
|
static std::uint8_t | bite (const char *&ch_r) |
| Get next 4 moves (8 bit) from next 2 hex digits (1st digit != '\0' asserted, 0-pad if necessary).
|
|
|
std::vector< std::uint8_t > | _board |
| the board
|
|
unsigned | _h |
| board height
|
|
unsigned | _w |
| board with
|
|
unsigned | _s |
| start position
|
|
unsigned | _e |
| end position
|
|
bool | _renderSSH |
| whether to render the ssh (or gpg) char set
|
|
std::string | _fp |
| fingerprint to render as bottom title
|
|
std::string | _tt |
| text to render as top title
|
|
|
static constexpr const unsigned | Auto = unsigned(-1) |
| Request default width/height values.
|
|
DrunkenBishop implementation.
Definition at line 72 of file DrunkenBishop.cc.
◆ Impl()
zypp::base::DrunkenBishop::Impl::Impl |
( |
| ) |
|
|
inline |
◆ compute()
void zypp::base::DrunkenBishop::Impl::compute |
( |
const std::string & |
data_r, |
|
|
const std::string & |
title_r, |
|
|
unsigned |
height_r = Auto , |
|
|
unsigned |
width_r = Auto |
|
) |
| |
|
inline |
◆ dumpOn()
std::ostream & zypp::base::DrunkenBishop::Impl::dumpOn |
( |
std::ostream & |
str, |
|
|
const std::string & |
prefix_r, |
|
|
Options |
options_r |
|
) |
| const |
|
inline |
◆ odd()
static unsigned zypp::base::DrunkenBishop::Impl::odd |
( |
unsigned |
val_r | ) |
|
|
inlinestaticprivate |
◆ bite()
static std::uint8_t zypp::base::DrunkenBishop::Impl::bite |
( |
const char *& |
ch_r | ) |
|
|
inlinestaticprivate |
Get next 4 moves (8 bit) from next 2 hex digits (1st digit != '\0' asserted, 0-pad if necessary).
- Exceptions
-
std::invalid_argument | if char is not a hex digit or 1st char is \0 |
Definition at line 170 of file DrunkenBishop.cc.
◆ move()
void zypp::base::DrunkenBishop::Impl::move |
( |
Direction |
direction_r | ) |
|
|
inlineprivate |
◆ atTL()
bool zypp::base::DrunkenBishop::Impl::atTL |
( |
| ) |
const |
|
inlineprivate |
◆ atTR()
bool zypp::base::DrunkenBishop::Impl::atTR |
( |
| ) |
const |
|
inlineprivate |
◆ atBL()
bool zypp::base::DrunkenBishop::Impl::atBL |
( |
| ) |
const |
|
inlineprivate |
◆ atBR()
bool zypp::base::DrunkenBishop::Impl::atBR |
( |
| ) |
const |
|
inlineprivate |
◆ atT()
bool zypp::base::DrunkenBishop::Impl::atT |
( |
| ) |
const |
|
inlineprivate |
◆ atB()
bool zypp::base::DrunkenBishop::Impl::atB |
( |
| ) |
const |
|
inlineprivate |
◆ atL()
bool zypp::base::DrunkenBishop::Impl::atL |
( |
| ) |
const |
|
inlineprivate |
◆ atR()
bool zypp::base::DrunkenBishop::Impl::atR |
( |
| ) |
const |
|
inlineprivate |
◆ color()
const char * zypp::base::DrunkenBishop::Impl::color |
( |
std::uint8_t |
idx_r | ) |
const |
|
inlineprivate |
◆ renderTitleOn()
std::ostream & zypp::base::DrunkenBishop::Impl::renderTitleOn |
( |
std::ostream & |
str, |
|
|
const std::string & |
title_r |
|
) |
| const |
|
inlineprivate |
◆ renderOn()
std::ostream & zypp::base::DrunkenBishop::Impl::renderOn |
( |
std::ostream & |
str, |
|
|
bool |
useColor_r, |
|
|
unsigned |
pos_r |
|
) |
| const |
|
inlineprivate |
◆ nullimpl()
static shared_ptr< Impl > zypp::base::DrunkenBishop::Impl::nullimpl |
( |
| ) |
|
|
inlinestatic |
◆ Auto
constexpr const unsigned zypp::base::DrunkenBishop::Impl::Auto = unsigned(-1) |
|
staticconstexprprivate |
◆ _board
std::vector<std::uint8_t> zypp::base::DrunkenBishop::Impl::_board |
|
private |
◆ _h
unsigned zypp::base::DrunkenBishop::Impl::_h |
|
private |
◆ _w
unsigned zypp::base::DrunkenBishop::Impl::_w |
|
private |
◆ _s
unsigned zypp::base::DrunkenBishop::Impl::_s |
|
private |
◆ _e
unsigned zypp::base::DrunkenBishop::Impl::_e |
|
private |
◆ _renderSSH
bool zypp::base::DrunkenBishop::Impl::_renderSSH |
|
private |
◆ _fp
std::string zypp::base::DrunkenBishop::Impl::_fp |
|
private |
◆ _tt
std::string zypp::base::DrunkenBishop::Impl::_tt |
|
private |
The documentation for this class was generated from the following file: