2018-07-09 23:20:46 +02:00
|
|
|
#ifndef BASEUNIT_H__
|
|
|
|
#define BASEUNIT_H__
|
|
|
|
|
2018-07-09 22:33:29 +02:00
|
|
|
/* *******************************************************************
|
2018-07-09 19:26:13 +02:00
|
|
|
* Includes
|
2018-07-09 22:33:29 +02:00
|
|
|
* ******************************************************************/
|
2018-07-09 19:26:13 +02:00
|
|
|
|
2018-07-10 00:04:16 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
2018-08-05 17:58:03 +02:00
|
|
|
#include "Camera.h"
|
2018-07-09 19:26:13 +02:00
|
|
|
|
2018-07-09 22:33:29 +02:00
|
|
|
/* *******************************************************************
|
2018-07-09 19:26:13 +02:00
|
|
|
* Defines
|
2018-07-09 22:33:29 +02:00
|
|
|
* ******************************************************************/
|
2018-07-09 19:26:13 +02:00
|
|
|
|
2018-07-09 22:33:29 +02:00
|
|
|
/* *******************************************************************
|
2018-07-09 23:20:46 +02:00
|
|
|
* Global types definition
|
2018-07-09 22:33:29 +02:00
|
|
|
* ******************************************************************/
|
2018-07-09 19:26:13 +02:00
|
|
|
|
2018-07-09 22:33:29 +02:00
|
|
|
/* *******************************************************************
|
2018-07-09 23:20:46 +02:00
|
|
|
* Global variables declaration
|
2018-07-09 22:33:29 +02:00
|
|
|
* ******************************************************************/
|
2018-07-09 19:26:13 +02:00
|
|
|
|
2018-07-09 22:33:29 +02:00
|
|
|
/* *******************************************************************
|
2018-07-09 23:20:46 +02:00
|
|
|
* Global functions declaration
|
2018-07-09 22:33:29 +02:00
|
|
|
* ******************************************************************/
|
|
|
|
|
|
|
|
/* *******************************************************************
|
2018-07-09 23:20:46 +02:00
|
|
|
* Class definition
|
2018-07-09 22:33:29 +02:00
|
|
|
* ******************************************************************/
|
2018-07-09 19:26:13 +02:00
|
|
|
|
2018-07-09 23:20:46 +02:00
|
|
|
class BaseUnit
|
2018-07-09 19:26:13 +02:00
|
|
|
{
|
2018-07-09 23:20:46 +02:00
|
|
|
public:
|
2018-07-26 21:15:59 +02:00
|
|
|
explicit BaseUnit(void);
|
2018-07-10 00:04:16 +02:00
|
|
|
void handler(void);
|
2018-08-02 00:54:01 +02:00
|
|
|
void drawHandler(const uint8_t* const pu8SprData);
|
2018-07-10 23:17:34 +02:00
|
|
|
void create(const uint16_t x, const uint16_t y);
|
2018-08-05 17:58:03 +02:00
|
|
|
static void setCamera(const Camera* const c);
|
2018-07-26 21:22:28 +02:00
|
|
|
bool isAlive(void);
|
|
|
|
bool isSelected(void);
|
2018-08-02 00:54:01 +02:00
|
|
|
void setSelected(const bool bSelect);
|
2018-07-26 21:22:28 +02:00
|
|
|
uint16_t getX(void);
|
2018-08-02 00:54:01 +02:00
|
|
|
uint16_t getY(void);
|
2018-07-10 00:04:16 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
uint16_t _hp; /**< Health points. */
|
2018-07-26 21:15:59 +02:00
|
|
|
bool _alive; /**< Alive unit flag. */
|
|
|
|
bool _selected; /**< Selected unit flag. */
|
2018-07-10 23:17:34 +02:00
|
|
|
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 19:26:13 +02:00
|
|
|
|
2018-07-09 23:20:46 +02:00
|
|
|
#endif /* BASEUNIT_H__ */
|