docs: document story engine and PR2 playable loop
This commit is contained in:
+4
-10
@@ -6,21 +6,17 @@ import {
|
||||
isActionAvailable,
|
||||
tickGame,
|
||||
} from '../engine/game';
|
||||
import {
|
||||
applyChoice as engineApplyChoice,
|
||||
enterStoryNode,
|
||||
initStory,
|
||||
} from '../engine/story';
|
||||
import { applyChoice as engineApplyChoice, enterStoryNode, initStory } from '../engine/story';
|
||||
import { advance, createTickLoop, TICK_MS, type TickLoop } from '../engine/tickLoop';
|
||||
import { createDefaultBackend, loadGame, type SaveBackend, saveGame } from './persistence';
|
||||
import { getPrefs } from './prefs';
|
||||
import { useGameStore } from './store';
|
||||
import {
|
||||
processStoryTriggers,
|
||||
type StoryUiEffect,
|
||||
shouldAutoOpenPanel,
|
||||
storyEventsToLogEntries,
|
||||
type StoryUiEffect,
|
||||
} from './storyOrchestration';
|
||||
import { useGameStore } from './store';
|
||||
import { formatOfflineDuration, toView } from './viewModel';
|
||||
|
||||
/**
|
||||
@@ -153,9 +149,7 @@ class GameRuntime {
|
||||
const store = useGameStore.getState();
|
||||
for (const entry of entries) store.appendStoryLog(entry);
|
||||
for (const entry of entries) {
|
||||
store.appendLog(
|
||||
`Story: ${content.storyNodesById[entry.nodeId]?.prose.slice(0, 40)}…`,
|
||||
);
|
||||
store.appendLog(`Story: ${content.storyNodesById[entry.nodeId]?.prose.slice(0, 40)}…`);
|
||||
}
|
||||
const prefs = store.prefs;
|
||||
if (shouldAutoOpenPanel(prefs, 'fork_choice', content)) {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { create } from 'zustand';
|
||||
import { getPrefs, setPrefs as persistPrefs, type GamePrefs } from './prefs';
|
||||
import { type GamePrefs, getPrefs, setPrefs as persistPrefs } from './prefs';
|
||||
import type { GameView } from './viewModel';
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,8 @@ import type { GameContent } from '../content/index';
|
||||
import {
|
||||
canAffordAction,
|
||||
canUnlockAction,
|
||||
isActionAvailable,
|
||||
type GameState,
|
||||
isActionAvailable,
|
||||
} from '../engine/game';
|
||||
import { getAvailableChoices, getCurrentNode } from '../engine/story';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user