World Size

OrionVeteran

Deity
Joined
Dec 25, 2003
Messages
2,443
Location
Newport News VA
I am trying to obtain the world size for the current game expressed in SDK. These lines both failed.

Code:
WorldSizeTypes eWorldSize = (WorldSizeTypes)GC.getWorldInfo(GC.getMapINLINE().getWorldSize());

WorldSizeTypes eWorldSize = GC.getWorldInfo(GC.getMapINLINE().getWorldSize());

How do I fix this line?
 
Code:
GC.getMapINLINE().getWorldSize()

Already returns the world size type, so:
Code:
WorldSizeTypes eWorldSize = GC.getMapINLINE().getWorldSize();

If you also want the relevant information, you need:
Code:
const CvWorldInfo& info = GC.getWorldInfo(eWorldSize);

Or you can skip the extra variables and use it immediately:
Code:
int percent = GC.getWorldInfo(GC.getMapINLINE().getWorldSize()).getNumCitiesMaintenancePercent();
 
Code:
GC.getMapINLINE().getWorldSize()

Already returns the world size type, so:
Code:
WorldSizeTypes eWorldSize = GC.getMapINLINE().getWorldSize();

If you also want the relevant information, you need:
Code:
const CvWorldInfo& info = GC.getWorldInfo(eWorldSize);

Or you can skip the extra variables and use it immediately:
Code:
int percent = GC.getWorldInfo(GC.getMapINLINE().getWorldSize()).getNumCitiesMaintenancePercent();

It worked! ...Another callback converted to SDK. :banana:

:thanx:
 
Back
Top Bottom