Example #1
0
        public static bool Parse(string text, out Vector2Short vector)
        {
            vector = new Vector2Short();
            if (string.IsNullOrWhiteSpace(text))
            {
                return(false);
            }

            var split = text.Split(',', 'x');

            if (split.Length != 2)
            {
                return(false);
            }
            short x, y;

            if (short.TryParse(split[0], out x) ||
                short.TryParse(split[1], out y))
            {
                return(false);
            }

            vector = new Vector2Short(x, y);
            return(true);
        }
Example #2
0
 public bool Equals(Vector2Short other)
 {
     return(other.Y == Y && other.X == X);
 }