|
| | piece (const chess_color color, const piece_type type, const square &coordinat, const race r=race::classic) |
| |
| | piece (const chess_color color, const piece_type type, const std::string &coordinat, const race r=race::classic) |
| |
| void | add_action (const piece_action &action) |
| | Add an action for the piece to do This function will split up the action in smaller atomic actions.
|
| |
| void | add_message (const message_type &message) |
| | Add a message, i.e. a thing to say for this piece.
|
| |
| void | clear_messages () noexcept |
| | Clear all the sound effects, i.e. remove all.
|
| |
| const auto & | get_actions () const noexcept |
| | Get all the piece actions.
|
| |
| auto & | get_actions () noexcept |
| | Get all the piece actions.
|
| |
| const auto & | get_action_history () const noexcept |
| | Get the actions history.
|
| |
| const auto & | get_color () const noexcept |
| | Get the color of the piece, i.e. white or black.
|
| |
| delta_t | get_current_action_progress () const |
| | The progress of the current action, which is a value from zero to (and including) one.
|
| |
| const auto & | get_current_square () const noexcept |
| |
| double | get_health () const noexcept |
| | Get the health of the unit.
|
| |
| const piece_id & | get_id () const noexcept |
| | The unique piece ID.
|
| |
| const auto & | get_in_game_time () const noexcept |
| | Get the in-game time according to this piece.
|
| |
| int | get_kill_count () const noexcept |
| | Get the number of pieces this piece has killd.
|
| |
| double | get_max_health () const noexcept |
| | Get the maximum health of the unit.
|
| |
| double | get_max_shield () const |
| | Get the maximum shield value of the unit.
|
| |
| const auto & | get_messages () const noexcept |
| | The things this piece wants to say.
|
| |
| const auto & | get_race () const noexcept |
| | Get the race of a piece.
|
| |
| double | get_shield () const |
| | Get the shield value of the unit.
|
| |
| const auto & | get_type () const noexcept |
| | Get the type of piece, e.g. king, queen, rook, bishop, knight, pawn.
|
| |
| bool | has_moved () const noexcept |
| | Has this piece (attempted to) moved?
|
| |
| void | increase_kill_count () noexcept |
| | Increase the kill count by one.
|
| |
| bool | is_enpassantable (const in_game_time &when) const |
| | Can the unit be captured by en-passant? Will fail if the piece is not a pawn.
|
| |
| void | receive_damage (const double damage) |
| | Receive damage.
|
| |
| void | set_current_action_progress (const delta_t &t) noexcept |
| | Set the current progres an action has passed.
|
| |
| void | set_current_square (const square &s) noexcept |
| | Set the current/occupied square.
|
| |
| void | tick (const delta_t &dt, game &g) |
| | Do one frame of movement, resulting in a piece movement of 1 * delta_t.
|
| |
A chess piece.
@seealso for drawing a piece and/or its health bar properly use piece_layout}