update
This commit is contained in:
+21
-1
@@ -16,7 +16,16 @@ enum class ActionMode {
|
||||
None,
|
||||
Move,
|
||||
Attack,
|
||||
BuildCity
|
||||
BuildCity,
|
||||
BuildFarm
|
||||
};
|
||||
|
||||
struct TileImprovement {
|
||||
QString improvementId; // "farm"
|
||||
int tileX;
|
||||
int tileY;
|
||||
int playerId;
|
||||
QVector3D worldPos;
|
||||
};
|
||||
|
||||
struct FloatingText {
|
||||
@@ -65,10 +74,20 @@ public:
|
||||
void exitCityView();
|
||||
|
||||
CityYieldSummary calculateCityYields(const City &city, Matrix2D<TerrainPoint> *mapPoints, int numPoints05) const;
|
||||
void processTickYields(Matrix2D<TerrainPoint> *mapPoints, int numPoints05);
|
||||
|
||||
bool isTileOwned(int tx, int ty, int *outOwnerCityId = nullptr) const;
|
||||
bool buyTileForCity(int cityId, int tx, int ty);
|
||||
|
||||
void commandMoveSelected(int targetX, int targetY, Matrix2D<TerrainPoint> *mapPoints, int numPoints05);
|
||||
void commandAttack(Unit *target);
|
||||
void commandBuildCitySelected(Matrix2D<TerrainPoint> *mapPoints, int numPoints05);
|
||||
void commandBuildFarmSelected(Matrix2D<TerrainPoint> *mapPoints, int numPoints05);
|
||||
void completeUnitBuilding(Unit &unit, Matrix2D<TerrainPoint> *mapPoints, int numPoints05);
|
||||
|
||||
const std::map<std::pair<int, int>, TileImprovement>& getTileImprovements() const { return m_tileImprovements; }
|
||||
const TileImprovement* getImprovementAt(int tx, int ty) const;
|
||||
bool hasImprovementAt(int tx, int ty) const;
|
||||
|
||||
float getTickDuration() const { return m_movementTickDuration; }
|
||||
void setTickDuration(float d) { m_movementTickDuration = std::max(1.0f, d); }
|
||||
@@ -94,6 +113,7 @@ private:
|
||||
std::vector<std::shared_ptr<Unit>> m_units;
|
||||
std::vector<City> m_cities;
|
||||
std::vector<FloatingText> m_floatingTexts;
|
||||
std::map<std::pair<int, int>, TileImprovement> m_tileImprovements;
|
||||
|
||||
int m_selectedUnitId;
|
||||
int m_activeCityViewId;
|
||||
|
||||
Reference in New Issue
Block a user