Clean-up: Change indentation to tabs
This commit is contained in:
parent
9c9ec45304
commit
bb20d4a520
6 changed files with 301 additions and 301 deletions
66
World.h
66
World.h
|
@ -14,54 +14,54 @@
|
|||
#include "Player.h"
|
||||
|
||||
enum class BlockType {
|
||||
AIR,
|
||||
WALL,
|
||||
DOOR,
|
||||
WINDOW,
|
||||
AIR,
|
||||
WALL,
|
||||
DOOR,
|
||||
WINDOW,
|
||||
};
|
||||
|
||||
class World {
|
||||
public:
|
||||
Player player;
|
||||
Player player;
|
||||
|
||||
World(int w, int h,
|
||||
sf::Color groundColor = Colors::Ground,
|
||||
sf::Color ceilingColor = Colors::Ceiling,
|
||||
std::vector<BlockType> worldMap = {});
|
||||
int getW() const;
|
||||
int getH() const;
|
||||
World(int w, int h,
|
||||
sf::Color groundColor = Colors::Ground,
|
||||
sf::Color ceilingColor = Colors::Ceiling,
|
||||
std::vector<BlockType> worldMap = {});
|
||||
int getW() const;
|
||||
int getH() const;
|
||||
|
||||
inline BlockType getBlock(int x, int y) const;
|
||||
inline BlockType getBlock(float x, float y) const;
|
||||
void setBlock(BlockType block, int x, int y, int width = 1, int height = 1);
|
||||
|
||||
void render(sf::RenderWindow&) const;
|
||||
void render(sf::RenderWindow&) const;
|
||||
|
||||
/**
|
||||
* Move the world one step forward.
|
||||
* @param stepTime delta time since last step, in seconds
|
||||
*/
|
||||
void step(const float& stepTime);
|
||||
/**
|
||||
* Move the world one step forward.
|
||||
* @param stepTime delta time since last step, in seconds
|
||||
*/
|
||||
void step(const float& stepTime);
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& ostream, World const & world);
|
||||
friend std::ostream& operator<<(std::ostream& ostream, World const & world);
|
||||
private:
|
||||
int w;
|
||||
int h;
|
||||
std::vector<BlockType> map;
|
||||
int w;
|
||||
int h;
|
||||
std::vector<BlockType> map;
|
||||
|
||||
sf::Color groundColor;
|
||||
sf::Color ceilingColor;
|
||||
sf::Color groundColor;
|
||||
sf::Color ceilingColor;
|
||||
|
||||
void fillColumn(sf::RenderWindow&, unsigned int column, float scale,
|
||||
sf::Color fillColor = Colors::Wall) const;
|
||||
/**
|
||||
* Cast a ray from a given position and return its distance to the origin.
|
||||
* @param originX Ray X origin, strictly positive
|
||||
* @param originY Ray Y origin, strictly positive
|
||||
* @param orientation Angle to cast to, in degrees between 0 and 360
|
||||
* @return Distance of the hit to the origin.
|
||||
*/
|
||||
float castRay(float originX, float originY, float orientation) const;
|
||||
void fillColumn(sf::RenderWindow&, unsigned int column, float scale,
|
||||
sf::Color fillColor = Colors::Wall) const;
|
||||
/**
|
||||
* Cast a ray from a given position and return its distance to the origin.
|
||||
* @param originX Ray X origin, strictly positive
|
||||
* @param originY Ray Y origin, strictly positive
|
||||
* @param orientation Angle to cast to, in degrees between 0 and 360
|
||||
* @return Distance of the hit to the origin.
|
||||
*/
|
||||
float castRay(float originX, float originY, float orientation) const;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue