28 lines
525 B
C++
28 lines
525 B
C++
#pragma once
|
|
|
|
class Actor;
|
|
|
|
class Ai {
|
|
public:
|
|
virtual void update(Actor* owner) = 0;
|
|
virtual ~Ai() {};
|
|
};
|
|
|
|
class PlayerAi : public Ai {
|
|
public:
|
|
void update(Actor* owner);
|
|
|
|
protected:
|
|
bool moveOrAttack(Actor* owner, int targetx, int targety);
|
|
void handleActionKey(Actor* owner, int sdlkey);
|
|
Actor* choseFromInventory(Actor* owner);
|
|
};
|
|
|
|
class MonsterAi : public Ai {
|
|
public:
|
|
void update(Actor* owner);
|
|
|
|
protected:
|
|
int moveCount;
|
|
void moveOrAttack(Actor* owner, int targetx, int targety);
|
|
}; |