77#include " RttrForeachPt.h"
88#include " buildings/nobBaseMilitary.h"
99#include " buildings/nobUsual.h"
10+ #include " desktops/dskGameInterface.h"
1011#include " factories/BuildingFactory.h"
1112#include " figures/nofFarmhand.h"
1213#include " figures/nofFisher.h"
13- #include " gameTypes/Resource.h"
14- #include " desktops/dskGameInterface.h"
1514#include " helpers/containerUtils.h"
1615#include " uiHelper/uiHelpers.hpp"
1716#include " worldFixtures/CreateEmptyWorld.h"
2120#include " nodeObjs/noEnvObject.h"
2221#include " nodeObjs/noStaticObject.h"
2322#include " gameTypes/GameTypesOutput.h"
23+ #include " gameTypes/Resource.h"
2424#include < boost/test/unit_test.hpp>
2525
2626// LCOV_EXCL_START
@@ -482,7 +482,6 @@ BOOST_FIXTURE_TEST_CASE(RoadRemovesObjs, EmptyWorldFixture1P)
482482 }
483483}
484484
485-
486485BOOST_FIXTURE_TEST_CASE (FisherIgnoresIsolatedFishWater, EmptyWorldFixture1PBiggest)
487486{
488487 const DescIdx<TerrainDesc> tWater = GetWaterTerrain (world.GetDescription ());
@@ -493,7 +492,6 @@ BOOST_FIXTURE_TEST_CASE(FisherIgnoresIsolatedFishWater, EmptyWorldFixture1PBigge
493492 BOOST_TEST_REQUIRE (fishery);
494493
495494 nofFisher fisher (fisheryPos, 0 , fishery);
496- const nofFarmhand& farmhand = fisher;
497495
498496 const MapPoint workPt = world.MakeMapPoint (fisheryPos + Position (4 , 0 ));
499497 const MapPoint fishPt = world.GetNeighbour (workPt, Direction::East);
@@ -514,13 +512,16 @@ BOOST_FIXTURE_TEST_CASE(FisherIgnoresIsolatedFishWater, EmptyWorldFixture1PBigge
514512
515513 makeWaterPoint (fishPt);
516514 world.SetResource (fishPt, Resource (ResourceType::Fish, 4 ));
515+ world.SetupResources ();
517516
518- BOOST_TEST_REQUIRE (static_cast < unsigned >(farmhand. GetPointQuality (workPt))
519- == static_cast < unsigned >( nofFarmhand::PointQuality::NotPossible));
517+ BOOST_TEST_REQUIRE (!world. GetNode (fishPt). resources . has (ResourceType::Fish));
518+ BOOST_TEST_REQUIRE ((fisher. GetPointQuality (workPt, false ) == nofFarmhand::PointQuality::NotPossible));
520519
521520 makeWaterPoint (world.GetNeighbour (fishPt, Direction::East));
521+ world.SetResource (fishPt, Resource (ResourceType::Fish, 4 ));
522+ world.SetupResources ();
522523
523- BOOST_TEST_REQUIRE (static_cast < unsigned >(farmhand. GetPointQuality (workPt))
524- == static_cast < unsigned >( nofFarmhand::PointQuality::Class1));
524+ BOOST_TEST_REQUIRE (world. GetNode (fishPt). resources . has (ResourceType::Fish));
525+ BOOST_TEST_REQUIRE ((fisher. GetPointQuality (workPt, false ) == nofFarmhand::PointQuality::Class1));
525526}
526527BOOST_AUTO_TEST_SUITE_END ()
0 commit comments