-- .maxNumberTribe = nil or integer or table with the keys and values specified below
-- or function(tribe,item) --> number
-- if nil, there is no maximum number of the item that can be built
-- if integer, the number is the maximum of the item that can be built by that tribe
-- if function, the returned value is the number of the item the tribe can build
-- if table, consider these keys and values, rounding down at the end of the calculation
-- .base = number or nil
-- base number
-- nil means 0
-- .max = number or nil
-- maximum number even if calculation would be larger
-- nil means no limit
-- .min = number or nil
-- minimum number even if calculation would be larger
-- nil means no limit
-- .turn = number or nil
-- increment limit by the value each turn
-- nil means no change
-- .tribeTotals = nil or {[luaObject or "cities" or "population"] = number or nil}
-- for each luaObject the tribe owns, increment the limit by the corresponding value
-- nil means 0
-- if unitType, increment by the number of units owned
-- if improvement, increment by the number of cities that have that improvement
-- if wonder, increment if the wonder is owned by the tribe
-- if technology, increment if tribe has the technology
-- if tribe, increment by value if the tribeObject is the tribe building the object
-- if "cities", increment for each city owned by the tribe
-- if "population", increment for each population point of the tribe
--
-- .globalTotals = nil or {[luaObject or "cities" or "population"] = number or nil}
-- for each luaObject in the world, increment the limit by the corresponding value
-- nil means 0
-- if unitType, increment by the number of units owned by all players
-- if improvement, increment by the number of cities that have that improvement among all players
-- if wonder, increment if the wonder is owned by any tribe
-- if technology, increment for each tribe that has the technology
-- if tribe, increment by value if the tribeObject is active in the game
-- if "cities", increment for each city in the game
-- if "population", increment for each population point of all cities in the game
--
-- .activeWondersTribe = nil or {[wonderObject] = number or nil}
-- if the tribe owns the wonder, and it is not expired, add the increment
-- .activeWondersForeign = nil or {[wonderObject] = number or nil}
-- if another tribe owns the wonder, and it is not expired, add the increment
-- .discoveredTechs = nil or {[techObject] = number or nil}
-- if the tech is discovered by any tribe, add the increment
-- .trueFlags = nil or {[flagKey] = number or nil}
-- if the flag associated with flagKey is true, add the value to the production limit
-- .counterValues = nil or {[counterKey] = number or nil}
-- for each counter specified by counterKey, multiply the value of the counter by the
-- number specified, and add that product to the production limit
-- .customFunction = nil or function(tribe,item) -> number
-- if a function is provided, add the output of the function to the production limit
--
-- .tribeJointMaxWith = nil or {[luaObject] = number or nil}
-- each of the tribe's instance of luaObject in the table uses up a portion of the ownership
-- limit for the item in question, with that portion given by the value
-- e.g. unitTypeBuild[object.uSettlers.id] = {maxNumberTribe = 6,
-- tribeJointMaxWith = {[object.uEngineers]=2}}
-- and unitTypeBuild[object.uEngineers.id] = {maxNumberTribe = 3,
-- tribeJointMaxWith = {[object.uSettlers] = 0.5}}
-- Here, the limit is 6 settlers, or 3 engineers, with an engineer using up 2 settler
-- allotments, and a settler using up 0.5 engineer allotments.
-- By default, the item we're checking if we can produce is given a cost of 1,
-- but we can specify a different number instead. Here is another way to have
-- 6 settlers or 3 engineers:
-- e.g. unitTypeBuild[object.uSettlers.id] = {maxNumberTribe = 6,
-- tribeJointMaxWith = {[object.uSettlers] = 1, [object.uEngineers]=2}}
-- and unitTypeBuild[object.uEngineers.id] = {maxNumberTribe = 6,
-- tribeJointMaxWith = {[object.uSettlers] = 1, [object.uEngineers]=2}}
--
--
--
-- .maxNumberGlobal = nil or integer or table with the keys and values specified below
-- or function(tribe,item) --> number
-- if nil, there is no maximum number of the item that can be built
-- if integer, the number is the maximum of the item that can be built by all tribes together
-- if function, the returned value is the number of the item that can be built in the world
-- if table, consider these keys and values, rounding down at the end of the calculation
-- for the maximum number for all tribes together
-- .base = integer or nil
-- base number
-- nil means 0
-- .max = integer or nil
-- maximum number even if calculation would be larger
-- nil means no limit
-- .min = integer or nil
-- minimum number even if calculation would be larger
-- nil means no limit
-- .turn = number or nil
-- increment limit by the value each turn
-- nil means no change
-- .globalTotals = nil or {[luaObject or "cities" or "population"] = number or nil}
-- for each luaObject in the world, increment the limit by the corresponding value
-- nil means 0
-- if unitType, increment by the number of units owned by all players
-- if improvement, increment by the number of cities that have that improvement among all players
-- if wonder, increment if the wonder is owned by any tribe
-- if technology, increment for each tribe that has the technology
-- if tribe, increment by value if the tribeObject is active in the game
-- if "cities", increment for each city in the game
-- if "population", increment for each population point of all cities in the game
--
-- .activeWonders = nil or {[wonderObject] = number or nil}
-- if the wonder is built and it is not expired, add the increment
-- .discoveredTechs = nil or {[techObject] = number or nil}
-- if the tech is discovered by any tribe, add the increment
-- .trueFlags = nil or {[flagKey] = number or nil}
-- if the flag associated with flagKey is true, add the value to the production limit
-- .counterValues = nil or {[counterKey] = number or nil}
-- for each counter specified by counterKey, multiply the value of the counter by the
-- number specified, and add that product to the production limit
-- .customFunction = nil or function(tribe,item) -> number
-- if a function is provided, add the output of the function to the production limit
--
-- .globalJointMaxWith = nil or {[luaObject] = number or nil}
-- each instance of luaObject in the table uses up a portion of the ownership
-- limit for the item in question, with that portion given by the value
-- e.g. unitTypeBuild[object.uSettlers.id] = {maxNumberGlobal = 6,
-- globalJointMaxWith = {[object.uEngineers]=2}}
-- and unitTypeBuild[object.uEngineers.id] = {maxNumberGlobal = 3,
-- globalJointMaxWith = {[object.uSettlers] = 0.5}}
-- Here, the limit is 6 settlers, or 3 engineers, with an engineer using up 2 settler
-- allotments, and a settler using up 0.5 engineer allotments.
-- By default, the item we're checking if we can produce is given a cost of 1,
-- but we can specify a different number instead. Here is another way to have
-- 6 settlers or 3 engineers:
-- e.g. unitTypeBuild[object.uSettlers.id] = {maxNumberGlobal = 6,
-- globalJointMaxWith = {[object.uSettlers] = 1, [object.uEngineers]=2}}
-- and unitTypeBuild[object.uEngineers.id] = {maxNumberGlobal = 6,
-- globalJointMaxWith = {[object.uSettlers] = 1, [object.uEngineers]=2}}
--