1
1
#include " MapViewState.h"
2
+ #include " ColonyShip.h"
2
3
3
4
#include " MapViewStateHelper.h"
4
5
@@ -224,7 +225,6 @@ MapViewState::MapViewState(GameState& gameState, const Planet::Attributes& plane
224
225
mColonyShip {gameState.colonyShip ()}
225
226
{
226
227
setMeanSolarDistance (mPlanetAttributes .meanSolarDistance );
227
- setPopulationLevel (PopulationLevel::Large);
228
228
ccLocation () = CcNotPlaced;
229
229
NAS2D::Utility<NAS2D::EventHandler>::get ().windowResized ().connect ({this , &MapViewState::onWindowResized});
230
230
}
@@ -250,13 +250,6 @@ MapViewState::~MapViewState()
250
250
}
251
251
252
252
253
- void MapViewState::setPopulationLevel (PopulationLevel popLevel)
254
- {
255
- mLandersColonist = static_cast <int >(popLevel);
256
- mLandersCargo = 2 ; // /\todo This should be set based on difficulty level.
257
- }
258
-
259
-
260
253
/* *
261
254
* Initialize values, the UI and set up event handling.
262
255
*/
@@ -888,8 +881,8 @@ void MapViewState::placeStructure(Tile& tile)
888
881
s.deploySignal ().connect ({this , &MapViewState::onDeployColonistLander});
889
882
NAS2D::Utility<StructureManager>::get ().addStructure (s, tile);
890
883
891
- -- mLandersColonist ;
892
- if (mLandersColonist == 0 )
884
+ mColonyShip . onDeployColonistLander () ;
885
+ if (! mColonyShip . colonistLanders () )
893
886
{
894
887
clearMode ();
895
888
resetUi ();
@@ -904,8 +897,8 @@ void MapViewState::placeStructure(Tile& tile)
904
897
cargoLander.deploySignal ().connect ({this , &MapViewState::onDeployCargoLander});
905
898
NAS2D::Utility<StructureManager>::get ().addStructure (cargoLander, tile);
906
899
907
- -- mLandersCargo ;
908
- if (mLandersCargo == 0 )
900
+ mColonyShip . onDeployCargoLander () ;
901
+ if (! mColonyShip . cargoLanders () )
909
902
{
910
903
clearMode ();
911
904
resetUi ();
0 commit comments