|
CardGame
Rogue-like card videogame
|
Renders a CardInstance as a fixed-size ASCII grid. More...
#include <cardRenderer.h>
Public Member Functions | |
| CardRenderer ()=default | |
| std::vector< std::string > | renderCard (const CardInstance &cardToRender) const |
| Renders the given card into an ASCII grid. | |
| int | getCardTemplateWidth () const |
| Returns the fixed width of the rendered card template. | |
Renders a CardInstance as a fixed-size ASCII grid.
CardRenderer produces a vector of strings representing a bordered card template populated with the card's name, stats, and description. Layout is slot-based: text is fit to fixed-width slots and written into the grid.
The output grid has a constant width and height defined by the renderer.
|
default |
|
inline |
Returns the fixed width of the rendered card template.
| std::vector< std::string > CardRenderer::renderCard | ( | const CardInstance & | cardToRender | ) | const |
Renders the given card into an ASCII grid.
| cardToRender | Card instance to render. |