71 lines
1.8 KiB
C++
71 lines
1.8 KiB
C++
#ifndef __PLAYER_HEADER__
|
|
#define __PLAYER_HEADER__
|
|
|
|
/* **************************************
|
|
* Includes *
|
|
* **************************************/
|
|
|
|
#include "Global_Inc.h"
|
|
#include "GameStructures.h"
|
|
#include "Camera.h"
|
|
#include "Building.h"
|
|
#include "Unit.h"
|
|
|
|
/* **************************************
|
|
* Defines *
|
|
* **************************************/
|
|
|
|
#define PLAYER_NAME_LENGTH 16
|
|
#define PLAYER_MAX_UNITS 32
|
|
#define PLAYER_MAX_BUILDINGS 32
|
|
|
|
/* **************************************
|
|
* Structs and enums *
|
|
* **************************************/
|
|
|
|
/* **************************************
|
|
* Class definition *
|
|
* **************************************/
|
|
|
|
class Player
|
|
{
|
|
public:
|
|
Player();
|
|
~Player();
|
|
void Init(void);
|
|
void Handler(void);
|
|
void DrawHandler(void);
|
|
char * getName(void) {return name;}
|
|
void setHuman(bool value) { human = value; }
|
|
bool isHuman(void) {return human;}
|
|
bool createUnit(uint8_t id, TYPE_COLLISION_BLOCK cb);
|
|
bool createBuilding(uint8_t id, TYPE_COLLISION_BLOCK cb);
|
|
uint8_t getPopulation(void) {return (unit_i + 1);}
|
|
uint8_t getBuildings(void) {return (bldg_i + 1);}
|
|
|
|
private:
|
|
bool checkNewBuildingPosition(TYPE_COLLISION_BLOCK * cb);
|
|
void UnitBuildingSelection(void);
|
|
void showHealth(uint8_t hp);
|
|
void ButtonHandler(void);
|
|
void BuildingUnitActions(void);
|
|
TYPE_COLLISION_BLOCK GetCursorPos(void);
|
|
|
|
char name[PLAYER_NAME_LENGTH];
|
|
TYPE_UNIT units[PLAYER_MAX_UNITS];
|
|
TYPE_BUILDING buildings[PLAYER_MAX_BUILDINGS];
|
|
TYPE_UNIT* selectedUnit;
|
|
TYPE_BUILDING* selectedBuilding;
|
|
uint8_t id;
|
|
uint8_t unit_i;
|
|
uint8_t bldg_i;
|
|
bool human;
|
|
bool showUnitBuildingOptions;
|
|
TYPE_CAMERA Camera;
|
|
TYPE_RESOURCES Resources;
|
|
uint8_t progress_bar;
|
|
//Print _serial;
|
|
};
|
|
|
|
#endif //PLAYER_HEADER__
|