Implement builder road construction with hex-edge auto-connection, winding rendering, and speed bonus
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef ROADCONFIG_H
|
||||
#define ROADCONFIG_H
|
||||
|
||||
#include <QString>
|
||||
#include <QMap>
|
||||
#include <QColor>
|
||||
|
||||
struct RoadTypeConfig {
|
||||
QString id = "dirt";
|
||||
QString name = "Dirt Road";
|
||||
float speedMultiplier = 1.30f;
|
||||
QString colorStr = "#c49a62";
|
||||
QString borderColorStr = "#6b4b23";
|
||||
float width = 3.5f;
|
||||
int cost = 5;
|
||||
|
||||
QColor getColor() const { return QColor(colorStr); }
|
||||
QColor getBorderColor() const { return QColor(borderColorStr); }
|
||||
};
|
||||
|
||||
class RoadConfigManager {
|
||||
public:
|
||||
RoadConfigManager();
|
||||
|
||||
bool loadConfigFile(const QString &filePath);
|
||||
const RoadTypeConfig* getRoadType(const QString &id) const;
|
||||
const QMap<QString, RoadTypeConfig>& getAllRoadTypes() const { return m_types; }
|
||||
|
||||
QString defaultRoadType() const { return m_defaultRoadType; }
|
||||
int buildDurationTicks() const { return m_buildDurationTicks; }
|
||||
float meanderAmplitude() const { return m_meanderAmplitude; }
|
||||
int meanderSubdivisions() const { return m_meanderSubdivisions; }
|
||||
|
||||
private:
|
||||
QString m_defaultRoadType;
|
||||
int m_buildDurationTicks;
|
||||
float m_meanderAmplitude;
|
||||
int m_meanderSubdivisions;
|
||||
QMap<QString, RoadTypeConfig> m_types;
|
||||
};
|
||||
|
||||
#endif // ROADCONFIG_H
|
||||
Reference in New Issue
Block a user