55 lines
1.8 KiB
C++
55 lines
1.8 KiB
C++
#ifndef BASEUNIT_H__
|
|
#define BASEUNIT_H__
|
|
|
|
/* *******************************************************************
|
|
* Includes
|
|
* ******************************************************************/
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include "Camera.h"
|
|
|
|
/* *******************************************************************
|
|
* Defines
|
|
* ******************************************************************/
|
|
|
|
/* *******************************************************************
|
|
* Global types definition
|
|
* ******************************************************************/
|
|
|
|
/* *******************************************************************
|
|
* Global variables declaration
|
|
* ******************************************************************/
|
|
|
|
/* *******************************************************************
|
|
* Global functions declaration
|
|
* ******************************************************************/
|
|
|
|
/* *******************************************************************
|
|
* Class definition
|
|
* ******************************************************************/
|
|
|
|
class BaseUnit
|
|
{
|
|
public:
|
|
explicit BaseUnit(void);
|
|
void handler(void);
|
|
void drawHandler(const uint8_t* const pu8SprData);
|
|
void create(const uint16_t x, const uint16_t y);
|
|
static void setCamera(const Camera* const c);
|
|
bool isAlive(void);
|
|
bool isSelected(void);
|
|
void setSelected(const bool bSelect);
|
|
uint16_t getX(void);
|
|
uint16_t getY(void);
|
|
|
|
protected:
|
|
uint16_t _hp; /**< Health points. */
|
|
bool _alive; /**< Alive unit flag. */
|
|
bool _selected; /**< Selected unit flag. */
|
|
uint16_t _x; /**< X coordinate inside map. */
|
|
uint16_t _y; /**< Y coordinate inside map. */
|
|
};
|
|
|
|
#endif /* BASEUNIT_H__ */
|