Skip to content

Commit

Permalink
Add getProvinceID to CyCity (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
VDuchauffour committed May 6, 2024
1 parent 1c136d0 commit be253bd
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
Binary file modified Assets/CvGameCoreDLL.dll
Binary file not shown.
5 changes: 5 additions & 0 deletions CvGameCoreDLL/CvCity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14582,6 +14582,11 @@ int CvCity::getProvince()
return provinceMap[getY_INLINE() * EARTH_X + getX_INLINE()];
};

int CvCity::getProvinceID() const
{
return plot()->getProvinceID();
};

int CvCity::getNumForeignReligions()
{
int iLoopReligion, iCount = 0, iStateReligion;
Expand Down
2 changes: 1 addition & 1 deletion CvGameCoreDLL/CvCity.h
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ class CvCity : public CvDLLEntity

// 3MiroProvinces
int getProvince();

int getProvinceID() const;
// 3MiroBuildings: StarFort bombard immune defense
int getBombImmuneDefense() const;
void chnageBombImmuneDefense(int iChange);
Expand Down
6 changes: 6 additions & 0 deletions CvGameCoreDLL/CyCity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2349,6 +2349,12 @@ int CyCity::getProvince()
{
return m_pCity->getProvince();
};

int CyCity::getProvinceID()
{
return m_pCity ? m_pCity->getProvinceID() : -1;
};

int CyCity::getNumForeignReligions()
{
return m_pCity->getNumForeignReligions();
Expand Down
1 change: 1 addition & 0 deletions CvGameCoreDLL/CyCity.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ class CyCity

// 3MiroProvinces
int getProvince();
int getProvinceID();

// 3Miro: some tests for stability
int getNumForeignReligions();
Expand Down
3 changes: 2 additions & 1 deletion CvGameCoreDLL/CyCityInterface1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,9 +607,10 @@ void CyCityPythonInterface1(python::class_<CyCity> &x)
// 3Miro: New functions
// Absinthe: with the new persecution code added from SoI, these functions are currently unused
/*.def("canPurgeReligion", &CyCity::canPurgeReligion, "bool ()")
.def("doPurgeReligions", &CyCity::doPurgeReligions, "void ()")*/
.def("doPurgeReligions", &CyCity::doPurgeReligions, "void ()")*/
// Absinthe: end
.def("getProvince", &CyCity::getProvince, "int ()")
.def("getProvinceID", &CyCity::getProvinceID, "int ()")

.def("getNumForeignReligions", &CyCity::getNumForeignReligions, "int ()");
}

0 comments on commit be253bd

Please sign in to comment.