-
Notifications
You must be signed in to change notification settings - Fork 98
Fix inexhaustible granite mine production #1918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,4 +102,46 @@ BOOST_FIXTURE_TEST_CASE(MetalWorkerOrders, WorldWithGCExecution1P) | |
| RTTR_EXEC_TILL(1300, mw->is_working); | ||
| } | ||
|
|
||
| BOOST_FIXTURE_TEST_CASE(GraniteMineWithoutResourcesNeedsAddon, WorldWithGCExecution1P) | ||
| { | ||
| GoodsAndPeopleCounts inv; | ||
| inv[GoodType::Fish] = 10; | ||
| inv[GoodType::PickAxe] = 1; | ||
| inv[Job::Miner] = 1; | ||
| world.GetSpecObj<nobBaseWarehouse>(hqPos)->AddToInventory(inv, true); | ||
|
|
||
| MapPoint minePos = hqPos + MapPoint(2, 0); | ||
| const auto* mine = static_cast<nobUsual*>( | ||
| BuildingFactory::CreateBuilding(world, BuildingType::GraniteMine, minePos, curPlayer, Nation::Romans)); | ||
| this->BuildRoad(world.GetNeighbour(minePos, Direction::SouthEast), false, | ||
| std::vector<Direction>(2, Direction::West)); | ||
|
|
||
| const Inventory& curInventory = world.GetPlayer(curPlayer).GetInventory(); | ||
| const unsigned initialStones = curInventory[GoodType::Stones]; | ||
| RTTR_EXEC_TILL(500, mine->HasWorker()); | ||
| RTTR_SKIP_GFS(2000); | ||
|
|
||
| BOOST_TEST(curInventory[GoodType::Stones] == initialStones); | ||
| } | ||
|
|
||
| BOOST_FIXTURE_TEST_CASE(InexhaustibleGraniteMineWorksWithoutResources, WorldWithGCExecution1P) | ||
| { | ||
| ggs.setSelection(AddonId::INEXHAUSTIBLE_GRANITEMINES, 1); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those 2 tests have the same setup, which I'd like to keep in sync and clearly the same. I see 2 ways:
I'm concerned by a (purely theoretical though) difference: - RTTR_EXEC_TILL(500, mine->HasWorker());
- RTTR_SKIP_GFS(2000);
+ RTTR_EXEC_TILL(3000, curInventory[GoodType::Stones] > initialStones);In 2nd case
The name Currently not sure if the logic of when the worker starts (trying) to work again works with that though in which case the fixture needs to be used. What do you think?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 70/30 AI i' use RTTR since 2024. now i'am more familiar with programming due to ai,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i will check on that later. |
||
|
|
||
| GoodsAndPeopleCounts inv; | ||
| inv[GoodType::Fish] = 10; | ||
| inv[GoodType::PickAxe] = 1; | ||
| inv[Job::Miner] = 1; | ||
| world.GetSpecObj<nobBaseWarehouse>(hqPos)->AddToInventory(inv, true); | ||
|
|
||
| MapPoint minePos = hqPos + MapPoint(2, 0); | ||
| BuildingFactory::CreateBuilding(world, BuildingType::GraniteMine, minePos, curPlayer, Nation::Romans); | ||
| this->BuildRoad(world.GetNeighbour(minePos, Direction::SouthEast), false, | ||
| std::vector<Direction>(2, Direction::West)); | ||
|
|
||
| const Inventory& curInventory = world.GetPlayer(curPlayer).GetInventory(); | ||
| const unsigned initialStones = curInventory[GoodType::Stones]; | ||
| RTTR_EXEC_TILL(3000, curInventory[GoodType::Stones] > initialStones); | ||
| } | ||
|
|
||
| BOOST_AUTO_TEST_SUITE_END() | ||
Uh oh!
There was an error while loading. Please reload this page.