/*global Mediasite*/
Mediasite.Geometry = Mediasite.Geometry || {};


Mediasite.Geometry.Rect = function (left, top, width, height) {
    this.left = function () { return left; };
    this.top = function () { return top; };
    this.width = function () { return width; };
    this.height = function () { return height; };
    this.bottom = function () { return top + height; };
    this.right = function () { return left + width; };

    this.equals = function (other) {
        if (this === other) {
            return true;
        }
        return this.left() === other.left() &&
			this.top() === other.top() &&
			this.width() === other.width() &&
			this.height() === other.height();
    };
};

Mediasite.Geometry.Size = function (width, height) {
    this.width = function () { return width; };
    this.height = function () { return height; };

    this.equals = function (other) {
        if (!other) {
            return false;
        }
        if (this === other) {
            return true;
        }
        return this.width() === other.width() &&
			this.height() === other.height();
    };

    this.toString = function () {
        return '[Size ' + width + 'x' + height + ']';
    };
};
Mediasite.Geometry.Size._zero = new Mediasite.Geometry.Size(0, 0);
Mediasite.Geometry.Size.Zero = function () { return Mediasite.Geometry.Size._zero; };

Mediasite.Geometry.Point = function (x, y) {
    this.x = function () { return x; };
    this.y = function () { return y; };

    this.equals = function (other) {
        if (!other) {
            return false;
        }
        if (this === other) {
            return true;
        }
        return this.x() === other.x() &&
			this.y() === other.y();
    };

    this.toString = function () {
        return '[Point x:' + x + ', y:' + y + ']';
    };
};
