update
This commit is contained in:
@@ -29,6 +29,7 @@ public:
|
||||
|
||||
int inhabitants;
|
||||
int inhabitantsPerPop;
|
||||
int accumulatedLabor = 0; // Local resource (Arbeid)
|
||||
|
||||
std::vector<std::pair<int, int>> territory; // Owned hex coordinates
|
||||
std::map<std::pair<int, int>, QString> workedTiles; // (x, y) -> resource name
|
||||
@@ -36,6 +37,12 @@ public:
|
||||
City(int cId, int pId, const QString &cName, int tx, int ty, const QVector3D &pos,
|
||||
int initInhabitants = 1000, int initInhabitantsPerPop = 100000, int initRadius = 1);
|
||||
|
||||
bool addTerritory(int tx, int ty) {
|
||||
if (ownsTile(tx, ty)) return false;
|
||||
territory.emplace_back(tx, ty);
|
||||
return true;
|
||||
}
|
||||
|
||||
int getTotalPop() const {
|
||||
return (int)std::ceil((float)inhabitants / (float)std::max(1, inhabitantsPerPop));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user