@sharpee/sharpee 0.9.77-beta → 0.9.78-beta

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sharpee/sharpee",
3
- "version": "0.9.77-beta",
3
+ "version": "0.9.78-beta",
4
4
  "description": "Sharpee - Interactive Fiction Engine for TypeScript",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -15,23 +15,23 @@
15
15
  }
16
16
  },
17
17
  "dependencies": {
18
- "@sharpee/core": "^0.9.77-beta",
19
- "@sharpee/engine": "^0.9.77-beta",
20
- "@sharpee/event-processor": "^0.9.77-beta",
21
- "@sharpee/ext-testing": "^0.9.77-beta",
22
- "@sharpee/if-domain": "^0.9.77-beta",
23
- "@sharpee/if-services": "^0.9.77-beta",
24
- "@sharpee/lang-en-us": "^0.9.77-beta",
25
- "@sharpee/parser-en-us": "^0.9.77-beta",
26
- "@sharpee/platform-browser": "^0.9.77-beta",
27
- "@sharpee/plugin-npc": "^0.9.77-beta",
28
- "@sharpee/plugin-scheduler": "^0.9.77-beta",
29
- "@sharpee/plugin-state-machine": "^0.9.77-beta",
30
- "@sharpee/plugins": "^0.9.77-beta",
31
- "@sharpee/stdlib": "^0.9.77-beta",
32
- "@sharpee/text-blocks": "^0.9.77-beta",
33
- "@sharpee/text-service": "^0.9.77-beta",
34
- "@sharpee/world-model": "^0.9.77-beta",
18
+ "@sharpee/core": "^0.9.78-beta",
19
+ "@sharpee/engine": "^0.9.78-beta",
20
+ "@sharpee/event-processor": "^0.9.78-beta",
21
+ "@sharpee/ext-testing": "^0.9.78-beta",
22
+ "@sharpee/if-domain": "^0.9.78-beta",
23
+ "@sharpee/if-services": "^0.9.78-beta",
24
+ "@sharpee/lang-en-us": "^0.9.78-beta",
25
+ "@sharpee/parser-en-us": "^0.9.78-beta",
26
+ "@sharpee/platform-browser": "^0.9.78-beta",
27
+ "@sharpee/plugin-npc": "^0.9.78-beta",
28
+ "@sharpee/plugin-scheduler": "^0.9.78-beta",
29
+ "@sharpee/plugin-state-machine": "^0.9.78-beta",
30
+ "@sharpee/plugins": "^0.9.78-beta",
31
+ "@sharpee/stdlib": "^0.9.78-beta",
32
+ "@sharpee/text-blocks": "^0.9.78-beta",
33
+ "@sharpee/text-service": "^0.9.78-beta",
34
+ "@sharpee/world-model": "^0.9.78-beta",
35
35
  "fflate": "^0.8.2"
36
36
  },
37
37
  "keywords": [
@@ -10,7 +10,7 @@ import {
10
10
  WorldModel,
11
11
  IFEntity,
12
12
  Parser,
13
- LanguageProvider,
13
+ EnglishLanguageProvider,
14
14
  } from '@sharpee/sharpee';
15
15
 
16
16
  export const config: StoryConfig = {
@@ -24,25 +24,31 @@ export const config: StoryConfig = {
24
24
  export const story: Story = {
25
25
  config,
26
26
 
27
- initializeWorld(world: WorldModel): IFEntity {
27
+ createPlayer(world: WorldModel): IFEntity {
28
+ const player = world.createEntity('player', 'actor');
29
+ player.attributes.name = 'you';
30
+ player.attributes.description = 'An adventurer.';
31
+ return player;
32
+ },
33
+
34
+ initializeWorld(world: WorldModel): void {
28
35
  // Get the player entity
29
- const player = world.getPlayer();
36
+ const player = world.getPlayer()!;
30
37
 
31
38
  // === CREATE YOUR ROOMS ===
32
39
 
33
40
  // Starting room
34
- const startRoom = world.createRoom('start-room', {
35
- name: 'Starting Room',
36
- description: 'You are in a small, dimly lit room. This is where your adventure begins.',
37
- });
41
+ const startRoom = world.createEntity('start-room', 'room');
42
+ startRoom.attributes.name = 'Starting Room';
43
+ startRoom.attributes.description =
44
+ 'You are in a small, dimly lit room. This is where your adventure begins.';
38
45
 
39
46
  // === CREATE YOUR OBJECTS ===
40
47
 
41
48
  // Example: a simple object
42
- // const key = world.createEntity('key', 'object', {
43
- // name: 'brass key',
44
- // description: 'A small brass key.',
45
- // });
49
+ // const key = world.createEntity('key', 'object');
50
+ // key.attributes.name = 'brass key';
51
+ // key.attributes.description = 'A small brass key.';
46
52
  // world.moveEntity(key.id, startRoom.id);
47
53
 
48
54
  // === CONNECT YOUR ROOMS ===
@@ -52,19 +58,16 @@ export const story: Story = {
52
58
 
53
59
  // Place player in starting room
54
60
  world.moveEntity(player.id, startRoom.id);
55
-
56
- // Return the starting room
57
- return startRoom;
58
61
  },
59
62
 
60
- // Optional: extend the parser with custom vocabulary
63
+ // Optional: extend the parser with story-specific vocabulary
61
64
  extendParser(parser: Parser): void {
62
65
  // const grammar = parser.getStoryGrammar();
63
66
  // grammar.define('custom command').mapsTo('story.action.custom').build();
64
67
  },
65
68
 
66
- // Optional: extend the language with custom messages
67
- extendLanguage(language: LanguageProvider): void {
69
+ // Optional: extend the language with story-specific messages
70
+ extendLanguage(language: EnglishLanguageProvider): void {
68
71
  // language.addMessages({
69
72
  // 'story.message.custom': 'A custom message.',
70
73
  // });