diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2018-07-10 00:04:16 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2018-07-10 00:04:16 +0200 |
| commit | 14c12aeea30d59e9c811f1cc8c7019053d646033 (patch) | |
| tree | 7bff078a702a1b2949c37930adfc6fd2fc45c3cb /Player.cpp | |
| parent | 188d74cb789f33967daf6daa5af17d41b6f59d4e (diff) | |
More work on Unit/BaseUnit concepts.
Diffstat (limited to 'Player.cpp')
| -rw-r--r-- | Player.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -34,8 +34,14 @@ * \brief Constructor for Player class. * *********************************************************************/ -Player::Player(const char* const strPlayerName) +Player::Player(const char* const strPlayerName): +_name{'\0'} { + enum + { + DEFAULT_RESOURCES = 300 + }; + if (strPlayerName != NULL) { strncpy(_name, strPlayerName, MAX_NAME_LENGTH); @@ -44,4 +50,7 @@ Player::Player(const char* const strPlayerName) { /* Undefined player name. */ } + + /* Set all resources to default value. */ + memset(_resourcesMap, DEFAULT_RESOURCES, sizeof(uint8_t) * MAX_RESOURCE_TYPES); } |
