Comment 31 for bug 1074353

Revision history for this message
SirVer (sirver) wrote :

Okay, I did some work here now.

1,2) Seems to be working for me. At least this prints three lines with the correct count (and same for .inputs)
game = wl.Game()
b = game:get_building_description("barbarians", "deeper_coalmine")
for name, count in pairs(b.working_positions) do
   print(name, count)
end
print(b.nr_working_positions) -- outputs 3

3, 4) Did not start on this. Do you want to try it or should I give it a shot?

5) Added a bunch of comments. Getting the parameters of the building programs (or the worker programs for that matter) is complicated and I have no clear concept on how it can be done right now easily without wrapping every supported program - which is more work than keeping the hardcoding up to date.