-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTile.h
55 lines (47 loc) · 1.3 KB
/
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
46
47
48
49
50
51
52
53
54
55
/*!
* \file Tile.h
* \author Ekinox <[email protected]>
*/
#ifndef TILE_INCLUDED
#define TILE_INCLUDED 1
#include <string>
#include <SFML/Graphics.hpp>
#include "ImageManager.h"
/*!
* \class Tile
* This class models a tile, which is a sprite which isn't animated and
* doesn't move.
*/
class Tile : public sf::Sprite
{
private:
unsigned char myAttributes; //!< The attributes of the tile
public:
/*!
* \param Image The tile's image's associated filename
* \param Attributes The tile's attributes
* \param PosX The position on the X axis of the tile
* \param PosY The position on the Y axis of the tile
*/
Tile(const std::string &Image, unsigned char Attributes, float PosX,
float PosY) :
sf::Sprite(ImageManager::Get(Image), sf::Vector2f(PosX, PosY)),
myAttributes(Attributes)
{
}
/*!
* \return The attributes of the tile
*/
unsigned char GetAttributes() const
{
return myAttributes;
}
/*!
* \param Attributes The new attributes of the tile
*/
void SetAttributes(unsigned char Attributes)
{
myAttributes = Attributes;
}
};
#endif // TILE_INCLUDED