Skip to content

Commit

Permalink
Integrate with RP-1 config validation
Browse files Browse the repository at this point in the history
  • Loading branch information
siimav committed Aug 31, 2024
1 parent bc219fd commit 4eded38
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Source/ProceduralPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -690,5 +690,29 @@ public void UpdateTFInterops()
}
}
#endregion

/// <summary>
/// Called from RP-1
/// </summary>
/// <param name="validationError"></param>
/// <param name="canBeResolved"></param>
/// <param name="costToResolve"></param>
/// <param name="techToResolve"></param>
/// <returns></returns>
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;
}
}
}

0 comments on commit 4eded38

Please sign in to comment.