diff options
author | Nao Pross <naopross@thearcway.org> | 2018-02-11 22:55:22 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-02-11 22:55:22 +0100 |
commit | e3fd07e606098dd9cdf0b7ed806340d8466b5572 (patch) | |
tree | cbf5cc81afcbbc62784f7c6fc02d4418cf03cee7 /src/main/headers/Actor.hpp | |
parent | Remove redundant scenesOffsetX/Y, replaced with panX (diff) | |
download | Subconscious-old-e3fd07e606098dd9cdf0b7ed806340d8466b5572.tar.gz Subconscious-old-e3fd07e606098dd9cdf0b7ed806340d8466b5572.zip |
Reimplement in C++ with SFML (mostly)
Diffstat (limited to 'src/main/headers/Actor.hpp')
-rw-r--r-- | src/main/headers/Actor.hpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/headers/Actor.hpp b/src/main/headers/Actor.hpp new file mode 100644 index 0000000..7cc3be5 --- /dev/null +++ b/src/main/headers/Actor.hpp @@ -0,0 +1,40 @@ +#ifndef ACTOR_HPP +#define ACTOR_HPP + +#include <string> + +class Actor +{ +public: + const enum Type + { + PLAYER, ENEMY + } type; + + const unsigned maxHp; + const std::string name; + + Actor() = delete; + Actor(std::string _name, unsigned _maxHp, Type _type); + virtual ~Actor(); + + void damage(int amt); + void heal(int amt); + + // TODO shouldnt be done by the map ? + // bool move(int x, y); + + /* accessors */ + bool alive() { return _alive; } + unsigned hp() { return _hp; } + + int x() { return _x; } + int y() { return _y; } + +private: + bool _alive; + unsigned _hp; + int _x, _y; +}; + +#endif |