diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2018-07-26 21:15:59 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2018-07-26 21:15:59 +0200 |
| commit | bfdc0b9f497ef10f6687abcc55d93405c611af11 (patch) | |
| tree | 43914b2eada0bf5fb09093d61a250d4930b57a5d /Cursor.h | |
| parent | 853c6cddaa2713a9eb0c1f1c55e3f61592f04a46 (diff) | |
| download | pocketempires-bfdc0b9f497ef10f6687abcc55d93405c611af11.tar.gz | |
* Menu.cpp: actions for CHOICE_SINGLE_PLAYER_GAME have been moved to a new function called MainMenuSinglePlayer().
+ BaseUnit.cpp, BaseUnit.h: new _selected flag.
+ Camera.cpp, Camera.h: linear movement has been taken over quadratic movement. Also, cursor now moves if dealing with screen borders.
+ Cursor.cpp, Cursor.h: new Cursor class holds cursor X/Y information. It is meant to be contained inside a HumanPlayer object.
* Game.cpp: minor changes in casts and comments.
+ HumanPlayer.cpp: added callbacks for button release events.
* HumanPlayer.cpp, HumanPlayerBtn.cpp: button handling has been transferred from HumanPlayer.cpp to HumanPlayerBtn.cpp in order to improve modularity.
+ Sprite.cpp: sprite data was not being checked against NULL.
- Unit.cpp: drawHandler() is now executed by Player object.
Diffstat (limited to 'Cursor.h')
| -rw-r--r-- | Cursor.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Cursor.h b/Cursor.h new file mode 100644 index 0000000..33ba008 --- /dev/null +++ b/Cursor.h @@ -0,0 +1,47 @@ +#ifndef CURSOR_H__ +#define CURSOR_H__ + +/* ******************************************************************* + * Includes + * ******************************************************************/ + +#include <stdbool.h> +#include <stdint.h> + +/* ******************************************************************* + * Defines + * ******************************************************************/ + +/* ******************************************************************* + * Global types definition + * ******************************************************************/ + +/* ******************************************************************* + * Global variables declaration + * ******************************************************************/ + +/* ******************************************************************* + * Global functions declaration + * ******************************************************************/ + +/* ******************************************************************* + * Class definition + * ******************************************************************/ + +class Cursor +{ + public: + explicit Cursor(void); + void move(const int8_t x = 0, const int8_t y = 0); + uint8_t getX(void); + uint8_t getY(void); + bool isXCentered(void); + bool isYCentered(void); + + private: + uint8_t _x; + uint8_t _y; +}; + +#endif /* CURSOR_H__ */ + |
