Whole codebase updated to TypeScript 0.9.1, phew!

This commit is contained in:
Richard Davey
2013-08-08 19:16:47 +01:00
parent df32190db8
commit 1248a6c06e
129 changed files with 38471 additions and 30343 deletions
+18 -20
View File
@@ -1,6 +1,4 @@
/// <reference path="../Game.ts" />
/// <reference path="../geom/Point.ts" />
/// <reference path="../geom/Rectangle.ts" />
/// <reference path="../_definitions.ts" />
/**
* Phaser - RectangleUtils
@@ -21,7 +19,7 @@ module Phaser {
* @param {Point} out - Optional Point to store the value in, if not supplied a new Point object will be created.
* @return {Point} The new Point object.
**/
static getTopLeftAsPoint(a: Rectangle, out: Point = new Point): Point {
static getTopLeftAsPoint(a: Phaser.Rectangle, out: Phaser.Point = new Phaser.Point): Phaser.Point {
return out.setTo(a.x, a.y);
}
@@ -32,7 +30,7 @@ module Phaser {
* @param {Point} out - Optional Point to store the value in, if not supplied a new Point object will be created.
* @return {Point} The new Point object.
**/
static getBottomRightAsPoint(a: Rectangle, out: Point = new Point): Point {
static getBottomRightAsPoint(a: Phaser.Rectangle, out: Phaser.Point = new Phaser.Point): Phaser.Point {
return out.setTo(a.right, a.bottom);
}
@@ -44,7 +42,7 @@ module Phaser {
* @param {Number} dy The amount to be added to the bottom side of the Rectangle.
* @return {Rectangle} This Rectangle object.
**/
static inflate(a: Rectangle, dx: number, dy: number): Rectangle {
static inflate(a: Phaser.Rectangle, dx: number, dy: number): Phaser.Rectangle {
a.x -= dx;
a.width += 2 * dx;
@@ -63,8 +61,8 @@ module Phaser {
* @param {Point} point The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object.
* @return {Rectangle} The Rectangle object.
**/
static inflatePoint(a: Rectangle, point: Point): Rectangle {
return RectangleUtils.inflate(a, point.x, point.y);
static inflatePoint(a: Phaser.Rectangle, point: Phaser.Point): Phaser.Rectangle {
return Phaser.RectangleUtils.inflate(a, point.x, point.y);
}
/**
@@ -74,7 +72,7 @@ module Phaser {
* @param {Point} output Optional Point object. If given the values will be set into the object, otherwise a brand new Point object will be created and returned.
* @return {Point} The size of the Rectangle object
**/
static size(a: Rectangle, output: Point = new Point): Point {
static size(a: Phaser.Rectangle, output: Phaser.Point = new Phaser.Point): Phaser.Point {
return output.setTo(a.width, a.height);
}
@@ -85,7 +83,7 @@ module Phaser {
* @param {Rectangle} output Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned.
* @return {Rectangle}
**/
static clone(a: Rectangle, output: Rectangle = new Rectangle): Rectangle {
static clone(a: Phaser.Rectangle, output: Phaser.Rectangle = new Phaser.Rectangle): Phaser.Rectangle {
return output.setTo(a.x, a.y, a.width, a.height);
}
@@ -97,7 +95,7 @@ module Phaser {
* @param {Number} y The y coordinate of the point to test.
* @return {Boolean} A value of true if the Rectangle object contains the specified point; otherwise false.
**/
static contains(a: Rectangle, x: number, y: number): boolean {
static contains(a: Phaser.Rectangle, x: number, y: number): boolean {
return (x >= a.x && x <= a.right && y >= a.y && y <= a.bottom);
}
@@ -108,8 +106,8 @@ module Phaser {
* @param {Point} point The point object being checked. Can be Point or any object with .x and .y values.
* @return {Boolean} A value of true if the Rectangle object contains the specified point; otherwise false.
**/
static containsPoint(a: Rectangle, point: Point): boolean {
return RectangleUtils.contains(a, point.x, point.y);
static containsPoint(a: Phaser.Rectangle, point: Phaser.Point): boolean {
return Phaser.RectangleUtils.contains(a, point.x, point.y);
}
/**
@@ -120,7 +118,7 @@ module Phaser {
* @param {Rectangle} b - The second Rectangle object.
* @return {Boolean} A value of true if the Rectangle object contains the specified point; otherwise false.
**/
static containsRect(a: Rectangle, b: Rectangle): boolean {
static containsRect(a: Phaser.Rectangle, b: Phaser.Rectangle): boolean {
// If the given rect has a larger volume than this one then it can never contain it
if (a.volume > b.volume)
@@ -140,7 +138,7 @@ module Phaser {
* @param {Rectangle} b - The second Rectangle object.
* @return {Boolean} A value of true if the two Rectangles have exactly the same values for the x, y, width and height properties; otherwise false.
**/
static equals(a: Rectangle, b: Rectangle): boolean {
static equals(a: Phaser.Rectangle, b: Phaser.Rectangle): boolean {
return (a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height);
}
@@ -152,9 +150,9 @@ module Phaser {
* @param {Rectangle} output Optional Rectangle object. If given the intersection values will be set into this object, otherwise a brand new Rectangle object will be created and returned.
* @return {Rectangle} A Rectangle object that equals the area of intersection. If the Rectangles do not intersect, this method returns an empty Rectangle object; that is, a Rectangle with its x, y, width, and height properties set to 0.
**/
static intersection(a: Rectangle, b: Rectangle, out: Rectangle = new Rectangle): Rectangle {
static intersection(a: Phaser.Rectangle, b: Phaser.Rectangle, out: Phaser.Rectangle = new Phaser.Rectangle): Phaser.Rectangle {
if (RectangleUtils.intersects(a, b))
if (Phaser.RectangleUtils.intersects(a, b))
{
out.x = Math.max(a.x, b.x);
out.y = Math.max(a.y, b.y);
@@ -175,7 +173,7 @@ module Phaser {
* @param {Number} tolerance A tolerance value to allow for an intersection test with padding, default to 0
* @return {Boolean} A value of true if the specified object intersects with this Rectangle object; otherwise false.
**/
static intersects(a: Rectangle, b: Rectangle, tolerance: number = 0): boolean {
static intersects(a: Phaser.Rectangle, b: Phaser.Rectangle, tolerance: number = 0): boolean {
return !(a.left > b.right + tolerance || a.right < b.left - tolerance || a.top > b.bottom + tolerance || a.bottom < b.top - tolerance);
}
@@ -189,7 +187,7 @@ module Phaser {
* @param {Number} tolerance A tolerance value to allow for an intersection test with padding, default to 0
* @return {Boolean} A value of true if the specified object intersects with the Rectangle; otherwise false.
**/
static intersectsRaw(a: Rectangle, left: number, right: number, top: number, bottom: number, tolerance: number = 0): boolean {
static intersectsRaw(a: Phaser.Rectangle, left: number, right: number, top: number, bottom: number, tolerance: number = 0): boolean {
return !(left > a.right + tolerance || right < a.left - tolerance || top > a.bottom + tolerance || bottom < a.top - tolerance);
}
@@ -201,7 +199,7 @@ module Phaser {
* @param {Rectangle} output Optional Rectangle object. If given the new values will be set into this object, otherwise a brand new Rectangle object will be created and returned.
* @return {Rectangle} A Rectangle object that is the union of the two Rectangles.
**/
static union(a: Rectangle, b: Rectangle, out: Rectangle = new Rectangle): Rectangle {
static union(a: Phaser.Rectangle, b: Phaser.Rectangle, out: Phaser.Rectangle = new Phaser.Rectangle): Phaser.Rectangle {
return out.setTo(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.max(a.right, b.right), Math.max(a.bottom, b.bottom));
}