diff options
Diffstat (limited to 'Player.cpp')
| -rw-r--r-- | Player.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -3,6 +3,7 @@ * ******************************************************************/ #include "Player.h" +#include "Unit.h" #include <string.h> /* ******************************************************************* @@ -54,3 +55,27 @@ _name{'\0'} /* Set all resources to default value. */ memset(_resourcesMap, DEFAULT_RESOURCES, sizeof(uint8_t) * MAX_RESOURCE_TYPES); } + +void Player::handleUnits(void) +{ + for (size_t szUnit = 0; szUnit < MAX_UNITS; szUnit++) + { + /* Select Unit object from internal table. */ + Unit& unit = _unitsMap[szUnit]; + + /* Execute unit handler. */ + unit.handler(); + } +} + +void Player::drawUnits(void) +{ + for (size_t szUnit = 0; szUnit < MAX_UNITS; szUnit++) + { + /* Select Unit object from internal table. */ + Unit& u = _unitsMap[szUnit]; + + /* Execute drawHandler for selected Unit. */ + u.drawHandler(); + } +} |
