From c3a69de5c2e822d91e8284ac65eda83fed6476ba Mon Sep 17 00:00:00 2001 From: XaviDCR92 Date: Thu, 26 Jul 2018 21:22:28 +0200 Subject: + BaseUnit.cpp, BaseUnit.h: added simple member functions for extracting BaseUnit protected data. + HumanPlayer.cpp: started implementing unit selection. Still TODO. --- HumanPlayer.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'HumanPlayer.cpp') 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. */ + } + } } -- cgit v1.2.3