add ability to move from room to room.

This commit is contained in:
2021-06-01 16:06:18 -07:00
parent 8f6d7e4db4
commit 08ee3d1b5d
8 changed files with 150 additions and 45 deletions

View File

@ -23,7 +23,7 @@ export interface Args {
// Conditions contains story elements that can be conditionally applied to the scene or
// player
export interface Conditions<T extends VesselProperties> {
export interface Conditions<T extends EntityProperties> {
effects: Effect<T>[];
}
@ -41,7 +41,7 @@ export type Direction =
| "down";
// Effect represents some effect that may be applied to a scene or player
export interface Effect<T extends VesselProperties> {
export interface Effect<T extends EntityProperties> {
name: string;
properties: T;
source: "player" | "scene"; // where the effect is applied
@ -57,7 +57,7 @@ export interface Exit {
// Item represents some item either in the scene or in the player's inventory
export interface Item {
name: string;
actions: { [name: string]: ItemAction };
actions?: { [name: string]: ItemAction };
}
// ItemActionType is a union of all the types of action that can be used
@ -69,20 +69,22 @@ export interface ItemAction {
args: ActionArgs;
}
// SceneProperties are the properties (in addition to the VesselProperties) that are
// SceneProperties are the properties (in addition to the EntityProperties) that are
// needed by the scene
export interface SceneProperties extends VesselProperties {
export interface SceneProperties extends EntityProperties {
description?: string;
exits?: Exit[];
name?: string;
}
// StoryScene holds both the conditions and properties for a scene.
export interface StoryScene<T extends VesselProperties> {
export interface StoryScene<T extends EntityProperties> {
identifier: string;
conditions: Conditions<T>;
properties: SceneProperties;
}
// VesselProperties is a base interface for the properties that a user or scene might have
export interface VesselProperties {
// EntityProperties is a base interface for the properties that a user or scene might have
export interface EntityProperties {
items?: Item[];
}