dungeon/src/Actor.h

43 lines
758 B
C++

#pragma once
#include "vec2i.h"
#include <string>
class BehaviourTree;
enum Actors {
ACT_BASE,
ACT_HERO,
ACT_GOBLIN,
ACT_SHAMAN
};
class Tilemap;
class Actor {
vec2i position;
int healcounter;
protected:
BehaviourTree* bt;
public:
int id;
std::string name;
Tilemap* map;
bool alive;
int health;
int maxhealth;
int strength;
Actor(Tilemap* map, vec2i pos);
const vec2i get_position();
bool IsAlive(){ return alive; };
bool Move(int dx, int dy);
int GetHealth() { return health; }
void Kill() { alive = false; health = 0; };
void update();
virtual bool isTypeOf(Actors actor){ return actor == ACT_BASE; };
virtual Actors Type() { return ACT_BASE; };
~Actor();
};