1 /*************************************************************************** 2 * Mechanized Assault and Exploration Reloaded Projectfile * 3 * * 4 * This program is free software; you can redistribute it and/or modify * 5 * it under the terms of the GNU General Public License as published by * 6 * the Free Software Foundation; either version 2 of the License, or * 7 * (at your option) any later version. * 8 * * 9 * This program is distributed in the hope that it will be useful, * 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 * GNU General Public License for more details. * 13 * * 14 * You should have received a copy of the GNU General Public License * 15 * along with this program; if not, write to the * 16 * Free Software Foundation, Inc., * 17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 ***************************************************************************/ 19 20 #ifndef game_startup_local_hotseat_localhotseatgamenewH 21 #define game_startup_local_hotseat_localhotseatgamenewH 22 23 #include <memory> 24 #include <vector> 25 #include <utility> 26 27 #include "game/startup/local/hotseat/localhotseatgame.h" 28 #include "game/data/player/playerbasicdata.h" 29 #include "maxrconfig.h" 30 #include "utility/position.h" 31 #include "utility/signal/signal.h" 32 #include "utility/signal/signalconnectionmanager.h" 33 34 class cApplication; 35 class cStaticMap; 36 class cGameSettings; 37 class cPlayerColor; 38 class cPosition; 39 class cUnitUpgrade; 40 41 struct sLandingUnit; 42 struct sID; 43 44 class cLocalHotSeatGameNew : public cLocalHotSeatGame 45 { 46 struct sPlayerData 47 { 48 cPlayerBasicData basicData; 49 int clan; 50 std::vector<sLandingUnit> landingUnits; 51 std::vector<std::pair<sID, cUnitUpgrade>> unitUpgrades; 52 cPosition landingPosition; 53 }; 54 public: 55 cLocalHotSeatGameNew(); 56 57 void start (cApplication& application); 58 59 void setGameSettings (std::shared_ptr<cGameSettings> gameSettings); 60 61 void setStaticMap (std::shared_ptr<cStaticMap> staticMap); 62 63 void setPlayers (const std::vector<cPlayerBasicData>& players); 64 65 void setPlayerClan (size_t playerIndex, int clan); 66 67 void setLandingUnits (size_t playerIndex, std::vector<sLandingUnit> landingUnits); 68 69 void setUnitUpgrades (size_t playerIndex, std::vector<std::pair<sID, cUnitUpgrade>> unitUpgrades); 70 71 void setLandingPosition (size_t playerIndex, const cPosition& landingPosition); 72 73 const std::shared_ptr<cStaticMap>& getStaticMap(); 74 const std::shared_ptr<cGameSettings>& getGameSettings(); 75 76 size_t getPlayerCount() const; 77 const cPlayerBasicData& getPlayer (size_t playerIndex) const; 78 int getPlayerClan (size_t playerIndex) const; 79 private: 80 cSignalConnectionManager signalConnectionManager; 81 82 std::shared_ptr<cStaticMap> staticMap; 83 std::shared_ptr<cGameSettings> gameSettings; 84 85 std::vector<sPlayerData> playersData; 86 }; 87 88 #endif // game_startup_local_hotseat_localhotseatgamenewH 89