-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtile.h
38 lines (31 loc) · 952 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
/*
* tile.h
*
* Created on: 2013-07-17
* Author: Liam
*/
#ifndef TILE_H_
#define TILE_H_
#include "entity.h"
#include "entitycreator.h"
typedef class Tile : public Entity {
public:
Tile():m_width(0), m_height(0), m_center({0, 0}) {}
Tile(const float &width, const float &height, const vec2d &pos);
Tile(const float &width, const float &height, const vec2d &pos, const int& properties);
void resize(const int &w, const int &h);
virtual void step(float dt) {}
virtual bool write(std::ofstream &file);
virtual bool read(std::ifstream &file);
private: //TODO: we don't use these anywhere, get rid of them
float m_width;
float m_height;
vec2d m_center;
} Tile_s;
typedef class _TileCreator: public EntityCreator {
public:
virtual ~_TileCreator() {}
virtual Entity *create() const {return new Tile;}
virtual Entity *create(const vec2d &pos, const vec2d &size, const int &properties) const;
} Tile_Creator;
#endif /* TILE_H_ */