mirror of
https://github.com/motajs/template.git
synced 2026-11-01 06:04:30 +08:00
feat(03-01): add awaited replay movement tracer
- exercise source-aware event mutation on a fixed map - verify Node replay reaches its normal end state
This commit is contained in:
1 parent
a707be4856
commit
4eec08638e
5 files changed
+165
-6
No files matched your search
@@ -213,10 +213,12 @@ export class MapLayer
|
||||
event(x: number, y: number): ILayerEventView | null {
|
||||
if (!this.inMap(x, y)) return null;
|
||||
const index = y * this.width + x;
|
||||
return this.pointEvents.getOrInsertComputed(
|
||||
index,
|
||||
() => new LayerEventView()
|
||||
);
|
||||
let eventView = this.pointEvents.get(index);
|
||||
if (!eventView) {
|
||||
eventView = new LayerEventView();
|
||||
this.pointEvents.set(index, eventView);
|
||||
}
|
||||
return eventView;
|
||||
}
|
||||
|
||||
getPointEvent(x: number, y: number): ReadonlyMap<number, string> | null {
|
||||
|
||||
Reference in new issue
Block a user