@sharpee/world-model 0.9.102 → 0.9.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/world/AuthorModel.d.ts +122 -105
- package/world/AuthorModel.d.ts.map +1 -1
- package/world/AuthorModel.js +241 -322
- package/world/AuthorModel.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharpee/world-model",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.103",
|
|
4
4
|
"description": "World model for Sharpee IF platform - entities, traits, and behaviors",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@sharpee/core": "^0.9.
|
|
16
|
-
"@sharpee/if-domain": "^0.9.
|
|
15
|
+
"@sharpee/core": "^0.9.103",
|
|
16
|
+
"@sharpee/if-domain": "^0.9.103"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"interactive-fiction",
|
package/world/AuthorModel.d.ts
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AuthorModel — unrestricted world model access for authoring and setup.
|
|
3
|
+
*
|
|
4
|
+
* Public interface: Implements IWorldModel. Entity creation and movement
|
|
5
|
+
* bypass validation. All other methods delegate to the backing WorldModel.
|
|
6
|
+
*
|
|
7
|
+
* Owner context: packages/world-model. Used during initializeWorld() for
|
|
8
|
+
* setup that requires bypassing game rules (placing items in closed
|
|
9
|
+
* containers, etc.).
|
|
10
|
+
*/
|
|
1
11
|
import { IFEntity } from '../entities/if-entity';
|
|
2
12
|
import { TraitType } from '../traits/trait-types';
|
|
3
13
|
import { SpatialIndex } from './SpatialIndex';
|
|
4
14
|
import { ITrait } from '../traits/trait';
|
|
5
15
|
import { ICapabilityStore } from './capabilities';
|
|
6
|
-
import type { IWorldModel } from './WorldModel';
|
|
16
|
+
import type { IWorldModel, EventHandler, EventValidator, EventPreviewer, EventChainHandler, ChainEventOptions } from './WorldModel';
|
|
17
|
+
import type { ScoreEntry } from './ScoreLedger';
|
|
18
|
+
import type { ISemanticEvent } from "../../core/index";
|
|
19
|
+
import type { WorldState, ContentsOptions, WorldChange, IEventProcessorWiring, GamePrompt, IGrammarVocabularyProvider } from "../../if-domain/index";
|
|
20
|
+
import type { DirectionType } from '../constants/directions';
|
|
21
|
+
import type { ScopeRegistry } from '../scope/scope-registry';
|
|
22
|
+
import type { IScopeRule } from '../scope/scope-rule';
|
|
23
|
+
import type { ICapabilityData, ICapabilityRegistration } from './capabilities';
|
|
7
24
|
/**
|
|
8
|
-
* Data store shared between WorldModel and AuthorModel
|
|
25
|
+
* Data store shared between WorldModel and AuthorModel.
|
|
9
26
|
*/
|
|
10
27
|
export interface IDataStore {
|
|
11
28
|
entities: Map<string, IFEntity>;
|
|
@@ -17,7 +34,7 @@ export interface IDataStore {
|
|
|
17
34
|
capabilities: ICapabilityStore;
|
|
18
35
|
}
|
|
19
36
|
/**
|
|
20
|
-
* Item specification for bulk creation
|
|
37
|
+
* Item specification for bulk creation.
|
|
21
38
|
*/
|
|
22
39
|
export interface IItemSpec {
|
|
23
40
|
name: string;
|
|
@@ -27,125 +44,125 @@ export interface IItemSpec {
|
|
|
27
44
|
}
|
|
28
45
|
/**
|
|
29
46
|
* AuthorModel provides unrestricted access to the world state for authoring,
|
|
30
|
-
* testing, and world setup. It bypasses
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* Use AuthorModel when:
|
|
34
|
-
* - Setting up initial world state
|
|
35
|
-
* - Populating containers (even closed ones)
|
|
36
|
-
* - Loading saved games
|
|
37
|
-
* - Writing tests
|
|
38
|
-
* - Implementing special mechanics (magic, teleportation, etc.)
|
|
47
|
+
* testing, and world setup. It bypasses validation rules for entity creation
|
|
48
|
+
* and movement. All other IWorldModel methods delegate to the backing WorldModel.
|
|
39
49
|
*
|
|
40
50
|
* @example
|
|
41
51
|
* ```typescript
|
|
42
|
-
* const author = new AuthorModel(world.getDataStore());
|
|
43
|
-
* const cabinet = author.createEntity('Medicine Cabinet', 'container');
|
|
44
|
-
* cabinet.add(new OpenableTrait({ isOpen: false }));
|
|
45
|
-
*
|
|
46
|
-
* // Can place items in closed container!
|
|
52
|
+
* const author = new AuthorModel(world.getDataStore(), world);
|
|
47
53
|
* const medicine = author.createEntity('Aspirin', 'item');
|
|
48
|
-
* author.moveEntity(medicine.id,
|
|
54
|
+
* author.moveEntity(medicine.id, closedCabinet.id); // Works even though closed
|
|
49
55
|
* ```
|
|
50
56
|
*/
|
|
51
|
-
export declare class AuthorModel {
|
|
57
|
+
export declare class AuthorModel implements IWorldModel {
|
|
52
58
|
private dataStore;
|
|
53
|
-
private worldModel
|
|
54
|
-
|
|
55
|
-
constructor(dataStore: IDataStore, worldModel?: IWorldModel);
|
|
59
|
+
private worldModel;
|
|
60
|
+
constructor(dataStore: IDataStore, worldModel: IWorldModel);
|
|
56
61
|
/**
|
|
57
|
-
* Get the shared data store.
|
|
58
|
-
* that shares the same state.
|
|
62
|
+
* Get the shared data store.
|
|
59
63
|
*/
|
|
60
64
|
getDataStore(): IDataStore;
|
|
61
65
|
/**
|
|
62
|
-
* Create a new entity without
|
|
63
|
-
*
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
66
|
+
* Create a new entity without validation.
|
|
67
|
+
*
|
|
68
|
+
* @param name - Display name for the entity
|
|
69
|
+
* @param type - Entity type (room, item, actor, etc.)
|
|
70
|
+
* @returns The created entity
|
|
71
|
+
*/
|
|
72
|
+
createEntity(name: string, type?: string): IFEntity;
|
|
73
|
+
/**
|
|
74
|
+
* Move an entity without validation. Can move into closed/locked containers.
|
|
75
|
+
*
|
|
76
|
+
* @param entityId - ID of entity to move
|
|
77
|
+
* @param targetId - ID of target location (null to remove from world)
|
|
78
|
+
* @returns Always true (no validation to fail)
|
|
79
|
+
*/
|
|
80
|
+
moveEntity(entityId: string, targetId: string | null): boolean;
|
|
81
|
+
getEntity(id: string): IFEntity | undefined;
|
|
82
|
+
hasEntity(id: string): boolean;
|
|
83
|
+
removeEntity(id: string): boolean;
|
|
84
|
+
getAllEntities(): IFEntity[];
|
|
85
|
+
updateEntity(entityId: string, updater: (entity: IFEntity) => void): void;
|
|
86
|
+
getLocation(entityId: string): string | undefined;
|
|
87
|
+
getContents(containerId: string, options?: ContentsOptions): IFEntity[];
|
|
88
|
+
canMoveEntity(entityId: string, targetId: string | null): boolean;
|
|
89
|
+
getContainingRoom(entityId: string): IFEntity | undefined;
|
|
90
|
+
getAllContents(entityId: string, options?: ContentsOptions): IFEntity[];
|
|
91
|
+
getState(): WorldState;
|
|
92
|
+
setState(state: WorldState): void;
|
|
93
|
+
getStateValue(key: string): any;
|
|
94
|
+
setStateValue(key: string, value: any): void;
|
|
95
|
+
getPrompt(): GamePrompt;
|
|
96
|
+
setPrompt(prompt: GamePrompt): void;
|
|
97
|
+
findByTrait(traitType: TraitType): IFEntity[];
|
|
98
|
+
findByType(entityType: string): IFEntity[];
|
|
99
|
+
findWhere(predicate: (entity: IFEntity) => boolean): IFEntity[];
|
|
100
|
+
getVisible(observerId: string): IFEntity[];
|
|
101
|
+
getInScope(observerId: string): IFEntity[];
|
|
102
|
+
canSee(observerId: string, targetId: string): boolean;
|
|
103
|
+
getRelated(entityId: string, relationshipType: string): string[];
|
|
104
|
+
areRelated(entity1Id: string, entity2Id: string, relationshipType: string): boolean;
|
|
105
|
+
addRelationship(entity1Id: string, entity2Id: string, relationshipType: string): void;
|
|
106
|
+
removeRelationship(entity1Id: string, entity2Id: string, relationshipType: string): void;
|
|
107
|
+
getTotalWeight(entityId: string): number;
|
|
108
|
+
wouldCreateLoop(entityId: string, targetId: string): boolean;
|
|
109
|
+
findPath(fromRoomId: string, toRoomId: string): string[] | null;
|
|
110
|
+
getPlayer(): IFEntity | undefined;
|
|
111
|
+
setPlayer(entityId: string): void;
|
|
112
|
+
connectRooms(room1Id: string, room2Id: string, direction: DirectionType): void;
|
|
113
|
+
createDoor(displayName: string, opts: {
|
|
114
|
+
room1Id: string;
|
|
115
|
+
room2Id: string;
|
|
116
|
+
direction: DirectionType;
|
|
117
|
+
description?: string;
|
|
118
|
+
aliases?: string[];
|
|
119
|
+
isOpen?: boolean;
|
|
120
|
+
isLocked?: boolean;
|
|
121
|
+
keyId?: string;
|
|
122
|
+
}): IFEntity;
|
|
123
|
+
registerCapability(name: string, registration: Partial<ICapabilityRegistration>): void;
|
|
124
|
+
updateCapability(name: string, data: Partial<ICapabilityData>): void;
|
|
125
|
+
getCapability(name: string): ICapabilityData | undefined;
|
|
126
|
+
hasCapability(name: string): boolean;
|
|
127
|
+
awardScore(id: string, points: number, description: string): boolean;
|
|
128
|
+
revokeScore(id: string): boolean;
|
|
129
|
+
hasScore(id: string): boolean;
|
|
130
|
+
getScore(): number;
|
|
131
|
+
getScoreEntries(): ScoreEntry[];
|
|
132
|
+
setMaxScore(max: number): void;
|
|
133
|
+
getMaxScore(): number;
|
|
134
|
+
toJSON(): string;
|
|
135
|
+
loadJSON(json: string): void;
|
|
136
|
+
clear(): void;
|
|
137
|
+
registerEventHandler(eventType: string, handler: EventHandler): void;
|
|
138
|
+
unregisterEventHandler(eventType: string): void;
|
|
139
|
+
registerEventValidator(eventType: string, validator: EventValidator): void;
|
|
140
|
+
registerEventPreviewer(eventType: string, previewer: EventPreviewer): void;
|
|
141
|
+
connectEventProcessor(wiring: IEventProcessorWiring): void;
|
|
142
|
+
chainEvent(triggerType: string, handler: EventChainHandler, options?: ChainEventOptions): void;
|
|
143
|
+
applyEvent(event: ISemanticEvent): void;
|
|
144
|
+
canApplyEvent(event: ISemanticEvent): boolean;
|
|
145
|
+
previewEvent(event: ISemanticEvent): WorldChange[];
|
|
146
|
+
getAppliedEvents(): ISemanticEvent[];
|
|
147
|
+
getEventsSince(timestamp: number): ISemanticEvent[];
|
|
148
|
+
clearEventHistory(): void;
|
|
149
|
+
getScopeRegistry(): ScopeRegistry;
|
|
150
|
+
addScopeRule(rule: IScopeRule): void;
|
|
151
|
+
removeScopeRule(ruleId: string): boolean;
|
|
152
|
+
evaluateScope(actorId: string, actionId?: string): string[];
|
|
153
|
+
getGrammarVocabularyProvider(): IGrammarVocabularyProvider;
|
|
126
154
|
/**
|
|
127
|
-
*
|
|
155
|
+
* Move multiple entities to a container in one operation.
|
|
128
156
|
*/
|
|
129
|
-
|
|
157
|
+
populate(containerId: string, entityIds: string[]): void;
|
|
130
158
|
/**
|
|
131
|
-
*
|
|
159
|
+
* Add a trait to an entity.
|
|
132
160
|
*/
|
|
133
|
-
|
|
161
|
+
addTrait(entityId: string, trait: ITrait): void;
|
|
134
162
|
/**
|
|
135
|
-
*
|
|
163
|
+
* Remove a trait from an entity.
|
|
136
164
|
*/
|
|
165
|
+
removeTrait(entityId: string, traitType: TraitType): void;
|
|
137
166
|
private generateId;
|
|
138
|
-
/**
|
|
139
|
-
* Emit an author event if event recording is enabled
|
|
140
|
-
*/
|
|
141
|
-
private emitEvent;
|
|
142
|
-
/**
|
|
143
|
-
* Register an event handler for author events
|
|
144
|
-
*/
|
|
145
|
-
registerEventHandler(eventType: string, handler: (event: any) => void): void;
|
|
146
|
-
/**
|
|
147
|
-
* Unregister an event handler
|
|
148
|
-
*/
|
|
149
|
-
unregisterEventHandler(eventType: string): void;
|
|
150
167
|
}
|
|
151
168
|
//# sourceMappingURL=AuthorModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorModel.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/world/AuthorModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthorModel.d.ts","sourceRoot":"","sources":["../../../../../../repos/sharpee/packages/world-model/src/world/AuthorModel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,WAAW,EAC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AAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAI9F,UAAU,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI;IAIvC,aAAa,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO;IAI7C,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,WAAW,EAAE;IAIlD,gBAAgB,IAAI,cAAc,EAAE;IAIpC,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,EAAE;IAInD,iBAAiB,IAAI,IAAI;IAKzB,gBAAgB,IAAI,aAAa;IAIjC,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAIpC,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIxC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAK3D,4BAA4B,IAAI,0BAA0B;IAM1D;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAMxD;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAO/C;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI;IASzD,OAAO,CAAC,UAAU;CAyBnB"}
|
package/world/AuthorModel.js
CHANGED
|
@@ -1,368 +1,314 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* AuthorModel — unrestricted world model access for authoring and setup.
|
|
4
|
+
*
|
|
5
|
+
* Public interface: Implements IWorldModel. Entity creation and movement
|
|
6
|
+
* bypass validation. All other methods delegate to the backing WorldModel.
|
|
7
|
+
*
|
|
8
|
+
* Owner context: packages/world-model. Used during initializeWorld() for
|
|
9
|
+
* setup that requires bypassing game rules (placing items in closed
|
|
10
|
+
* containers, etc.).
|
|
11
|
+
*/
|
|
3
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
13
|
exports.AuthorModel = void 0;
|
|
5
14
|
const if_entity_1 = require("../entities/if-entity");
|
|
6
|
-
const openableTrait_1 = require("../traits/openable/openableTrait");
|
|
7
|
-
const lockableTrait_1 = require("../traits/lockable/lockableTrait");
|
|
8
15
|
/**
|
|
9
16
|
* AuthorModel provides unrestricted access to the world state for authoring,
|
|
10
|
-
* testing, and world setup. It bypasses
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Use AuthorModel when:
|
|
14
|
-
* - Setting up initial world state
|
|
15
|
-
* - Populating containers (even closed ones)
|
|
16
|
-
* - Loading saved games
|
|
17
|
-
* - Writing tests
|
|
18
|
-
* - Implementing special mechanics (magic, teleportation, etc.)
|
|
17
|
+
* testing, and world setup. It bypasses validation rules for entity creation
|
|
18
|
+
* and movement. All other IWorldModel methods delegate to the backing WorldModel.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* ```typescript
|
|
22
|
-
* const author = new AuthorModel(world.getDataStore());
|
|
23
|
-
* const cabinet = author.createEntity('Medicine Cabinet', 'container');
|
|
24
|
-
* cabinet.add(new OpenableTrait({ isOpen: false }));
|
|
25
|
-
*
|
|
26
|
-
* // Can place items in closed container!
|
|
22
|
+
* const author = new AuthorModel(world.getDataStore(), world);
|
|
27
23
|
* const medicine = author.createEntity('Aspirin', 'item');
|
|
28
|
-
* author.moveEntity(medicine.id,
|
|
24
|
+
* author.moveEntity(medicine.id, closedCabinet.id); // Works even though closed
|
|
29
25
|
* ```
|
|
30
26
|
*/
|
|
31
27
|
class AuthorModel {
|
|
32
28
|
dataStore;
|
|
33
29
|
worldModel;
|
|
34
|
-
eventHandlers = new Map();
|
|
35
30
|
constructor(dataStore, worldModel) {
|
|
36
31
|
this.dataStore = dataStore;
|
|
37
32
|
this.worldModel = worldModel;
|
|
38
33
|
}
|
|
39
34
|
/**
|
|
40
|
-
* Get the shared data store.
|
|
41
|
-
* that shares the same state.
|
|
35
|
+
* Get the shared data store.
|
|
42
36
|
*/
|
|
43
37
|
getDataStore() {
|
|
44
38
|
return this.dataStore;
|
|
45
39
|
}
|
|
46
|
-
// ==========
|
|
40
|
+
// ========== Overridden Methods (bypass validation) ==========
|
|
47
41
|
/**
|
|
48
|
-
* Create a new entity without
|
|
49
|
-
*
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
42
|
+
* Create a new entity without validation.
|
|
43
|
+
*
|
|
44
|
+
* @param name - Display name for the entity
|
|
45
|
+
* @param type - Entity type (room, item, actor, etc.)
|
|
46
|
+
* @returns The created entity
|
|
52
47
|
*/
|
|
53
|
-
createEntity(name, type = 'object'
|
|
48
|
+
createEntity(name, type = 'object') {
|
|
54
49
|
const id = this.generateId(type);
|
|
55
50
|
const entity = new if_entity_1.IFEntity(id, type, {
|
|
56
51
|
attributes: {
|
|
57
52
|
displayName: name,
|
|
58
|
-
name: name,
|
|
53
|
+
name: name,
|
|
59
54
|
entityType: type
|
|
60
55
|
}
|
|
61
56
|
});
|
|
62
|
-
// Add to data store
|
|
63
57
|
this.dataStore.entities.set(id, entity);
|
|
64
|
-
if (recordEvent) {
|
|
65
|
-
this.emitEvent('author:entity:created', {
|
|
66
|
-
entityId: id,
|
|
67
|
-
name,
|
|
68
|
-
entityType: type
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
58
|
return entity;
|
|
72
59
|
}
|
|
73
60
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* @param
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const entity = this.dataStore.entities.get(entityId);
|
|
80
|
-
if (!entity)
|
|
81
|
-
return;
|
|
82
|
-
// Remove from spatial index
|
|
83
|
-
this.dataStore.spatialIndex.remove(entityId);
|
|
84
|
-
// Remove from relationships
|
|
85
|
-
this.dataStore.relationships.delete(entityId);
|
|
86
|
-
// Remove as target of relationships
|
|
87
|
-
for (const [, rels] of this.dataStore.relationships) {
|
|
88
|
-
for (const [, targets] of rels) {
|
|
89
|
-
targets.delete(entityId);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
// Remove entity
|
|
93
|
-
this.dataStore.entities.delete(entityId);
|
|
94
|
-
if (recordEvent) {
|
|
95
|
-
this.emitEvent('author:entity:removed', {
|
|
96
|
-
entityId,
|
|
97
|
-
name: entity.name
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Move an entity to a new location without any validation.
|
|
103
|
-
* Can move entities into closed containers, locked containers, or any location.
|
|
104
|
-
* @param entityId ID of entity to move
|
|
105
|
-
* @param targetId ID of target location (null to remove from world)
|
|
106
|
-
* @param recordEvent If true, emits an 'author:entity:moved' event
|
|
61
|
+
* Move an entity without validation. Can move into closed/locked containers.
|
|
62
|
+
*
|
|
63
|
+
* @param entityId - ID of entity to move
|
|
64
|
+
* @param targetId - ID of target location (null to remove from world)
|
|
65
|
+
* @returns Always true (no validation to fail)
|
|
107
66
|
*/
|
|
108
|
-
moveEntity(entityId, targetId
|
|
109
|
-
// Remove from current location
|
|
67
|
+
moveEntity(entityId, targetId) {
|
|
110
68
|
const currentLocation = this.dataStore.spatialIndex.getParent(entityId);
|
|
111
69
|
if (currentLocation) {
|
|
112
70
|
this.dataStore.spatialIndex.removeChild(currentLocation, entityId);
|
|
113
71
|
}
|
|
114
|
-
// Add to new location
|
|
115
72
|
if (targetId !== null) {
|
|
116
73
|
this.dataStore.spatialIndex.addChild(targetId, entityId);
|
|
117
74
|
}
|
|
118
|
-
|
|
119
|
-
this.emitEvent('author:entity:moved', {
|
|
120
|
-
entityId,
|
|
121
|
-
from: currentLocation,
|
|
122
|
-
to: targetId
|
|
123
|
-
});
|
|
124
|
-
}
|
|
75
|
+
return true;
|
|
125
76
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return this.dataStore.entities.get(entityId);
|
|
77
|
+
// ========== Delegated Methods ==========
|
|
78
|
+
// Entity Management
|
|
79
|
+
getEntity(id) {
|
|
80
|
+
return this.dataStore.entities.get(id);
|
|
131
81
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
*/
|
|
135
|
-
setEntityProperty(entityId, property, value, recordEvent = false) {
|
|
136
|
-
const entity = this.dataStore.entities.get(entityId);
|
|
137
|
-
if (!entity)
|
|
138
|
-
return;
|
|
139
|
-
entity.attributes[property] = value;
|
|
140
|
-
if (recordEvent) {
|
|
141
|
-
this.emitEvent('author:entity:property:changed', {
|
|
142
|
-
entityId,
|
|
143
|
-
property,
|
|
144
|
-
value
|
|
145
|
-
});
|
|
146
|
-
}
|
|
82
|
+
hasEntity(id) {
|
|
83
|
+
return this.dataStore.entities.has(id);
|
|
147
84
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
*/
|
|
151
|
-
addTrait(entityId, trait, recordEvent = false) {
|
|
152
|
-
const entity = this.dataStore.entities.get(entityId);
|
|
153
|
-
if (!entity)
|
|
154
|
-
return;
|
|
155
|
-
entity.add(trait);
|
|
156
|
-
if (recordEvent) {
|
|
157
|
-
this.emitEvent('author:entity:trait:added', {
|
|
158
|
-
entityId,
|
|
159
|
-
traitType: trait.type
|
|
160
|
-
});
|
|
161
|
-
}
|
|
85
|
+
removeEntity(id) {
|
|
86
|
+
return this.worldModel.removeEntity(id);
|
|
162
87
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
*/
|
|
166
|
-
removeTrait(entityId, traitType, recordEvent = false) {
|
|
167
|
-
const entity = this.dataStore.entities.get(entityId);
|
|
168
|
-
if (!entity)
|
|
169
|
-
return;
|
|
170
|
-
entity.remove(traitType);
|
|
171
|
-
if (recordEvent) {
|
|
172
|
-
this.emitEvent('author:entity:trait:removed', {
|
|
173
|
-
entityId,
|
|
174
|
-
traitType
|
|
175
|
-
});
|
|
176
|
-
}
|
|
88
|
+
getAllEntities() {
|
|
89
|
+
return Array.from(this.dataStore.entities.values());
|
|
177
90
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
* Move multiple entities to a container in one operation
|
|
181
|
-
*/
|
|
182
|
-
populate(containerId, entityIds, recordEvent = false) {
|
|
183
|
-
for (const entityId of entityIds) {
|
|
184
|
-
this.moveEntity(entityId, containerId, recordEvent);
|
|
185
|
-
}
|
|
91
|
+
updateEntity(entityId, updater) {
|
|
92
|
+
this.worldModel.updateEntity(entityId, updater);
|
|
186
93
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
connect(room1Id, room2Id, direction, recordEvent = false) {
|
|
191
|
-
const room1 = this.dataStore.entities.get(room1Id);
|
|
192
|
-
const room2 = this.dataStore.entities.get(room2Id);
|
|
193
|
-
if (!room1 || !room2)
|
|
194
|
-
return;
|
|
195
|
-
// Get opposite direction
|
|
196
|
-
const opposites = {
|
|
197
|
-
'north': 'south',
|
|
198
|
-
'south': 'north',
|
|
199
|
-
'east': 'west',
|
|
200
|
-
'west': 'east',
|
|
201
|
-
'northeast': 'southwest',
|
|
202
|
-
'northwest': 'southeast',
|
|
203
|
-
'southeast': 'northwest',
|
|
204
|
-
'southwest': 'northeast',
|
|
205
|
-
'up': 'down',
|
|
206
|
-
'down': 'up',
|
|
207
|
-
'in': 'out',
|
|
208
|
-
'out': 'in'
|
|
209
|
-
};
|
|
210
|
-
const opposite = opposites[direction] || direction;
|
|
211
|
-
// Add exits to both rooms
|
|
212
|
-
if (!room1.attributes.exits) {
|
|
213
|
-
room1.attributes.exits = {};
|
|
214
|
-
}
|
|
215
|
-
if (!room2.attributes.exits) {
|
|
216
|
-
room2.attributes.exits = {};
|
|
217
|
-
}
|
|
218
|
-
// Type assertion since we know exits is now a Record<string, string>
|
|
219
|
-
room1.attributes.exits[direction] = room2Id;
|
|
220
|
-
room2.attributes.exits[opposite] = room1Id;
|
|
221
|
-
if (recordEvent) {
|
|
222
|
-
this.emitEvent('author:rooms:connected', {
|
|
223
|
-
room1Id,
|
|
224
|
-
room2Id,
|
|
225
|
-
direction,
|
|
226
|
-
opposite
|
|
227
|
-
});
|
|
228
|
-
}
|
|
94
|
+
// Spatial Management
|
|
95
|
+
getLocation(entityId) {
|
|
96
|
+
return this.dataStore.spatialIndex.getParent(entityId);
|
|
229
97
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
*/
|
|
233
|
-
fillContainer(containerId, itemSpecs, recordEvent = false) {
|
|
234
|
-
for (const spec of itemSpecs) {
|
|
235
|
-
const item = this.createEntity(spec.name, spec.type || 'item', recordEvent);
|
|
236
|
-
// Apply attributes
|
|
237
|
-
if (spec.attributes) {
|
|
238
|
-
Object.assign(item.attributes, spec.attributes);
|
|
239
|
-
}
|
|
240
|
-
// Add traits
|
|
241
|
-
if (spec.traits) {
|
|
242
|
-
for (const traitType of spec.traits) {
|
|
243
|
-
// Note: In a real implementation, you'd need trait factories
|
|
244
|
-
// For now, we'll skip trait creation
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
this.moveEntity(item.id, containerId, recordEvent);
|
|
248
|
-
}
|
|
98
|
+
getContents(containerId, options) {
|
|
99
|
+
return this.worldModel.getContents(containerId, options);
|
|
249
100
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
*/
|
|
253
|
-
placeActor(actorId, locationId, recordEvent = false) {
|
|
254
|
-
this.moveEntity(actorId, locationId, recordEvent);
|
|
101
|
+
canMoveEntity(entityId, targetId) {
|
|
102
|
+
return true; // AuthorModel always allows moves
|
|
255
103
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
*/
|
|
259
|
-
setupContainer(containerId, isOpen, isLocked, keyId, recordEvent = false) {
|
|
260
|
-
const container = this.dataStore.entities.get(containerId);
|
|
261
|
-
if (!container)
|
|
262
|
-
return;
|
|
263
|
-
if (isOpen !== undefined) {
|
|
264
|
-
const openable = container.getTrait(openableTrait_1.OpenableTrait);
|
|
265
|
-
if (openable) {
|
|
266
|
-
openable.isOpen = isOpen;
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
const newOpenable = new openableTrait_1.OpenableTrait();
|
|
270
|
-
newOpenable.isOpen = isOpen;
|
|
271
|
-
this.addTrait(containerId, newOpenable, recordEvent);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
if (isLocked !== undefined) {
|
|
275
|
-
const lockable = container.getTrait(lockableTrait_1.LockableTrait);
|
|
276
|
-
if (lockable) {
|
|
277
|
-
lockable.isLocked = isLocked;
|
|
278
|
-
if (keyId)
|
|
279
|
-
lockable.keyId = keyId;
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
const newLockable = new lockableTrait_1.LockableTrait();
|
|
283
|
-
newLockable.isLocked = isLocked;
|
|
284
|
-
if (keyId)
|
|
285
|
-
newLockable.keyId = keyId;
|
|
286
|
-
this.addTrait(containerId, newLockable, recordEvent);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
104
|
+
getContainingRoom(entityId) {
|
|
105
|
+
return this.worldModel.getContainingRoom(entityId);
|
|
289
106
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
107
|
+
getAllContents(entityId, options) {
|
|
108
|
+
return this.worldModel.getAllContents(entityId, options);
|
|
109
|
+
}
|
|
110
|
+
// World State Management
|
|
111
|
+
getState() {
|
|
112
|
+
return { ...this.dataStore.state };
|
|
113
|
+
}
|
|
114
|
+
setState(state) {
|
|
115
|
+
Object.assign(this.dataStore.state, state);
|
|
116
|
+
}
|
|
117
|
+
getStateValue(key) {
|
|
118
|
+
return this.dataStore.state[key];
|
|
119
|
+
}
|
|
120
|
+
setStateValue(key, value) {
|
|
295
121
|
this.dataStore.state[key] = value;
|
|
296
|
-
if (recordEvent) {
|
|
297
|
-
this.emitEvent('author:state:changed', {
|
|
298
|
-
key,
|
|
299
|
-
value
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
122
|
}
|
|
123
|
+
// Prompt
|
|
124
|
+
getPrompt() {
|
|
125
|
+
return this.worldModel.getPrompt();
|
|
126
|
+
}
|
|
127
|
+
setPrompt(prompt) {
|
|
128
|
+
this.worldModel.setPrompt(prompt);
|
|
129
|
+
}
|
|
130
|
+
// Query Operations
|
|
131
|
+
findByTrait(traitType) {
|
|
132
|
+
return this.worldModel.findByTrait(traitType);
|
|
133
|
+
}
|
|
134
|
+
findByType(entityType) {
|
|
135
|
+
return this.worldModel.findByType(entityType);
|
|
136
|
+
}
|
|
137
|
+
findWhere(predicate) {
|
|
138
|
+
return this.worldModel.findWhere(predicate);
|
|
139
|
+
}
|
|
140
|
+
getVisible(observerId) {
|
|
141
|
+
return this.worldModel.getVisible(observerId);
|
|
142
|
+
}
|
|
143
|
+
getInScope(observerId) {
|
|
144
|
+
return this.worldModel.getInScope(observerId);
|
|
145
|
+
}
|
|
146
|
+
canSee(observerId, targetId) {
|
|
147
|
+
return this.worldModel.canSee(observerId, targetId);
|
|
148
|
+
}
|
|
149
|
+
// Relationship Queries
|
|
150
|
+
getRelated(entityId, relationshipType) {
|
|
151
|
+
return this.worldModel.getRelated(entityId, relationshipType);
|
|
152
|
+
}
|
|
153
|
+
areRelated(entity1Id, entity2Id, relationshipType) {
|
|
154
|
+
return this.worldModel.areRelated(entity1Id, entity2Id, relationshipType);
|
|
155
|
+
}
|
|
156
|
+
addRelationship(entity1Id, entity2Id, relationshipType) {
|
|
157
|
+
this.worldModel.addRelationship(entity1Id, entity2Id, relationshipType);
|
|
158
|
+
}
|
|
159
|
+
removeRelationship(entity1Id, entity2Id, relationshipType) {
|
|
160
|
+
this.worldModel.removeRelationship(entity1Id, entity2Id, relationshipType);
|
|
161
|
+
}
|
|
162
|
+
// Utility Methods
|
|
163
|
+
getTotalWeight(entityId) {
|
|
164
|
+
return this.worldModel.getTotalWeight(entityId);
|
|
165
|
+
}
|
|
166
|
+
wouldCreateLoop(entityId, targetId) {
|
|
167
|
+
return this.worldModel.wouldCreateLoop(entityId, targetId);
|
|
168
|
+
}
|
|
169
|
+
findPath(fromRoomId, toRoomId) {
|
|
170
|
+
return this.worldModel.findPath(fromRoomId, toRoomId);
|
|
171
|
+
}
|
|
172
|
+
getPlayer() {
|
|
173
|
+
return this.worldModel.getPlayer();
|
|
174
|
+
}
|
|
175
|
+
setPlayer(entityId) {
|
|
176
|
+
this.worldModel.setPlayer(entityId);
|
|
177
|
+
}
|
|
178
|
+
// Convenience Creators
|
|
179
|
+
connectRooms(room1Id, room2Id, direction) {
|
|
180
|
+
this.worldModel.connectRooms(room1Id, room2Id, direction);
|
|
181
|
+
}
|
|
182
|
+
createDoor(displayName, opts) {
|
|
183
|
+
return this.worldModel.createDoor(displayName, opts);
|
|
184
|
+
}
|
|
185
|
+
// Capability Management
|
|
186
|
+
registerCapability(name, registration) {
|
|
187
|
+
this.worldModel.registerCapability(name, registration);
|
|
188
|
+
}
|
|
189
|
+
updateCapability(name, data) {
|
|
190
|
+
this.worldModel.updateCapability(name, data);
|
|
191
|
+
}
|
|
192
|
+
getCapability(name) {
|
|
193
|
+
return this.worldModel.getCapability(name);
|
|
194
|
+
}
|
|
195
|
+
hasCapability(name) {
|
|
196
|
+
return this.worldModel.hasCapability(name);
|
|
197
|
+
}
|
|
198
|
+
// Score Ledger
|
|
199
|
+
awardScore(id, points, description) {
|
|
200
|
+
return this.worldModel.awardScore(id, points, description);
|
|
201
|
+
}
|
|
202
|
+
revokeScore(id) {
|
|
203
|
+
return this.worldModel.revokeScore(id);
|
|
204
|
+
}
|
|
205
|
+
hasScore(id) {
|
|
206
|
+
return this.worldModel.hasScore(id);
|
|
207
|
+
}
|
|
208
|
+
getScore() {
|
|
209
|
+
return this.worldModel.getScore();
|
|
210
|
+
}
|
|
211
|
+
getScoreEntries() {
|
|
212
|
+
return this.worldModel.getScoreEntries();
|
|
213
|
+
}
|
|
214
|
+
setMaxScore(max) {
|
|
215
|
+
this.worldModel.setMaxScore(max);
|
|
216
|
+
}
|
|
217
|
+
getMaxScore() {
|
|
218
|
+
return this.worldModel.getMaxScore();
|
|
219
|
+
}
|
|
220
|
+
// Persistence
|
|
221
|
+
toJSON() {
|
|
222
|
+
return this.worldModel.toJSON();
|
|
223
|
+
}
|
|
224
|
+
loadJSON(json) {
|
|
225
|
+
this.worldModel.loadJSON(json);
|
|
226
|
+
}
|
|
227
|
+
clear() {
|
|
228
|
+
this.worldModel.clear();
|
|
229
|
+
}
|
|
230
|
+
// Event System
|
|
231
|
+
registerEventHandler(eventType, handler) {
|
|
232
|
+
this.worldModel.registerEventHandler(eventType, handler);
|
|
233
|
+
}
|
|
234
|
+
unregisterEventHandler(eventType) {
|
|
235
|
+
this.worldModel.unregisterEventHandler(eventType);
|
|
236
|
+
}
|
|
237
|
+
registerEventValidator(eventType, validator) {
|
|
238
|
+
this.worldModel.registerEventValidator(eventType, validator);
|
|
239
|
+
}
|
|
240
|
+
registerEventPreviewer(eventType, previewer) {
|
|
241
|
+
this.worldModel.registerEventPreviewer(eventType, previewer);
|
|
242
|
+
}
|
|
243
|
+
connectEventProcessor(wiring) {
|
|
244
|
+
this.worldModel.connectEventProcessor(wiring);
|
|
245
|
+
}
|
|
246
|
+
chainEvent(triggerType, handler, options) {
|
|
247
|
+
this.worldModel.chainEvent(triggerType, handler, options);
|
|
248
|
+
}
|
|
249
|
+
applyEvent(event) {
|
|
250
|
+
this.worldModel.applyEvent(event);
|
|
251
|
+
}
|
|
252
|
+
canApplyEvent(event) {
|
|
253
|
+
return this.worldModel.canApplyEvent(event);
|
|
254
|
+
}
|
|
255
|
+
previewEvent(event) {
|
|
256
|
+
return this.worldModel.previewEvent(event);
|
|
257
|
+
}
|
|
258
|
+
getAppliedEvents() {
|
|
259
|
+
return this.worldModel.getAppliedEvents();
|
|
260
|
+
}
|
|
261
|
+
getEventsSince(timestamp) {
|
|
262
|
+
return this.worldModel.getEventsSince(timestamp);
|
|
263
|
+
}
|
|
264
|
+
clearEventHistory() {
|
|
265
|
+
this.worldModel.clearEventHistory();
|
|
266
|
+
}
|
|
267
|
+
// Scope Management
|
|
268
|
+
getScopeRegistry() {
|
|
269
|
+
return this.worldModel.getScopeRegistry();
|
|
270
|
+
}
|
|
271
|
+
addScopeRule(rule) {
|
|
272
|
+
this.worldModel.addScopeRule(rule);
|
|
273
|
+
}
|
|
274
|
+
removeScopeRule(ruleId) {
|
|
275
|
+
return this.worldModel.removeScopeRule(ruleId);
|
|
276
|
+
}
|
|
277
|
+
evaluateScope(actorId, actionId) {
|
|
278
|
+
return this.worldModel.evaluateScope(actorId, actionId);
|
|
279
|
+
}
|
|
280
|
+
// Vocabulary Management
|
|
281
|
+
getGrammarVocabularyProvider() {
|
|
282
|
+
return this.worldModel.getGrammarVocabularyProvider();
|
|
283
|
+
}
|
|
284
|
+
// ========== Author-Only Convenience Methods ==========
|
|
303
285
|
/**
|
|
304
|
-
*
|
|
286
|
+
* Move multiple entities to a container in one operation.
|
|
305
287
|
*/
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
console.warn(`Setting player to non-existent entity: ${entityId}`);
|
|
310
|
-
}
|
|
311
|
-
// If we have a reference to the WorldModel, use its setPlayer method
|
|
312
|
-
if (this.worldModel) {
|
|
313
|
-
// as any: justified — AuthorModel bypasses WorldModel.setPlayer() validation
|
|
314
|
-
this.worldModel.playerId = entityId;
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
this.dataStore.playerId = entityId;
|
|
318
|
-
}
|
|
319
|
-
if (recordEvent) {
|
|
320
|
-
this.emitEvent('author:player:set', {
|
|
321
|
-
playerId: entityId
|
|
322
|
-
});
|
|
288
|
+
populate(containerId, entityIds) {
|
|
289
|
+
for (const entityId of entityIds) {
|
|
290
|
+
this.moveEntity(entityId, containerId);
|
|
323
291
|
}
|
|
324
292
|
}
|
|
325
|
-
// ========== Bulk Operations ==========
|
|
326
293
|
/**
|
|
327
|
-
*
|
|
294
|
+
* Add a trait to an entity.
|
|
328
295
|
*/
|
|
329
|
-
|
|
330
|
-
this.dataStore.entities.
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
for (const key in this.dataStore.state) {
|
|
334
|
-
delete this.dataStore.state[key];
|
|
335
|
-
}
|
|
336
|
-
if (this.worldModel) {
|
|
337
|
-
// as any: justified — AuthorModel bypasses WorldModel.setPlayer() validation
|
|
338
|
-
this.worldModel.playerId = undefined;
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
this.dataStore.playerId = undefined;
|
|
342
|
-
}
|
|
343
|
-
this.dataStore.relationships.clear();
|
|
344
|
-
this.dataStore.idCounters.clear();
|
|
345
|
-
this.dataStore.capabilities = {};
|
|
346
|
-
if (recordEvent) {
|
|
347
|
-
this.emitEvent('author:world:cleared', {});
|
|
296
|
+
addTrait(entityId, trait) {
|
|
297
|
+
const entity = this.dataStore.entities.get(entityId);
|
|
298
|
+
if (entity) {
|
|
299
|
+
entity.add(trait);
|
|
348
300
|
}
|
|
349
301
|
}
|
|
350
302
|
/**
|
|
351
|
-
*
|
|
303
|
+
* Remove a trait from an entity.
|
|
352
304
|
*/
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
this.emitEvent('author:world:imported', {
|
|
358
|
-
entityCount: this.dataStore.entities.size
|
|
359
|
-
});
|
|
305
|
+
removeTrait(entityId, traitType) {
|
|
306
|
+
const entity = this.dataStore.entities.get(entityId);
|
|
307
|
+
if (entity) {
|
|
308
|
+
entity.remove(traitType);
|
|
360
309
|
}
|
|
361
310
|
}
|
|
362
311
|
// ========== Private Helpers ==========
|
|
363
|
-
/**
|
|
364
|
-
* Generate an ID for a new entity
|
|
365
|
-
*/
|
|
366
312
|
generateId(type) {
|
|
367
313
|
const TYPE_PREFIXES = {
|
|
368
314
|
'room': 'r',
|
|
@@ -385,33 +331,6 @@ class AuthorModel {
|
|
|
385
331
|
const base36 = nextCounter.toString(36).padStart(2, '0');
|
|
386
332
|
return `${prefix}${base36}`;
|
|
387
333
|
}
|
|
388
|
-
/**
|
|
389
|
-
* Emit an author event if event recording is enabled
|
|
390
|
-
*/
|
|
391
|
-
emitEvent(eventType, data) {
|
|
392
|
-
const handler = this.eventHandlers.get(eventType);
|
|
393
|
-
if (handler) {
|
|
394
|
-
// Ensure the event has the type field included
|
|
395
|
-
const event = {
|
|
396
|
-
type: eventType,
|
|
397
|
-
timestamp: Date.now(),
|
|
398
|
-
...data
|
|
399
|
-
};
|
|
400
|
-
handler(event);
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
/**
|
|
404
|
-
* Register an event handler for author events
|
|
405
|
-
*/
|
|
406
|
-
registerEventHandler(eventType, handler) {
|
|
407
|
-
this.eventHandlers.set(eventType, handler);
|
|
408
|
-
}
|
|
409
|
-
/**
|
|
410
|
-
* Unregister an event handler
|
|
411
|
-
*/
|
|
412
|
-
unregisterEventHandler(eventType) {
|
|
413
|
-
this.eventHandlers.delete(eventType);
|
|
414
|
-
}
|
|
415
334
|
}
|
|
416
335
|
exports.AuthorModel = AuthorModel;
|
|
417
336
|
//# sourceMappingURL=AuthorModel.js.map
|
package/world/AuthorModel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorModel.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/world/AuthorModel.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"AuthorModel.js","sourceRoot":"","sources":["../../../../../../../repos/sharpee/packages/world-model/src/world/AuthorModel.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,qDAAiD;AAwDjD;;;;;;;;;;;GAWG;AACH,MAAa,WAAW;IACd,SAAS,CAAa;IACtB,UAAU,CAAc;IAEhC,YAAY,SAAqB,EAAE,UAAuB;QACxD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,+DAA+D;IAE/D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