11
2- import { Vec2 } from "@benev/toolbox"
2+ import { Glacier } from "./utils/glacier.js"
3+ import { constants } from "../../constants.js"
34import { Dungeon } from "../dungeons/dungeon.js"
5+ import { Awareness } from "./utils/awareness.js"
46import { deferPromise , Map2 } from "@benev/slate"
57import { DungeonStore } from "../dungeons/store.js"
68import { ZenGrid } from "../../tools/hash/zen-grid.js"
7- import { Coordinates } from "../realm/utils/coordinates.js"
8- import { constants } from "../../constants.js"
99
1010export class Station {
1111 #dungeon: Dungeon | null = null
1212 #readyPromise = deferPromise < void > ( )
13- #authorCoordinates = new Map2 < number , Coordinates > ( )
1413
1514 // fixed timestep for simulation
1615 readonly seconds = 1 / constants . sim . tickRate
1716
1817 importantEntities = new Set < number > ( )
1918 entityHashgrid = new ZenGrid < number > ( constants . sim . hashgridExtent )
19+ awareness = new Awareness ( )
20+ glacier = new Glacier ( this . awareness )
2021
2122 constructor ( public dungeonStore : DungeonStore ) { }
2223
24+ update ( _tick : number ) {
25+ this . glacier . recompute ( )
26+ }
27+
2328 get ready ( ) {
2429 return this . #readyPromise. promise
2530 }
@@ -38,13 +43,5 @@ export class Station {
3843 get possibleDungeon ( ) {
3944 return this . #dungeon
4045 }
41-
42- getAuthorCoordinates ( author : number ) {
43- return this . #authorCoordinates. guarantee ( author , ( ) => Coordinates . zero ( ) )
44- }
45-
46- updateAuthorCoordinates ( author : number , coordinates : Coordinates ) {
47- this . getAuthorCoordinates ( author ) . set ( coordinates )
48- }
4946}
5047
0 commit comments