Skip to content

Commit 69b34d0

Browse files
committed
feat(interfaces): add fields to interfaces
add actors, currentActor, currentVerb to Room, add moveTo, say to Actor, add inventoryImage to Item
1 parent db3bb26 commit 69b34d0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @flow
22

33
class Adventure {
4+
register() {}
45
init() {}
56
}

src/interfaces.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,24 @@ export type Verb =
1414
export interface Room {
1515
id: string;
1616
name: string;
17-
items: Item[];
17+
items: Map<string, Item>;
18+
actors: Map<string, Actor>;
19+
currentActor: Actor;
20+
currentVerb: Verb;
1821
}
1922

2023
export interface Actor {
2124
id: string;
2225
name: string;
2326
inventory: Item[];
2427
do: (verb: Verb) => void;
28+
moveTo: (x: number, y: number) => void;
29+
say: (text: string) => void;
2530
}
2631

2732
export interface Item {
2833
id: string;
2934
name: string;
3035
verbs: Map<Verb, () => void>;
36+
inventoryImage: string;
3137
}

0 commit comments

Comments
 (0)