随机类移动至es命名空间
This commit is contained in:
12
source/bin/framework.d.ts
vendored
12
source/bin/framework.d.ts
vendored
@@ -649,12 +649,12 @@ declare module es {
|
||||
* 返回第一个启用加载的类型为T的组件
|
||||
* @param type
|
||||
*/
|
||||
findComponentOfType<T extends Component>(type: any): T;
|
||||
findComponentOfType<T extends Component>(type: new (...args: any[]) => T): T;
|
||||
/**
|
||||
* 返回类型为T的所有已启用已加载组件的列表
|
||||
* @param type
|
||||
*/
|
||||
findComponentsOfType<T extends Component>(type: any): T[];
|
||||
findComponentsOfType<T extends Component>(type: new (...args: any[]) => T): T[];
|
||||
/**
|
||||
* 返回场景中包含特定组件的实体列表
|
||||
* @param type
|
||||
@@ -3974,7 +3974,8 @@ declare module es {
|
||||
isContainedIn(a: Rectangle, b: Rectangle): boolean;
|
||||
}
|
||||
}
|
||||
declare class ArrayUtils {
|
||||
declare module es {
|
||||
class ArrayUtils {
|
||||
/**
|
||||
* 执行冒泡排序
|
||||
* @param ary
|
||||
@@ -4087,6 +4088,7 @@ declare class ArrayUtils {
|
||||
* @param itemCount 从列表中返回的随机项目的数量
|
||||
*/
|
||||
static randomItems<T>(list: T[], itemCount: number): T[];
|
||||
}
|
||||
}
|
||||
declare module es {
|
||||
class Base64Utils {
|
||||
@@ -4146,7 +4148,8 @@ declare module es {
|
||||
static toNumber(value: any): number;
|
||||
}
|
||||
}
|
||||
declare class RandomUtils {
|
||||
declare module es {
|
||||
class RandomUtils {
|
||||
/**
|
||||
* 在 start 与 stop之间取一个随机整数,可以用step指定间隔, 但不包括较大的端点(start与stop较大的一个)
|
||||
* 如
|
||||
@@ -4214,6 +4217,7 @@ declare class RandomUtils {
|
||||
*/
|
||||
static boolean(chance?: number): boolean;
|
||||
private static _randomCompare;
|
||||
}
|
||||
}
|
||||
declare module es {
|
||||
class RectangleExt {
|
||||
|
||||
@@ -10114,7 +10114,9 @@ var es;
|
||||
}());
|
||||
es.MaxRectsBinPack = MaxRectsBinPack;
|
||||
})(es || (es = {}));
|
||||
var ArrayUtils = /** @class */ (function () {
|
||||
var es;
|
||||
(function (es) {
|
||||
var ArrayUtils = /** @class */ (function () {
|
||||
function ArrayUtils() {
|
||||
}
|
||||
/**
|
||||
@@ -10356,7 +10358,7 @@ var ArrayUtils = /** @class */ (function () {
|
||||
var n = list.length;
|
||||
while (n > 1) {
|
||||
n--;
|
||||
var k = RandomUtils.randint(0, n + 1);
|
||||
var k = es.RandomUtils.randint(0, n + 1);
|
||||
var value = list[k];
|
||||
list[k] = list[n];
|
||||
list[n] = value;
|
||||
@@ -10385,7 +10387,7 @@ var ArrayUtils = /** @class */ (function () {
|
||||
* @param list
|
||||
*/
|
||||
ArrayUtils.randomItem = function (list) {
|
||||
return list[RandomUtils.randint(0, list.length - 1)];
|
||||
return list[es.RandomUtils.randint(0, list.length - 1)];
|
||||
};
|
||||
/**
|
||||
* 从列表中随机获取物品。不清空检查列表,也不验证列表数是否大于项目数。返回的List可以通过ListPool.free放回池中
|
||||
@@ -10404,7 +10406,9 @@ var ArrayUtils = /** @class */ (function () {
|
||||
return items;
|
||||
};
|
||||
return ArrayUtils;
|
||||
}());
|
||||
}());
|
||||
es.ArrayUtils = ArrayUtils;
|
||||
})(es || (es = {}));
|
||||
var es;
|
||||
(function (es) {
|
||||
var Base64Utils = /** @class */ (function () {
|
||||
@@ -10578,7 +10582,9 @@ var es;
|
||||
}());
|
||||
es.NumberExtension = NumberExtension;
|
||||
})(es || (es = {}));
|
||||
var RandomUtils = /** @class */ (function () {
|
||||
var es;
|
||||
(function (es) {
|
||||
var RandomUtils = /** @class */ (function () {
|
||||
function RandomUtils() {
|
||||
}
|
||||
/**
|
||||
@@ -10702,7 +10708,9 @@ var RandomUtils = /** @class */ (function () {
|
||||
return (this.random() > .5) ? 1 : -1;
|
||||
};
|
||||
return RandomUtils;
|
||||
}());
|
||||
}());
|
||||
es.RandomUtils = RandomUtils;
|
||||
})(es || (es = {}));
|
||||
var es;
|
||||
(function (es) {
|
||||
var RectangleExt = /** @class */ (function () {
|
||||
|
||||
2
source/bin/framework.min.js
vendored
2
source/bin/framework.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -212,7 +212,7 @@ module es {
|
||||
* 返回第一个启用加载的类型为T的组件
|
||||
* @param type
|
||||
*/
|
||||
public findComponentOfType<T extends Component>(type): T {
|
||||
public findComponentOfType<T extends Component>(type: new (...args) => T): T {
|
||||
return this.entities.findComponentOfType<T>(type);
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ module es {
|
||||
* 返回类型为T的所有已启用已加载组件的列表
|
||||
* @param type
|
||||
*/
|
||||
public findComponentsOfType<T extends Component>(type): T[] {
|
||||
public findComponentsOfType<T extends Component>(type: new (...args) => T): T[] {
|
||||
return this.entities.findComponentsOfType<T>(type);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class ArrayUtils {
|
||||
module es {
|
||||
export class ArrayUtils {
|
||||
/**
|
||||
* 执行冒泡排序
|
||||
* @param ary
|
||||
@@ -294,4 +295,5 @@ class ArrayUtils {
|
||||
set.forEach(value => items.push(value));
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
class RandomUtils {
|
||||
module es {
|
||||
export class RandomUtils {
|
||||
/**
|
||||
* 在 start 与 stop之间取一个随机整数,可以用step指定间隔, 但不包括较大的端点(start与stop较大的一个)
|
||||
* 如
|
||||
@@ -130,4 +131,5 @@ class RandomUtils {
|
||||
private static _randomCompare(a: Object, b: Object): number {
|
||||
return (this.random() > .5) ? 1 : -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user