Added maze class that handles parsing of the map and rendering of the floor, walls and objectives.
Detects and counts the number of objectives encountered. The number is printed on exit.
This commit is contained in:
parent
888e8bd7f5
commit
24ff555e88
13 changed files with 31453 additions and 41 deletions
47
src/Maze.h
Normal file
47
src/Maze.h
Normal file
|
@ -0,0 +1,47 @@
|
|||
//
|
||||
// Created by trotfunky on 04/11/2019.
|
||||
//
|
||||
|
||||
#ifndef LABYRINTHE_MAZE_H
|
||||
#define LABYRINTHE_MAZE_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <DataHandling/Texture.h>
|
||||
#include <DataHandling/Model3D.h>
|
||||
|
||||
#include "TileTypes.h"
|
||||
|
||||
class Maze {
|
||||
public:
|
||||
Maze(const std::string& maze_map, unsigned int scaling_factor, const Texture& floor_texture,
|
||||
const Texture& wall_texture, const Texture& outside_texture, Model3D& objective);
|
||||
|
||||
void draw();
|
||||
|
||||
bool remove_objective(const Vec2i& position);
|
||||
|
||||
unsigned int scaling_factor;
|
||||
Texture map;
|
||||
|
||||
private:
|
||||
const Texture& floor;
|
||||
const Texture& wall;
|
||||
const Texture& out;
|
||||
Model3D& objective;
|
||||
|
||||
const double objective_altitude = 0;
|
||||
const double wall_height = 2;
|
||||
unsigned corner_pos;
|
||||
|
||||
Vec3d outside_position;
|
||||
std::vector<Vec3d> objective_positions;
|
||||
// FIXME : Draw only border walls...
|
||||
std::vector<Vec3d> wall_positions;
|
||||
|
||||
void preapre_display_list();
|
||||
};
|
||||
|
||||
|
||||
#endif //LABYRINTHE_MAZE_H
|
Loading…
Add table
Add a link
Reference in a new issue