Example #1
0
        public static VectorB Parse(string text)
        {
            Regex r = new Regex(@"\((?<x>.*);(?<y>.*)\)", RegexOptions.None);
              Match m = r.Match(text);
              if (m.Success)
              {
            var result = new VectorB();
            result.X = float.Parse(m.Groups["x"].Value);
            result.Y = float.Parse(m.Groups["y"].Value);
            return result;
              }

              throw new FormatException("String is not a valid Vector2.");
        }
Example #2
0
        public static VectorB Parse(string text)
        {
            Regex r = new Regex(@"\((?<x>.*);(?<y>.*)\)", RegexOptions.None);
            Match m = r.Match(text);

            if (m.Success)
            {
                var result = new VectorB();
                result.X = float.Parse(m.Groups["x"].Value);
                result.Y = float.Parse(m.Groups["y"].Value);
                return(result);
            }

            throw new FormatException("String is not a valid Vector2.");
        }