This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/generator/Generator.h

38 lines
972 B
C
Raw Normal View History

2013-04-11 18:44:00 +00:00
/*
* Generator.h
*
* Created on: 07.04.2013
* Author: Felix
*/
#ifndef DG_GENERATOR_H_
#define DG_GENERATOR_H_
#include <SFML/Graphics.hpp>
class TileManager;
class World;
2013-04-11 18:44:00 +00:00
class Generator {
public:
explicit Generator();
void generateTiles(TileManager& tm, World& world,
const sf::IntRect& area) const;
2013-04-11 18:44:00 +00:00
//void generateCharacters(World& world, const sf::IntRect& area) const;
sf::Vector2f getPlayerSpawn() const;
private:
static void fill(std::vector<std::vector<bool> >& image,
const sf::IntRect& area, bool value);
static void filterWalls(std::vector<std::vector<bool> >& in,
std::vector<std::vector<bool> >& out,
int x, int y, int longside, int shortside, int subtract);
2013-04-18 08:05:17 +00:00
static int countWalls(const sf::IntRect& area,
std::vector<std::vector<bool> >& tiles);
static void generateAreas(World& world,
std::vector<std::vector<bool> >& tiles,
const sf::IntRect& area, const sf::Vector2f& offset);
2013-04-11 18:44:00 +00:00
};
#endif /* DG_GENERATOR_H_ */