26 lines
440 B
C++
26 lines
440 B
C++
#ifndef _ENTITY_HPP_
|
|
#define _ENTITY_HPP_
|
|
|
|
using namespace std;
|
|
|
|
class Entity
|
|
{
|
|
public:
|
|
Entity();
|
|
~Entity();
|
|
virtual void action(int px, int py) = 0;
|
|
virtual bool damage(int dmg) = 0;
|
|
static Entity* getById(int id);
|
|
int getId();
|
|
int x;
|
|
int y;
|
|
char symbol;
|
|
static void InitAction(int px, int py);
|
|
protected:
|
|
int id;
|
|
private:
|
|
static int nextId;
|
|
static vector<Entity*> entities;
|
|
};
|
|
#endif
|