feat(event): complete phase one event system

This commit is contained in:
AncTe committed 2026-09-09 12:01:21 +08:00
1 parent b9213ddf22
commit a297311ea6
51 files changed
+3261 -1114

No files matched your search

@@ -0,0 +1,3 @@
export * from './executor';
export * from './system';
export * from './types';
@@ -0,0 +1,23 @@
import { IStateBase } from '@user/data-base';
import { IGameEventStore } from '@user/data-common';
import { AnonTokyoInterpreter } from 'anon-tokyo';
import { EventExecutor } from './executor';
import { IGameEventExecutor, IGameEventSystem } from './types';
export class GameEventSystem implements IGameEventSystem {
readonly executor: IGameEventExecutor;
store: IGameEventStore | null;
constructor(readonly state: IStateBase) {
this.store = state.eventStore;
const interpreter = new AnonTokyoInterpreter({
builtInFunctions: [],
globalFunctions: []
});
this.executor = new EventExecutor(interpreter, () => this.store);
}
useStore(store: IGameEventStore | null): void {
this.store = store;
}
}