3 #ifndef RECORD_KANJIPRINT_H 4 #define RECORD_KANJIPRINT_H 18 std::ostream&
operator<<(std::ostream& os,
const Color& c);
37 return (this->valid == rhs.
valid) &&
38 (this->value == rhs.
value);
42 return !(*
this == rhs);
83 void escColSet()
const;
84 void escColReSet()
const;
87 : os(os), color(color) {escColSet();}
105 virtual const std::string& getDan(
const size_t index)
const = 0;
107 virtual const std::string& getSuji(
const size_t index)
const = 0;
109 virtual const std::string& getPiece(
const size_t index)
const = 0;
112 const std::string&
getStand(
const size_t index)
const 119 return getStand(piece_index(ptypeo));
124 return getPiece(piece_index(ptypeo));
137 assert(index < NPieces);
152 const std::string&
getDan(
const size_t index)
const {
return dan[index];}
153 const std::string&
getSuji(
const size_t index)
const {
return suji[index];}
154 const std::string&
getPiece(
const size_t index)
const {
return pieces[index];}
164 const std::string&
getDan(
const size_t index)
const {
return dan[index];}
165 const std::string&
getSuji(
const size_t index)
const {
return suji[index];}
166 const std::string&
getPiece(
const size_t index)
const {
return pieces[index];}
176 const std::string&
getDan(
const size_t index)
const {
return dan[index];}
177 const std::string&
getSuji(
const size_t index)
const {
return suji[index];}
178 const std::string&
getPiece(
const size_t index)
const {
return pieces[index];}
188 const std::shared_ptr<Characters>
pieces;
195 const std::shared_ptr<Characters> pieces=std::shared_ptr<Characters>(
new StandardCharacters()))
196 : os(os), pieces(pieces),
208 const Move *last_move=NULL)
const;
static const Color colorFor(const std::string &str)
文字列に対応するColor objectを返す
std::string kanjiNumber(const int n)
漢数字を返す(持ち駒の数などで用いる)
static const CArray< std::string, 32 > pieces
static const CArray< std::string, 32 > pieces
static const Color LightGray
const std::string & getDan(const size_t index) const
段数の文字を返す
const std::string & getPiece(const size_t index) const
盤面上の駒を返す
const std::string & getDan(const size_t index) const
段数の文字を返す
const std::string & getStand(const size_t index) const
持ち駒の漢字文字を返す。1文字を期待する
const std::string & getSuji(const size_t index) const
筋の文字を返す。駒の文字幅に合わせる必要がある。
const std::string & getDan(const size_t index) const
段数の文字を返す
bool operator!=(const Color &rhs) const
static const Color LightCyan
ChangeShellColor(std::ostream &os, const Color &color)
static const CArray< std::string, 10 > dan
const std::string & kanji(const PtypeO &ptypeo) const
static const Color NONE
色指定しない(デフォルトのまま)ことを示す特別なオブジェクト
static const Color DarkGray
PtypeO newPtypeO(Player player, Ptype ptype)
static const CArray< std::string, 10 > suji
筋の文字。駒の文字幅に合わせる必要がある。
const std::string & getName() const
const std::string & getPiece(const size_t index) const
盤面上の駒を返す
const std::string & getPiece(const size_t index) const
盤面上の駒を返す
void setWhiteColor(const Color &c)
static const CArray< std::string, 10 > suji
static const Color Purple
static const Color LightPurple
bool operator==(const Color &rhs) const
const std::shared_ptr< Characters > pieces
KanjiPrint(std::ostream &os, const std::shared_ptr< Characters > pieces=std::shared_ptr< Characters >(new StandardCharacters()))
static const Color Yellow
const std::string & getSuji(const size_t index) const
筋の文字を返す。駒の文字幅に合わせる必要がある。
size_t piece_index(const PtypeO &ptypeo) const
friend std::ostream & operator<<(std::ostream &os, const Color &c)
static const CArray< std::string, 10 > dan
段数の文字
const std::string & kanji(Ptype ptype) const
PtypeO
Player + Ptype [-15, 15] PtypeO の O は Owner の O.
static const Color LightBlue
const std::string & getSuji(const size_t index) const
筋の文字を返す。駒の文字幅に合わせる必要がある。
static const Color LightGreen
std::ostream & operator<<(std::ostream &os, const Color &c)
static const CArray< std::string, 10 > dan
static const CArray< std::string, 32 > pieces
盤面上の駒の漢字文字
static const Color LightRed
void setBlackColor(const Color &c)
static const CArray< std::string, 32 > stand
void setLastMoveColor(const Color &c)
static const CArray< std::string, 10 > suji
const std::string & stand_kanji(const PtypeO &ptypeo) const