#include <rack.h>
Implements a rack
A rack is an std::array of pointers Tile objects
Definition at line 17 of file rack.h.
◆ Rack()
Init rack with nullptr
Definition at line 14 of file rack.cc.
◆ ~Rack()
Clean up rack
Definition at line 22 of file rack.cc.
◆ addTile()
void Rack::addTile |
( |
Tile * |
t | ) |
|
Add a Tile to the rack
- Parameters
-
t | A pointer to the Tile to be placed in the rack |
This function shall not throw exceptions.
Definition at line 120 of file rack.cc.
◆ fill()
void Rack::fill |
( |
std::vector< Tile * > |
t | ) |
|
Fill the rack with provided tiles
- Parameters
-
t | A vector of pointers to the Tiles to be put in the rack |
This function shall not throw exceptions.
Definition at line 99 of file rack.cc.
◆ getTile()
Tile * Rack::getTile |
( |
char |
ch | ) |
|
Request a Tile from the rack
- Parameters
-
ch | Character representing the Tile |
- Returns
- Pointer to the requested Tile if the Tile exists, nullptr otherwise
This function shall not throw exceptions
Definition at line 80 of file rack.cc.
◆ getTileStrVec()
vector< Tile * > Rack::getTileStrVec |
( |
std::string |
tileStr | ) |
|
Get a vector of the Tiles requested from the rack
- Parameters
-
tileStr | A string of letters that represent Tiles |
- Returns
- A vector of pointers to the requested Tiles
- Exceptions
-
std::string | containing the error message |
Definition at line 141 of file rack.cc.
◆ isEmpty()
Check whether rack is empty
- Returns
- true if empty, false otherwise
This function shall not throw exceptions.
Definition at line 172 of file rack.cc.
◆ show()
"Pretty print" the rack
Definition at line 34 of file rack.cc.
◆ rack
std::array<Tile*, 7> Rack::rack |
|
private |
The documentation for this class was generated from the following files: