更改命名空间linq为es
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module linq {
|
||||
module es {
|
||||
export class Enumerable {
|
||||
/**
|
||||
* 在指定范围内生成一个整数序列。
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module linq {
|
||||
module es {
|
||||
/**
|
||||
* 检查传递的参数是否为对象
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module linq {
|
||||
module es {
|
||||
type PredicateType<T> = (value?: T, index?: number, list?: T[]) => boolean
|
||||
|
||||
export class List<T> {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user