summaryrefslogtreecommitdiff
path: root/Unit.h
blob: ea5efdf274cd329e0757b63badad4e525121221b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef UNIT_H__
#define UNIT_H__

/* *******************************************************************
 *  Includes
 * ******************************************************************/

#include "BaseUnit.h"
#include <stdbool.h>
#include <stdint.h>

/* *******************************************************************
 *  Defines
 * ******************************************************************/

/* *******************************************************************
 *  Global types definition
 * ******************************************************************/

/* *******************************************************************
 *  Global variables declaration
 * ******************************************************************/

/* *******************************************************************
 *  Global functions declaration
 * ******************************************************************/

/* *******************************************************************
 *  Class definition
 * ******************************************************************/

class Unit : public BaseUnit
{
    public:
        enum tUnitID
        {
            UNIT_ID_NONE,
            UNIT_ID_PEASANT,
            UNIT_ID_SWORDMAN,

            MAX_UNIT_ID
        };

        explicit Unit(const Unit::tUnitID eUnitID = UNIT_ID_NONE);
        void create(const enum Unit::tUnitID eUnitID, const uint16_t x, const uint16_t y);
        void handler(void);
        void drawHandler(void);
        void moveTo(const uint16_t x, const uint16_t y);

    private:
        enum tUnitID _eUnitID;
        enum tUnitState
        {
            UNIT_STATE_IDLE,
            UNIT_STATE_MOVING
        } _eState;
        uint16_t _target_x;
        uint16_t _target_y;
};

#endif /* UNIT_H__ */