-
Notifications
You must be signed in to change notification settings - Fork 0
/
object.h
55 lines (40 loc) · 1.28 KB
/
object.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
#ifndef OBJECT_H
#define OBJECT_H
#include "Loader.h"
namespace SSJ{
class Object
{
protected:
Point screenPosition;
int syncId; /* Unique number used to identificate objects when synchronizing */
Sprite sprite;
/*for synchronization by server*/
Point mapPosition;
bool activity;
bool desynchronization;
private:
void setDefaultVar();
public:
void AddAction(sf::Event::EventType, Object*, ActionEvent);
void AddActionKeyboard(sf::Event::EventType, sf::Keyboard::Key, Object* ,ActionEvent);
public:
Object();
Object(float x, float y);
Object(Point);
Point getMapPosition() const;
void setMapPosition(float x, float y);
void setMapPosition(Point screenPosition);
Point getScreenPosition() const;
virtual void draw() = 0;
virtual void update() = 0;
virtual void SynchronizationObject(Json::Value) = 0;
void setActivity(const bool activity);
bool isActive() const;
Sprite *getSprite() ;
void setSprite(const Sprite value);
bool isDesynchronization() const;
void setDesynchronization(bool value);
int getSyncId() { return this->syncId; }
};
}
#endif // OBJECT_H