Пример #1
0
        /// <summary>
        /// Creates a coordinates object. Gets a Compass enum and sets ValueVectorAccordingly.
        /// (1,1) SouthEast, (-1,1) SouthWest, (-1,-1) NorthWest, (1,-1) NorthEast.
        /// </summary>
        /// <param name="dir"></param>
        public Coordinates(Compass dir)
        {
            VecDir = dir;

            if (dir.Equals(Compass.SouthEast))
            {
                ValueVector = new Vector2(1, 1);
            }
            else if (dir.Equals(Compass.SouthWest))
            {
                ValueVector = new Vector2(-1, 1);
            }
            else if (dir.Equals(Compass.NorthWest))
            {
                ValueVector = new Vector2(-1, -1);
            }
            else if (dir.Equals(Compass.NorthEast))
            {
                ValueVector = new Vector2(1, -1);
            }
        }