@sharpee/core
v0.9.92
Published
Core functionality for the Sharpee interactive fiction engine
Maintainers
Readme
@sharpee/core
Core types, interfaces, and utilities for the Sharpee Interactive Fiction platform.
Installation
npm install @sharpee/coreOverview
This package provides the foundational types used across all Sharpee packages:
- Event System -
SemanticEvent, typed event registry, event helpers - Query System -
QueryManagerfor player input (yes/no, menus) - Platform Events - Save, restore, quit, restart handling
- Core Utilities - Common interfaces and type definitions
Usage
import {
SemanticEvent,
createTypedEvent,
isEventType,
QueryManager,
PlatformEventType
} from '@sharpee/core';
// Create typed events
const event = createTypedEvent('game.started', { timestamp: Date.now() });
// Type-safe event checking
if (isEventType(event, 'game.started')) {
console.log(event.data.timestamp);
}Related Packages
- @sharpee/sharpee - Full platform bundle
- @sharpee/engine - Game runtime
- @sharpee/world-model - Entity system
License
MIT
