This repository has been archived on 2019-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
dungeon-gunner/source/abstract/Character.h

46 lines
773 B
C
Raw Normal View History

2012-10-01 09:02:44 +00:00
/*
* Actor.h
*
* Created on: 02.09.2012
* Author: Felix
*/
#ifndef DG_ACTOR_H_
#define DG_ACTOR_H_
#include <vector>
/**
* Provides think function for AI.
*/
class Character {
// Public functions.
2012-09-12 12:21:57 +00:00
public:
2012-10-01 09:02:44 +00:00
Character(int health);
virtual ~Character() = 0;
static void think(float elapsedTime);
void onDamage(int damage);
// Protected functions.
protected:
/**
* Implement this function for any (regular) AI computations.
*
* @param elapsedTime Amount of time to simulate.
*/
virtual void onThink(float elapsedTime) = 0;
virtual void onDeath();
// Private variables.
private:
static std::vector<Character*> mInstances;
const int mMaxHealth;
2012-09-12 12:21:57 +00:00
int mCurrentHealth; //< Current health. Between 0 and mMaxHealth.
2012-10-01 09:02:44 +00:00
};
#endif /* DG_ACTOR_H_ */