1
0
Fork 0

First commit, world map creation

This commit is contained in:
trotFunky 2019-05-27 13:50:49 +02:00
commit 76306196c0
7 changed files with 176 additions and 0 deletions

36
World.h Normal file
View file

@ -0,0 +1,36 @@
//
// Created by trotfunky on 27/05/19.
//
#ifndef RAYCASTING_WORLD_H
#define RAYCASTING_WORLD_H
#include <vector>
#include <ostream>
enum class BlockType {
AIR,
WALL,
DOOR,
WINDOW,
};
class World {
public:
World(int w, int h, std::vector<BlockType> worldMap = {});
int getW() const;
int getH() const;
BlockType getBlock(float x, float y) const;
void setBlock(BlockType block, int x, int y, int width = 1, int height = 1);
friend std::ostream& operator<<(std::ostream& ostream, World const & world);
private:
int w;
int h;
std::vector<BlockType> map;
};
#endif //RAYCASTING_WORLD_H