SDL Breakout Engine  0.1.0
An implementation of a Breakout game using sdl, implemented with efficient resource management.
LevelManager.hpp
Go to the documentation of this file.
1 #ifndef LEVEL_MANAGER_HPP
2 #define LEVEL_MANAGER_HPP
3 
4 #include <vector>
5 #include "TinyMath.hpp"
6 #include <string>
7 #include <fstream>
8 #include <memory>
9 #include <sstream>
10 
11 using namespace std;
12 
17 {
18  NONE = 0,
19  BLUE,
21  GREY,
23  RED,
25 };
26 
30 struct Level
31 {
32  vector<vector<pair<Vector3D, BlockColor>>> board;
33  int yoffset;
34 
40  Level(vector<vector<pair<Vector3D, BlockColor>>> const &given, int const &yoffset);
41 };
42 
49 static ostream &operator<<(ostream &os, const Level &l);
50 
67 {
68 public:
69  LevelManager() = delete;
70  LevelManager(const LevelManager& lm) = delete;
71  void operator=(const LevelManager& lm) = delete;
72 
78  static unique_ptr<Level> Load(const std::string &levelPath);
79 };
80 
81 #endif
Definition: LevelManager.hpp:66
static ostream & operator<<(ostream &os, const Level &l)
Definition: LevelManager.cpp:9
vector< vector< pair< Vector3D, BlockColor > > > board
the board is a matrix of positions to color.
Definition: LevelManager.hpp:32
int yoffset
how far to shift the whole board down
Definition: LevelManager.hpp:33
Yellow tile.
Definition: LevelManager.hpp:24
Definition: LevelManager.hpp:30
Red tile.
Definition: LevelManager.hpp:23
Grey tile.
Definition: LevelManager.hpp:21
Purple tile.
Definition: LevelManager.hpp:22
Green tile.
Definition: LevelManager.hpp:20
Blue tile.
Definition: LevelManager.hpp:19
Empty space.
Definition: LevelManager.hpp:18
BlockColor
Definition: LevelManager.hpp:16