Class GrowthSettings
java.lang.Object
ke.ric.gardening.data.GrowthSettings
Configuration for how a crop grows over time.
-
Constructor Summary
ConstructorsConstructorDescriptionGrowthSettings(int baseDurationSeconds, double variance, int stages, double scaleStart, double scaleEnd) GrowthSettings(int baseDurationSeconds, double variance, int stages, double scaleStart, double scaleEnd, double aspectRatioY) -
Method Summary
Modifier and TypeMethodDescriptionlongCalculate actual growth duration with variance applied.doublecalculateScale(double progress) Calculate the scale for a given growth progress (0.0 to 1.0).intcalculateStage(double progress) Get the current stage (0-based) for a given progress.doubleintdoubledoubleintdoubledoubleGet XZ scale modifier to preserve volume when using aspect ratio.
-
Constructor Details
-
GrowthSettings
public GrowthSettings(int baseDurationSeconds, double variance, int stages, double scaleStart, double scaleEnd) -
GrowthSettings
public GrowthSettings(int baseDurationSeconds, double variance, int stages, double scaleStart, double scaleEnd, double aspectRatioY)
-
-
Method Details
-
getBaseDurationSeconds
public int getBaseDurationSeconds() -
getVariance
public double getVariance() -
getStages
public int getStages() -
getScaleStart
public double getScaleStart() -
getScaleEnd
public double getScaleEnd() -
getAspectRatioY
public double getAspectRatioY() -
getVolumePreservingXZFactor
public double getVolumePreservingXZFactor()Get XZ scale modifier to preserve volume when using aspect ratio. If aspectRatioY > 1, this shrinks X/Z to keep volume roughly similar. -
calculateGrowthDurationMillis
public long calculateGrowthDurationMillis()Calculate actual growth duration with variance applied. -
calculateScale
public double calculateScale(double progress) Calculate the scale for a given growth progress (0.0 to 1.0). -
calculateStage
public int calculateStage(double progress) Get the current stage (0-based) for a given progress.
-