mirror of
https://github.com/wassname/phaser.git
synced 2026-08-12 12:20:38 +08:00
LL
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Phaser - LinkedList
|
||||
*
|
||||
* A miniature linked list class. Useful for optimizing time-critical or highly repetitive tasks!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a new link, and sets <code>object</code> and <code>next</code> to <code>null</code>.
|
||||
*/
|
||||
Phaser.LinkedList = function () {
|
||||
|
||||
this.object = null;
|
||||
this.next = null;
|
||||
|
||||
};
|
||||
|
||||
Phaser.LinkedList.prototype = {
|
||||
|
||||
destroy: function () {
|
||||
|
||||
this.object = null;
|
||||
|
||||
if (this.next != null)
|
||||
{
|
||||
this.next.destroy();
|
||||
}
|
||||
|
||||
this.next = null;
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Phaser - QuadTree
|
||||
*
|
||||
* A fairly generic quad tree structure for rapid overlap checks. QuadTree is also configured for single or dual list operation.
|
||||
* You can add items either to its A list or its B list. When you do an overlap check, you can compare the A list to itself,
|
||||
* or the A list against the B list. Handy for different things!
|
||||
*/
|
||||
|
||||
/**
|
||||
* Instantiate a new Quad Tree node.
|
||||
|
||||
* @extends Rectangle
|
||||
*
|
||||
* @param {Number} x The X-coordinate of the point in space.
|
||||
* @param {Number} y The Y-coordinate of the point in space.
|
||||
* @param {Number} width Desired width of this node.
|
||||
* @param {Number} height Desired height of this node.
|
||||
* @param {Number} parent The parent branch or node. Pass null to create a root.
|
||||
*/
|
||||
Phaser.QuadTree = function (manager, x, y, width, height, parent) {
|
||||
|
||||
Phaser.Rectangle.call(this);
|
||||
|
||||
|
||||
};
|
||||
|
||||
// constructor
|
||||
Phaser.QuadTree.prototype = Object.create(Phaser.Rectangle.prototype);
|
||||
Phaser.QuadTree.prototype.constructor = Phaser.Rectangle;
|
||||
|
||||
Phaser.QuadTree.prototype = {
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user