diff options
| author | XaviDCR92 <xavi.dcr@gmail.com> | 2018-07-26 21:22:28 +0200 |
|---|---|---|
| committer | XaviDCR92 <xavi.dcr@gmail.com> | 2018-07-26 21:22:28 +0200 |
| commit | c3a69de5c2e822d91e8284ac65eda83fed6476ba (patch) | |
| tree | fce44421bdb8230cfcb2b614ea00b26439f4e67d /HumanPlayer.cpp | |
| parent | bfdc0b9f497ef10f6687abcc55d93405c611af11 (diff) | |
+ BaseUnit.cpp, BaseUnit.h: added simple member functions for extracting BaseUnit protected data.
+ HumanPlayer.cpp: started implementing unit selection. Still TODO.
Diffstat (limited to 'HumanPlayer.cpp')
| -rw-r--r-- | HumanPlayer.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/HumanPlayer.cpp b/HumanPlayer.cpp index d13bc6b..02bda69 100644 --- a/HumanPlayer.cpp +++ b/HumanPlayer.cpp @@ -123,4 +123,28 @@ void HumanPlayer::drawHandler(void) *********************************************************************/ enum tPlayerState HumanPlayer::selectUnit(void) { + for (size_t szUnit = 0; szUnit < MAX_UNITS; szUnit++) + { + /* Select Unit object from internal table. */ + Unit& u = _unitsMap[szUnit]; + + if (u.isAlive()) + { + if (not u.isSelected()) + { + /* Extract Unit object X position. */ + const uint16_t x = u.getX(); + +#error ("TODO") + } + else + { + /* Unit is already selected. Continue. */ + } + } + else + { + /* Unit is not alive. Continue. */ + } + } } |
