更改命名空间linq为es

This commit is contained in:
yhh
2021-03-29 15:28:18 +08:00
parent 8b5bc444f1
commit 6b2c18ad75
21 changed files with 80 additions and 127 deletions

View File

@@ -101,7 +101,7 @@ module es {
this._shouldRunNextFrame.push(coroutine);
}
let linqCoroutines = new linq.List(this._unblockedCoroutines);
let linqCoroutines = new es.List(this._unblockedCoroutines);
linqCoroutines.clear();
linqCoroutines.addRange(this._shouldRunNextFrame);
this._shouldRunNextFrame.length = 0;

View File

@@ -40,7 +40,7 @@ module es {
let numRectanglesToProcess = this.freeRectangles.length;
for (let i = 0; i < numRectanglesToProcess; ++i) {
if (this.splitFreeNode(this.freeRectangles[i], newNode)) {
new linq.List(this.freeRectangles).removeAt(i);
new es.List(this.freeRectangles).removeAt(i);
--i;
--numRectanglesToProcess;
}
@@ -142,12 +142,12 @@ module es {
for (let i = 0; i < this.freeRectangles.length; ++i)
for (let j = i + 1; j < this.freeRectangles.length; ++j) {
if (this.isContainedIn(this.freeRectangles[i], this.freeRectangles[j])) {
new linq.List(this.freeRectangles).removeAt(i);
new es.List(this.freeRectangles).removeAt(i);
--i;
break;
}
if (this.isContainedIn(this.freeRectangles[j], this.freeRectangles[i])) {
new linq.List(this.freeRectangles).removeAt(j);
new es.List(this.freeRectangles).removeAt(j);
--j;
}
}

View File

@@ -50,7 +50,7 @@ module es {
let messageData = this._messageTable.get(eventType);
let index = messageData.findIndex(data => data.func == handler);
if (index != -1)
new linq.List(messageData).removeAt(index);
new es.List(messageData).removeAt(index);
}
/**

View File

@@ -1,16 +0,0 @@
module es {
export class Enumerable {
/**
* 生成包含一个重复值的序列
* @param element 要重复的值
* @param count 在生成的序列中重复该值的次数
*/
public static repeat<T>(element: T, count: number){
let result = [];
while (count--) {
result.push(element)
}
return result;
}
}
}

View File

@@ -254,7 +254,7 @@ class ArrayUtils {
* @param item
*/
public static addIfNotPresent<T>(list: T[], item: T) {
if (new linq.List(list).contains(item))
if (new es.List(list).contains(item))
return false;
list.push(item);

View File

@@ -1,4 +1,4 @@
module linq {
module es {
export class Enumerable {
/**
* 在指定范围内生成一个整数序列。

View File

@@ -1,4 +1,4 @@
module linq {
module es {
/**
* 检查传递的参数是否为对象
*/

View File

@@ -1,4 +1,4 @@
module linq {
module es {
type PredicateType<T> = (value?: T, index?: number, list?: T[]) => boolean
export class List<T> {

View File

@@ -9,7 +9,7 @@ module es {
for (let i = this._timers.length - 1; i >= 0; i --){
if (this._timers[i].tick()){
this._timers[i].unload();
new linq.List(this._timers).removeAt(i);
new es.List(this._timers).removeAt(i);
}
}
}