mirror of
https://github.com/photonstorm/phaser
synced 2025-01-26 11:55:13 +00:00
33 lines
839 B
JavaScript
33 lines
839 B
JavaScript
|
/// <reference path="../_definitions.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;
|
||
|
}
|
||
|
/**
|
||
|
* Clean up memory.
|
||
|
*/
|
||
|
LinkedList.prototype.destroy = function () {
|
||
|
this.object = null;
|
||
|
|
||
|
if (this.next != null) {
|
||
|
this.next.destroy();
|
||
|
}
|
||
|
|
||
|
this.next = null;
|
||
|
};
|
||
|
return LinkedList;
|
||
|
})();
|
||
|
Phaser.LinkedList = LinkedList;
|
||
|
})(Phaser || (Phaser = {}));
|