mirror of
https://github.com/photonstorm/phaser
synced 2024-12-25 20:43:26 +00:00
31 lines
832 B
JavaScript
31 lines
832 B
JavaScript
|
/// <reference path="../Game.ts" />
|
||
|
/**
|
||
|
* Phaser - LinkedList
|
||
|
*
|
||
|
* A miniature linked list class. Useful for optimizing time-critical or highly repetitive tasks!
|
||
|
*/
|
||
|
var Phaser;
|
||
|
(function (Phaser) {
|
||
|
var LinkedList = (function () {
|
||
|
/**
|
||
|
* Creates a new link, and sets <code>object</code> and <code>next</code> to <code>null</code>.
|
||
|
*/
|
||
|
function LinkedList() {
|
||
|
this.object = null;
|
||
|
this.next = null;
|
||
|
}
|
||
|
LinkedList.prototype.destroy = /**
|
||
|
* Clean up memory.
|
||
|
*/
|
||
|
function () {
|
||
|
this.object = null;
|
||
|
if(this.next != null) {
|
||
|
this.next.destroy();
|
||
|
}
|
||
|
this.next = null;
|
||
|
};
|
||
|
return LinkedList;
|
||
|
})();
|
||
|
Phaser.LinkedList = LinkedList;
|
||
|
})(Phaser || (Phaser = {}));
|