Queue: no length cap, make up to 9,999
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d564164edf
commit
a723558fb2
4 changed files with 10 additions and 13 deletions
|
|
@ -138,13 +138,12 @@ class ActionTest(unittest.TestCase):
|
|||
self.assertEqual(p["action"]["id"], "smith_copper_helmet") # nothing being made: it just starts
|
||||
self.assertEqual(p["action"]["resume"], "mine_stone")
|
||||
p["bank"] = {}
|
||||
for _ in range(game.QUEUE_MAX):
|
||||
self.assertIsNone(game.queue_add(world, p, "smith_copper_helmet", 1, T0)) # bars aren't checked yet
|
||||
self.assertEqual(game.queue_add(world, p, "smith_copper_helmet", 1, T0), f"Queue full ({game.QUEUE_MAX})")
|
||||
for _ in range(20):
|
||||
self.assertIsNone(game.queue_add(world, p, "smith_copper_helmet", 1, T0)) # no cap; bars aren't checked yet
|
||||
high = next(a["id"] for a in game.ACTIONS if game.queueable(a) and a["skill"] == "smithing" and a["level"] > 10)
|
||||
self.assertTrue(game.queue_add(world, p, high, 1, T0).startswith("Needs level"))
|
||||
self.assertIsNone(game.queue_remove(p, 0))
|
||||
self.assertEqual(len(p["queue"]), game.QUEUE_MAX - 1)
|
||||
self.assertEqual(len(p["queue"]), 19)
|
||||
game.drop_out(world, p, T0)
|
||||
self.assertEqual(p["queue"], [])
|
||||
game.start_action(world, p, "cut_logs", T0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue