ACR_BuilderPlugin.ModuleValidator.ValidateVariableBounds C# (CSharp) Méthode

ValidateVariableBounds() private méthode

private ValidateVariableBounds ( string reference, NWN2WaypointTemplate waypoint, string variable, float min, float max ) : void
reference string
waypoint NWN2WaypointTemplate
variable string
min float
max float
Résultat void
        private void ValidateVariableBounds(string reference, NWN2WaypointTemplate waypoint, string variable, float min, float max)
        {
            if (waypoint == null) return;
            if (waypoint.Variables.GetVariable(variable) == null) return;
            if (waypoint.Variables.GetVariable(variable).VariableType != NWN2ScriptVariableType.Float) return;
            if (waypoint.Variables.GetVariable(variable).ValueFloat < min || waypoint.Variables.GetVariable(variable).ValueFloat > max)
            {
                log.WriteLine("ERROR: Waypoint blueprint \"{0}\" has variable \"{1}\" of value {2} outside of bounds [{3},{4}].", reference, variable, waypoint.Variables.GetVariable(variable).ValueFloat, min, max);
            }
        }

Same methods

ModuleValidator::ValidateVariableBounds ( string reference, NWN2WaypointTemplate waypoint, string variable, int min, int max ) : void