what does pCity:IsCanPurchase take into account?

Craig_Sutter

Deity
Joined
Aug 13, 2002
Messages
2,773
Location
Calgary, Canada
I am using this api in several functions... but it occurs to me that I might be making said functions too complicated as pCity:IsCanPurchase may already be accounting for some factors.

For example, does the function:

- take into account resource availability
- take into account unit stacking
- take into account required buildings
- take into account other functions such as City:CanTrain?

If the above is true, then my functions can be trimmed quite a bit.

Thank-you.
 
Key process

// Can't purchase anything in a puppeted city, unless you're Venice
// Can't purchase things if the city is in resistance or is being razed
// if we're purchasing a unit, must be able to add it to the city tile
// if using faith, must have a majority religion
// call canTrain/canConstruct
// must have enough money/faith!!

canTrain/canConstruct are the Lua/C++ methods, not the events directly (the events are called as part of the methods, but the methods do a lot more)

so

1) yes
2) yes
3) yes
4) yes
 
Back
Top Bottom