68 lines
1.9 KiB
C++
68 lines
1.9 KiB
C++
#ifndef HUMAN_PLAYER_H__
|
|
#define HUMAN_PLAYER_H__
|
|
|
|
/* **************************************
|
|
* Includes *
|
|
* **************************************/
|
|
|
|
#include "Player.h"
|
|
#include "Camera.h"
|
|
#include "Cursor.h"
|
|
#include <string.h>
|
|
|
|
/* **************************************
|
|
* Defines *
|
|
* **************************************/
|
|
|
|
/* **************************************
|
|
* Structs and enums *
|
|
* **************************************/
|
|
|
|
/* **************************************
|
|
* Class definition *
|
|
* **************************************/
|
|
|
|
class HumanPlayer : public Player
|
|
{
|
|
public:
|
|
explicit HumanPlayer(const char* const strPlayerName, const Camera& cam);
|
|
void handler(void);
|
|
|
|
private:
|
|
enum tPlayerState
|
|
{
|
|
PLAYER_STATE_IDLE, /**< Player has not entered any menu or unit. */
|
|
PLAYER_STATE_UNIT_MENU, /**< Player has opened Unit menu. */
|
|
PLAYER_STATE_UNIT_SELECTED /**< Player has selected one or more units. */
|
|
} _eState; /**< Player action state. */
|
|
|
|
void drawHandler(void);
|
|
|
|
/* Button handlers. */
|
|
void buttonHandler(void);
|
|
void playerButtonPressedHandler(const size_t szBtn);
|
|
void cameraButtonPressedHandler(const size_t szBtn);
|
|
void playerButtonReleasedHandler(const size_t szBtn);
|
|
|
|
/* Pressed button event handlers. */
|
|
void onABtnPressed(void);
|
|
void onBBtnPressed(void);
|
|
|
|
/* Released button event handlers. */
|
|
void onABtnReleased(void);
|
|
void onBBtnReleased(void);
|
|
|
|
/* Unit selection. */
|
|
enum tPlayerState selectUnit(void);
|
|
|
|
/* Private objects. */
|
|
const Camera& _cam;
|
|
Cursor _cursor;
|
|
|
|
/* Private variables. */
|
|
uint8_t _ABtnFrames;
|
|
uint8_t _BBtnFrames;
|
|
};
|
|
|
|
#endif /* HUMAN_PLAYER_H__ */
|