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/sprites/Tile.h
Felix Ableitner aa6df65e97 Changed sprites to always render as rectangle.
Also created Rectangle/Circle subclasses for sprite to handle
collision detection and moved collision detection from World to
CollisionModel (static methods).
2013-05-08 00:42:26 +02:00

40 lines
563 B
C++

/*
* Tile.h
*
* Created on: 20.04.2013
* Author: Felix
*/
#ifndef DG_TILE_H_
#define DG_TILE_H_
#include "../abstract/Rectangle.h"
/**
* Holds information about a single tile.
*/
class Tile : public Rectangle {
public:
enum class Type : char {
FLOOR,
WALL
};
public:
explicit Tile(Type type, int x, int y);
Type getType() const;
public:
static const sf::Vector2i TILE_SIZE; //< Tile size in pixels.
public:
static std::string getConfig(Type type);
static bool isSolid(Type type);
private:
Type mType;
};
#endif /* DG_TILE_H_ */