-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTile.h
45 lines (36 loc) · 878 Bytes
/
Tile.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
#include <iostream>
#include <vector>
#include <ctime>
#include <fstream>
#include <sstream>
#include <stack>
#include <map>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/window.hpp>
using namespace std;
using namespace sf;
enum TileTypes { DEFAULT = 0, DAMAGING, DOODAD, ENEMYSPAWNER };
class Tile
{
private:
protected:
sf::Sprite shape;
bool collision;
short type;
public:
Tile();
Tile(short type, int grid_x, int grid_y, float gridSizeF,
const sf::Texture& texture, const sf::IntRect& texture_rect,
const bool collision);
virtual ~Tile();
//Accessors
const short& getType() const;
virtual const bool& getCollision() const;
//Functions
virtual const sf::Vector2f& getPosition() const;
virtual const sf::FloatRect getGlobalBounds() const;
virtual const bool intersects(const sf::FloatRect bounds) const;
};
#endif