PocketEmpires/BaseUnit.h

55 lines
1.8 KiB
C
Raw Permalink Normal View History

2018-07-09 23:20:46 +02:00
#ifndef BASEUNIT_H__
#define BASEUNIT_H__
/* *******************************************************************
* Includes
* ******************************************************************/
2018-07-10 00:04:16 +02:00
#include <stdbool.h>
#include <stdint.h>
#include "Camera.h"
/* *******************************************************************
* Defines
* ******************************************************************/
/* *******************************************************************
2018-07-09 23:20:46 +02:00
* Global types definition
* ******************************************************************/
/* *******************************************************************
2018-07-09 23:20:46 +02:00
* Global variables declaration
* ******************************************************************/
/* *******************************************************************
2018-07-09 23:20:46 +02:00
* Global functions declaration
* ******************************************************************/
/* *******************************************************************
2018-07-09 23:20:46 +02:00
* Class definition
* ******************************************************************/
2018-07-09 23:20:46 +02:00
class BaseUnit
{
2018-07-09 23:20:46 +02:00
public:
explicit BaseUnit(void);
2018-07-10 00:04:16 +02:00
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);
2018-07-10 00:04:16 +02:00
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. */
2018-07-09 23:20:46 +02:00
};
2018-07-09 23:20:46 +02:00
#endif /* BASEUNIT_H__ */