Add trade

This commit is contained in:
Nate Bowman
2026-11-07 18:50:46 -05:00
parent 0d40fe5dc0
commit 1a66084d32
8 changed files with 63 additions and 6 deletions

View File

@@ -307,3 +307,37 @@ class TestWorld(unittest.TestCase):
game.play_until(training + 60)
self.assertResourcesMatch([500 + gathered, 425, 500, 500], game.world)
def test_trade_cog(self):
game = Gameplay()
# just cheat
game.world.age = Ages.FEUDAL
game.world.gather.resources = [500, 500, 500, 500]
game.world._add_building(Buildings.DOCK, {}, {})
game.queue_trade_cog(0)
training = 36
gathered = 25.9
game.play_until(training + 60)
self.assertResourcesMatch([500, 400, 450 + gathered, 500], game.world)
def test_trade_cart(self):
game = Gameplay()
# just cheat
game.world.age = Ages.FEUDAL
game.world.gather.resources = [500, 500, 500, 500]
game.world._add_building(Buildings.MARKET, {}, {})
game.queue_trade_cart(0)
training = 51
gathered = 25.9
game.play_until(training + 60)
self.assertResourcesMatch([500, 400, 450 + gathered, 500], game.world)