1
0
Fork 0
Toy-Raytracer/World.h

36 lines
643 B
C++

//
// 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