Duke176
Warlord
hi all,
another question from a nooooooob modder
.
can anyone explain me this function from cvplayer.cpp?
I can really understand where iChange come and if iNewValue is == with (getGold() + iChange)? Shouldn't come for other functions to calculate goldperturn for ex.?
I can really understand it, it's almost a week I'm studying it but I cannot get it clear...
thx
another question from a nooooooob modder

can anyone explain me this function from cvplayer.cpp?
int CvPlayer::getGold()
{
return m_iGold;
}
void CvPlayer::setGold(int iNewValue)
{
if (getGold() != iNewValue)
{
m_iGold = iNewValue;
if (getID() == GC.getGameINLINE().getActivePlayer())
{
gDLL->getInterfaceIFace()->setDirty(MiscButtons_DIRTY_BIT, true);
gDLL->getInterfaceIFace()->setDirty(SelectionButtons_DIRTY_BIT, true);
gDLL->getInterfaceIFace()->setDirty(GameData_DIRTY_BIT, true);
}
}
}
void CvPlayer::changeGold(int iChange)
{
setGold(getGold() + iChange);
}
I can really understand where iChange come and if iNewValue is == with (getGold() + iChange)? Shouldn't come for other functions to calculate goldperturn for ex.?
I can really understand it, it's almost a week I'm studying it but I cannot get it clear...



thx