Пример #1
0
        internal static string ConvertAs(string param, YurFormat formatType)
        {
            string returnObject = null;

            switch (formatType)
            {
            case YurFormat.None:
                break;

            case YurFormat.ShortK:
                returnObject = ConvertToShortK(param);
                break;

            case YurFormat.Time:
                returnObject = ConvertToTime(param);
                break;

            case YurFormat.TimeNoSeconds:
                returnObject = ConvertToTimeNoSeconds(param);
                break;

            case YurFormat.FormattedTime:
                returnObject = ConvertToFormattedTime(param);
                break;

            case YurFormat.TimeOfDaySignifier:
                returnObject = ConvertToTimeOfDaySignifier(param);
                break;

            default:
                break;
            }

            return(returnObject.ToString());
        }
Пример #2
0
        internal static string ConvertAs(int param, YurFormat formatType)
        {
            string returnObject = null;

            switch (formatType)
            {
            case YurFormat.None:
                returnObject = param.ToString();
                break;

            case YurFormat.NoSigValues:
                returnObject = ConvertToStringFromInt(param, "N0");
                break;

            case YurFormat.OneSigValue:
                returnObject = ConvertToStringFromInt(param, "0.#");
                break;

            case YurFormat.TwoSigValues:
                returnObject = ConvertToStringFromInt(param, "F2");
                break;

            case YurFormat.Time:
                returnObject = ConvertToTimeFromInt(param);
                break;

            default:
                returnObject = param.ToString();
                break;
            }

            return(returnObject.ToString());
        }
Пример #3
0
        internal static Vector3 ConvertAs(float[] param, YurFormat formatType)
        {
            Vector3 returnObject = Vector3.zero;

            switch (formatType)
            {
            case YurFormat.None:
                break;

            case YurFormat.Vector3:
                returnObject = ConvertToVector3(param);
                break;

            default:
                break;
            }

            return(returnObject);
        }