summaryrefslogtreecommitdiff
path: root/Player.h
blob: 29080e1ee655a586fd35e8c83c00ca0baaa193ba (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
#ifndef PLAYER_H__
#define PLAYER_H__

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

#include <stdint.h>
#include "Unit.h"

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

/* **************************************
 *  Structs and enums                   *
 * **************************************/

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

class Player
{
    public:
        enum tResource
        {
            RESOURCE_TYPE_WOOD,
            RESOURCE_TYPE_FOOD,
            RESOURCE_TYPE_GOLD,

            MAX_RESOURCE_TYPES
        };

        explicit Player(const char* const strPlayerName);
        virtual void drawHandler(void) = 0;
        const char* getName(void) {return _name;}
        void setName(const char* const strName);

    protected:
        enum
        {
            MAX_NAME_LENGTH = 16,
            MAX_UNITS = 32
        };

        void handleUnits(void);
        void drawUnits(void);
        uint16_t _resourcesMap[MAX_RESOURCE_TYPES];
        char _name[MAX_NAME_LENGTH];
        Unit _unitsMap[MAX_UNITS];
};

#endif /* PLAYER_H__ */