Add slope calculation methods to terrainmovementmanager.h
This commit is contained in:
@@ -42,6 +42,11 @@ struct TerrainMovementConfig {
|
||||
float polarSnowFactorStart;
|
||||
float polarSnowFactorEnd;
|
||||
|
||||
float uphillSlopeMultiplier;
|
||||
float downhillSlopeBonusMultiplier;
|
||||
float minStepCost;
|
||||
float maxClimbableSlopeKm;
|
||||
|
||||
QMap<QString, float> movementCosts;
|
||||
QMap<QString, DomainMovementRule> domainRules;
|
||||
|
||||
@@ -57,6 +62,7 @@ public:
|
||||
bool loadConfig(const QString &filePath);
|
||||
|
||||
QString getTerrainType(int tx, int ty, Matrix2D<TerrainPoint> *mapPoints, int numPoints05) const;
|
||||
float getHexElevationKm(int tx, int ty, Matrix2D<TerrainPoint> *mapPoints, int numPoints05) const;
|
||||
|
||||
bool isTerrainPassable(
|
||||
const QString &terrainType,
|
||||
@@ -75,6 +81,15 @@ public:
|
||||
float getTerrainMovementCost(const QString &terrainType) const;
|
||||
float getHexMovementCost(int tx, int ty, Matrix2D<TerrainPoint> *mapPoints, int numPoints05) const;
|
||||
|
||||
float calculateStepCost(
|
||||
int fromX, int fromY,
|
||||
int toX, int toY,
|
||||
MovementDomain domain,
|
||||
Matrix2D<TerrainPoint> *mapPoints,
|
||||
int numPoints05,
|
||||
const UnitConfig *unitConfig = nullptr
|
||||
) const;
|
||||
|
||||
const TerrainMovementConfig& getConfig() const { return m_config; }
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user