PointI


Integer point class.

    public struct PointI
    {
        public int X;
        public int Y;

        public PointI(int xSet, int ySet) { X = xSet; Y = ySet; }

        public int this[uint i]
        {
            get
            {
                if (i > 1) { Core.SetWindowsError(WinError.AParameterIsInvalid); throw new WindowsException(); }
                if (i == 0) return X; else return Y;
            }
            set
            {
                if (i > 1) { Core.SetWindowsError(WinError.AParameterIsInvalid); throw new WindowsException(); }
                if (i == 0) X = value; else Y = value;
            }
        }

        public static PointI operator +(PointI A, PointI B)
        {
            return new PointI(A.X + B.X, A.Y + B.Y);
        }

        public static PointI operator -(PointI A, PointI B)
        {
            return new PointI(A.X - B.X, A.Y - B.Y);
        }

        public static PointI operator *(int a, PointI B)
        {
            return new PointI(a*B.X, a*B.Y);
        }

        public static PointI operator *(PointI B, int a)
        {
            return new PointI(a * B.X, a * B.Y);
        }

        public static PointI operator /(PointI B, int a)
        {
            return new PointI(B.X/a, B.Y/a);
        }

    }