更改命名空间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

@@ -13,7 +13,7 @@ module es {
// 第一点和最后一点决不能相同。我们想要一个开放的多边形
let isPolygonClosed = points[0] == points[points.length - 1];
let linqPoints = new linq.List(points);
let linqPoints = new es.List(points);
// 最后一个移除
if (isPolygonClosed)
linqPoints.remove(linqPoints.last());

View File

@@ -145,7 +145,7 @@ module es {
* @param component
*/
public removeSceneComponent(component: SceneComponent) {
const sceneComponentList = new linq.List(this._sceneComponents);
const sceneComponentList = new es.List(this._sceneComponents);
Insist.isTrue(sceneComponentList.contains(component), `SceneComponent${component}不在SceneComponents列表中!`);
sceneComponentList.remove(component);
component.onRemovedFromScene();
@@ -165,7 +165,7 @@ module es {
* @param entity
*/
public addEntity(entity: Entity) {
Insist.isFalse(new linq.List(this.entities.buffer).contains(entity), `您试图将同一实体添加到场景两次: ${entity}`);
Insist.isFalse(new es.List(this.entities.buffer).contains(entity), `您试图将同一实体添加到场景两次: ${entity}`);
this.entities.add(entity);
entity.scene = this;

View File

@@ -34,7 +34,7 @@ module es {
}
public onChanged(entity: Entity) {
let contains = new linq.List(this._entities).contains(entity);
let contains = new es.List(this._entities).contains(entity);
let interest = this._matcher.isInterestedEntity(entity);
if (interest && !contains)
@@ -51,7 +51,7 @@ module es {
public onAdded(entity: Entity) { }
public remove(entity: Entity) {
new linq.List(this._entities).remove(entity);
new es.List(this._entities).remove(entity);
this.onRemoved(entity);
}

View File

@@ -267,7 +267,7 @@ module es {
return this;
if (!this._parent) {
let children = new linq.List(this._parent._children);
let children = new es.List(this._parent._children);
children.remove(this);
children.add(this);
}

View File

@@ -50,8 +50,8 @@ module es {
}
public remove(component: Component) {
let componentToRemove = new linq.List(this._componentsToRemove);
let componentToAdd = new linq.List(this._componentsToAdd);
let componentToRemove = new es.List(this._componentsToRemove);
let componentToAdd = new es.List(this._componentsToAdd);
Debug.warnIf(componentToRemove.contains(component), `您正在尝试删除一个您已经删除的组件(${component})`);
// 这可能不是一个活动的组件,所以我们必须注意它是否还没有被处理,它可能正在同一帧中被删除
@@ -83,7 +83,7 @@ module es {
// 处理IUpdatable
if (isIUpdatable(component))
new linq.List(this._updatableComponents).remove(component);
new es.List(this._updatableComponents).remove(component);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(TypeUtils.getType(component)), false);
this._entity.scene.entityProcessors.onComponentRemoved(this._entity);
@@ -107,7 +107,7 @@ module es {
if (this._componentsToRemove.length > 0) {
for (let i = 0; i < this._componentsToRemove.length; i++) {
this.handleRemove(this._componentsToRemove[i]);
new linq.List(this._components).remove(this._componentsToRemove[i]);
new es.List(this._components).remove(this._componentsToRemove[i]);
}
this._componentsToRemove.length = 0;
@@ -153,7 +153,7 @@ module es {
public handleRemove(component: Component) {
if (isIUpdatable(component))
new linq.List(this._updatableComponents).remove(component);
new es.List(this._updatableComponents).remove(component);
this._entity.componentBits.set(ComponentTypeManager.getIndexFor(TypeUtils.getType(component)), false);
this._entity.scene.entityProcessors.onComponentRemoved(this._entity);

View File

@@ -95,7 +95,7 @@ module es {
* @param entity
*/
public contains(entity: Entity): boolean {
return new linq.List(this._entities).contains(entity) || this._entitiesToAdded.contains(entity);
return new es.List(this._entities).contains(entity) || this._entitiesToAdded.contains(entity);
}
public getTagList(tag: number) {
@@ -133,7 +133,7 @@ module es {
this.removeFromTagList(entity);
// 处理常规实体列表
new linq.List(this._entities).remove(entity);
new es.List(this._entities).remove(entity);
entity.onRemovedFromScene();
entity.scene = null;

View File

@@ -7,7 +7,7 @@ module es {
}
public remove(processor: EntitySystem) {
new linq.List(this._processors).remove(processor);
new es.List(this._processors).remove(processor);
}
public onComponentAdded(entity: Entity) {