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

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

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

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

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