From 4eded3862d38de960540d9412d38559d40145627 Mon Sep 17 00:00:00 2001 From: siimav Date: Sat, 31 Aug 2024 20:06:13 +0300 Subject: [PATCH] Integrate with RP-1 config validation --- Source/ProceduralPart.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Source/ProceduralPart.cs b/Source/ProceduralPart.cs index 8c5428c..03625a0 100644 --- a/Source/ProceduralPart.cs +++ b/Source/ProceduralPart.cs @@ -690,5 +690,29 @@ public void UpdateTFInterops() } } #endregion + + /// + /// Called from RP-1 + /// + /// + /// + /// + /// + /// + public virtual bool Validate(out string validationError, out bool canBeResolved, out float costToResolve, out string techToResolve) + { + validationError = null; + canBeResolved = false; + costToResolve = 0; + techToResolve = null; + + if (density + 0.0001 < minDensity) + { + validationError = $"density needs to be {minDensity:0.###} or higher"; + return false; + } + + return true; + } } } \ No newline at end of file