Map class.
More...
#include <Map.hpp>
Map class.
This class represents map. A map is a board of the game.
◆ Map() [1/2]
| baba_is_auto::Map::Map |
( |
| ) |
|
|
default |
◆ Map() [2/2]
| baba_is_auto::Map::Map |
( |
std::size_t |
width, |
|
|
std::size_t |
height |
|
) |
| |
Constructs map with given width and height.
- Parameters
-
| width | The size of the width. |
| height | The size of the height. |
◆ AddObject()
| void baba_is_auto::Map::AddObject |
( |
std::size_t |
x, |
|
|
std::size_t |
y, |
|
|
ObjectType |
type |
|
) |
| |
Adds an object to the map.
- Parameters
-
| x | The x position. |
| y | The y position. |
| type | An object type to add to the map. |
◆ At() [1/2]
| Object & baba_is_auto::Map::At |
( |
std::size_t |
x, |
|
|
std::size_t |
y |
|
) |
| |
Gets a writable object reference from the map.
- Parameters
-
| x | The x position. |
| y | The y position. |
- Returns
- A writable object reference at the zero-based (x, y) position.
◆ At() [2/2]
| const Object & baba_is_auto::Map::At |
( |
std::size_t |
x, |
|
|
std::size_t |
y |
|
) |
| const |
Gets an object from the map.
- Parameters
-
| x | The x position. |
| y | The y position. |
- Returns
- An object at row and column.
◆ GetHeight()
| std::size_t baba_is_auto::Map::GetHeight |
( |
| ) |
const |
Gets the height of the map.
- Returns
- The height of the map.
◆ GetPositions()
Gets a list of icon positions.
- Parameters
-
| type | An object type to get a list of positions. |
- Returns
- A list of icon positions.
◆ GetWidth()
| std::size_t baba_is_auto::Map::GetWidth |
( |
| ) |
const |
Gets the width of the map.
- Returns
- The width of the map.
◆ Load()
| void baba_is_auto::Map::Load |
( |
std::string_view |
filename | ) |
|
Loads the data of the map.
- Parameters
-
| filename | The file name to load. |
- Exceptions
-
| std::runtime_error | If the map data is invalid. |
◆ RemoveObject()
| void baba_is_auto::Map::RemoveObject |
( |
std::size_t |
x, |
|
|
std::size_t |
y, |
|
|
ObjectType |
type |
|
) |
| |
Removes an object from the map.
- Parameters
-
| x | The x position. |
| y | The y position. |
| type | An object type to remove from the map. |
◆ Reset()
| void baba_is_auto::Map::Reset |
( |
| ) |
|
The documentation for this class was generated from the following file:
- Includes/baba-is-auto/Games/Map.hpp