# Conflicts:
#	demo/libs/framework/framework.min.js
This commit is contained in:
yhh
2020-11-03 10:10:03 +08:00
16 changed files with 148 additions and 49 deletions
+1 -1
View File
@@ -280,7 +280,7 @@ declare module es {
planner: ActionPlanner;
static create(planner: ActionPlanner): WorldState;
constructor(planner: ActionPlanner, values: number, dontcare: number);
set(conditionId: number, value: boolean): boolean;
set(conditionId: number | string, value: boolean): boolean;
equals(other: WorldState): boolean;
describe(planner: ActionPlanner): string;
}
+10 -6
View File
@@ -1008,7 +1008,7 @@ var es;
return null;
};
AStarStorage.prototype.hasOpened = function () {
return this._numClosed > 0;
return this._numOpened > 0;
};
AStarStorage.prototype.removeOpened = function (node) {
if (this._numOpened > 0)
@@ -1330,6 +1330,9 @@ var es;
return new WorldState(planner, 0, -1);
};
WorldState.prototype.set = function (conditionId, value) {
if (typeof conditionId == "string") {
return this.set(this.planner.findConditionNameIndex(conditionId), value);
}
this.values = value ? (this.values | (1 << conditionId)) : (this.values & ~(1 << conditionId));
this.dontCare ^= (1 << conditionId);
return true;
@@ -1513,7 +1516,6 @@ var es;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
this.startDebugUpdate();
es.Time.update(egret.getTimer());
es.Input.update();
if (!this._scene) return [3, 2];
@@ -1537,9 +1539,7 @@ var es;
_a.sent();
this.addChild(this._scene);
_a.label = 2;
case 2:
this.endDebugUpdate();
return [4, this.draw()];
case 2: return [4, this.draw()];
case 3:
_a.sent();
return [2];
@@ -4932,6 +4932,8 @@ var es;
ComponentList.prototype.deregisterAllComponents = function () {
for (var i = 0; i < this._components.length; i++) {
var component = this._components.buffer[i];
if (!component)
continue;
if (component instanceof es.RenderableComponent) {
if (component.displayObject.parent)
component.displayObject.parent.removeChild(component.displayObject);
@@ -5001,6 +5003,8 @@ var es;
}
};
ComponentList.prototype.handleRemove = function (component) {
if (!component)
return;
if (component instanceof es.RenderableComponent) {
if (component.displayObject.parent)
component.displayObject.parent.removeChild(component.displayObject);
@@ -11318,7 +11322,7 @@ var es;
obj["reset"]();
}
};
Pool._objectQueue = new Array(10);
Pool._objectQueue = [];
return Pool;
}());
es.Pool = Pool;
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -55,7 +55,7 @@ module es {
}
public hasOpened(): boolean {
return this._numClosed > 0;
return this._numOpened > 0;
}
public removeOpened(node: AStarNode){
+5 -1
View File
@@ -36,7 +36,11 @@ module es {
this.dontCare = dontcare;
}
public set(conditionId: number, value: boolean): boolean {
public set(conditionId: number | string, value: boolean): boolean {
if (typeof conditionId == "string"){
return this.set(this.planner.findConditionNameIndex(conditionId), value);
}
this.values = value ? (this.values | (1 << conditionId)) : (this.values & ~(1 << conditionId));
this.dontCare ^= (1 << conditionId);
return true;
+2 -2
View File
@@ -232,7 +232,7 @@ module es {
}
protected async update() {
this.startDebugUpdate();
// this.startDebugUpdate();
// 更新我们所有的系统管理器
Time.update(egret.getTimer());
@@ -266,7 +266,7 @@ module es {
}
}
this.endDebugUpdate();
// this.endDebugUpdate();
await this.draw();
}
+2
View File
@@ -75,6 +75,7 @@ module es {
for (let i = 0; i < this._components.length; i++) {
let component = this._components.buffer[i];
if (!component) continue;
// 处理渲染层列表
if (component instanceof RenderableComponent) {
if (component.displayObject.parent)
@@ -161,6 +162,7 @@ module es {
}
public handleRemove(component: Component) {
if (!component) return;
// 处理渲染层列表
if (component instanceof RenderableComponent) {
if (component.displayObject.parent)
+1 -1
View File
@@ -3,7 +3,7 @@ module es {
* 用于池任何对象
*/
export class Pool<T> {
private static _objectQueue = new Array(10);
private static _objectQueue = [];
/**
* 预热缓存,使用最大的cacheCount对象填充缓存