GlueViewOfficialPlugins.Scripting.MethodCallParser.GetFloatValue C# (CSharp) Method

GetFloatValue() private method

private GetFloatValue ( ElementRuntime elementRuntime, NCalc.FunctionArgs args, string variableName ) : bool
elementRuntime FlatRedBall.Glue.ElementRuntime
args NCalc.FunctionArgs
variableName string
return bool
        private bool GetFloatValue(ElementRuntime elementRuntime, FunctionArgs args, string variableName)
        {
            float valueToSet = float.NaN;
            bool wasSet = false;
            switch (variableName)
            {
                case "PositiveInfinity":
                    valueToSet = float.PositiveInfinity;
                    wasSet = true;
                    break;
                case "NegativeInfinity":
                    valueToSet = float.NegativeInfinity;
                    wasSet = true;
                    break;
                case "MaxValue":
                    valueToSet = float.MaxValue;
                    wasSet = true;
                    break;
                case "MinValue":
                    valueToSet = float.MinValue;
                    wasSet = true;
                    break;
            }

            if (wasSet)
            {
                args.Result = valueToSet;
            }

            return wasSet;
        }