Browse Source

完善初始化

dev
刘向辉 3 years ago
parent
commit
868a05232b
  1. 1
      src/app/babylon/controller/status/login-status.ts
  2. 4
      src/app/pages/plan/plan.component.ts

1
src/app/babylon/controller/status/login-status.ts

@ -78,6 +78,7 @@ export class LoginSatus extends StatusBase {
console.log("新建数据列表"); console.log("新建数据列表");
} }
else { else {
console.log("单纯报错", error instanceof HttpErrorResponse, error.status === 404)
if (onFail) { if (onFail) {
onFail(error); onFail(error);
} }

4
src/app/pages/plan/plan.component.ts

@ -17,7 +17,7 @@ import { ObjectsService } from 'src/app/service/objects.service';
}) })
export class PlanComponent implements OnInit { export class PlanComponent implements OnInit {
constructor(private element: ElementRef,private buildingBISrv: BuildingBasicInfosService, private objectsSrv: ObjectsService,) { } constructor(private element: ElementRef, private buildingBISrv: BuildingBasicInfosService, private objectsSrv: ObjectsService) { }
static instance: PlanComponent; static instance: PlanComponent;
public game: Game = new Game(); public game: Game = new Game();
@ -26,7 +26,7 @@ export class PlanComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
PlanComponent.instance = this; PlanComponent.instance = this;
// ServeManager.Init(this.buildingBISrv, this.objectsSrv); ServeManager.Init(this.buildingBISrv, this.objectsSrv);
this.canvas = this.element.nativeElement.querySelector('#center') as HTMLCanvasElement; this.canvas = this.element.nativeElement.querySelector('#center') as HTMLCanvasElement;
this.game.init(this.canvas); this.game.init(this.canvas);
} }

Loading…
Cancel
Save