UNPKG

starling-framework

Version:

A fast, productive library for 2D cross-platform development.

80 lines (62 loc) 1.84 kB
// Class: starling.rendering.BatchToken var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this $global.Object.defineProperty(exports, "__esModule", {value: true}); var __map_reserved = {}; // Imports var $hxClasses = require("./../../hxClasses_stub").default; var $import = require("./../../import_stub").default; function starling_utils_StringUtil() {return require("./../../starling/utils/StringUtil");} // Constructor var BatchToken = function(batchID,vertexID,indexID) { if(indexID == null) { indexID = 0; } if(vertexID == null) { vertexID = 0; } if(batchID == null) { batchID = 0; } this.setTo(batchID,vertexID,indexID); } // Meta BatchToken.__name__ = ["starling","rendering","BatchToken"]; BatchToken.prototype = { copyFrom: function(token) { this.batchID = token.batchID; this.vertexID = token.vertexID; this.indexID = token.indexID; }, setTo: function(batchID,vertexID,indexID) { if(indexID == null) { indexID = 0; } if(vertexID == null) { vertexID = 0; } if(batchID == null) { batchID = 0; } this.batchID = batchID; this.vertexID = vertexID; this.indexID = indexID; }, reset: function() { this.batchID = this.vertexID = this.indexID = 0; }, equals: function(other) { if(this.batchID == other.batchID && this.vertexID == other.vertexID) { return this.indexID == other.indexID; } else { return false; } }, toString: function() { return (starling_utils_StringUtil().default).format("[BatchToken batchID={0} vertexID={1} indexID={2}]",[this.batchID,this.vertexID,this.indexID]); } }; BatchToken.prototype.__class__ = BatchToken.prototype.constructor = $hxClasses["starling.rendering.BatchToken"] = BatchToken; // Init // Statics // Export exports.default = BatchToken;