← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/furnace into lp:widelands

 

I'm not that familiar with lua, so I would like someone to doublecheck my assumptions.

I see that the code calls
local rv = plr:get_buildings{"well", "burners_house"}

The way I've interpreted this is that it gives me a map which contains building names as the keys and the amount of those buildings as the values. So if the player has two wells, calling #rv.well would look up the value associated with that key and return 2.

So the keys of the map seem to be available as attributes of rv, but it is not clear to me how  for instance #rv.well came into existance. Is this populated by the parameters passed to get_buildings (or perhaps all building types available to a player)? Basically I want to know whether #rv.charcoal_kiln will exist or if I need to do something more in order to create this attribute?

-- 
https://code.launchpad.net/~widelands-dev/widelands/furnace/+merge/227810
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/furnace.


References