@almadar/ui 2.0.1 → 2.0.3
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/dist/components/index.css +9 -11
- package/dist/components/index.js +3 -3
- package/dist/providers/index.css +9 -11
- package/dist/providers/index.js +2 -2
- package/package.json +2 -2
- package/dist/components/atoms/Avatar.d.ts +0 -58
- package/dist/components/atoms/Badge.d.ts +0 -8
- package/dist/components/atoms/Box.d.ts +0 -57
- package/dist/components/atoms/Button.d.ts +0 -24
- package/dist/components/atoms/Card.d.ts +0 -18
- package/dist/components/atoms/Center.d.ts +0 -33
- package/dist/components/atoms/Checkbox.d.ts +0 -5
- package/dist/components/atoms/ConditionalWrapper.d.ts +0 -68
- package/dist/components/atoms/Divider.d.ts +0 -29
- package/dist/components/atoms/Icon.d.ts +0 -38
- package/dist/components/atoms/Input.d.ts +0 -26
- package/dist/components/atoms/Label.d.ts +0 -5
- package/dist/components/atoms/LawReferenceTooltip.d.ts +0 -48
- package/dist/components/atoms/Overlay.d.ts +0 -16
- package/dist/components/atoms/ProgressBar.d.ts +0 -63
- package/dist/components/atoms/Radio.d.ts +0 -26
- package/dist/components/atoms/Select.d.ts +0 -12
- package/dist/components/atoms/Spacer.d.ts +0 -25
- package/dist/components/atoms/Spinner.d.ts +0 -6
- package/dist/components/atoms/Stack.d.ts +0 -64
- package/dist/components/atoms/Switch.d.ts +0 -12
- package/dist/components/atoms/TextHighlight.d.ts +0 -53
- package/dist/components/atoms/Textarea.d.ts +0 -5
- package/dist/components/atoms/ThemeSelector.d.ts +0 -21
- package/dist/components/atoms/ThemeToggle.d.ts +0 -33
- package/dist/components/atoms/Typography.d.ts +0 -57
- package/dist/components/atoms/game/ControlButton.d.ts +0 -31
- package/dist/components/atoms/game/HealthBar.d.ts +0 -18
- package/dist/components/atoms/game/ScoreDisplay.d.ts +0 -21
- package/dist/components/atoms/game/Sprite.d.ts +0 -63
- package/dist/components/atoms/game/StateIndicator.d.ts +0 -31
- package/dist/components/atoms/game/index.d.ts +0 -12
- package/dist/components/atoms/index.d.ts +0 -27
- package/dist/components/index.d.ts +0 -6
- package/dist/components/molecules/Accordion.d.ts +0 -67
- package/dist/components/molecules/Alert.d.ts +0 -24
- package/dist/components/molecules/Breadcrumb.d.ts +0 -55
- package/dist/components/molecules/ButtonGroup.d.ts +0 -67
- package/dist/components/molecules/Card.d.ts +0 -44
- package/dist/components/molecules/Container.d.ts +0 -30
- package/dist/components/molecules/Drawer.d.ts +0 -46
- package/dist/components/molecules/EmptyState.d.ts +0 -25
- package/dist/components/molecules/ErrorBoundary.d.ts +0 -55
- package/dist/components/molecules/ErrorState.d.ts +0 -13
- package/dist/components/molecules/FilterGroup.d.ts +0 -54
- package/dist/components/molecules/Flex.d.ts +0 -43
- package/dist/components/molecules/FloatingActionButton.d.ts +0 -69
- package/dist/components/molecules/FormField.d.ts +0 -16
- package/dist/components/molecules/FormSectionHeader.d.ts +0 -30
- package/dist/components/molecules/Grid.d.ts +0 -54
- package/dist/components/molecules/InputGroup.d.ts +0 -24
- package/dist/components/molecules/LoadingState.d.ts +0 -7
- package/dist/components/molecules/Menu.d.ts +0 -40
- package/dist/components/molecules/Modal.d.ts +0 -26
- package/dist/components/molecules/Pagination.d.ts +0 -66
- package/dist/components/molecules/Popover.d.ts +0 -39
- package/dist/components/molecules/QuizBlock.d.ts +0 -20
- package/dist/components/molecules/RelationSelect.d.ts +0 -48
- package/dist/components/molecules/RepeatableFormSection.d.ts +0 -58
- package/dist/components/molecules/ScaledDiagram.d.ts +0 -20
- package/dist/components/molecules/SearchInput.d.ts +0 -60
- package/dist/components/molecules/SidePanel.d.ts +0 -47
- package/dist/components/molecules/SimpleGrid.d.ts +0 -27
- package/dist/components/molecules/Skeleton.d.ts +0 -35
- package/dist/components/molecules/Tabs.d.ts +0 -45
- package/dist/components/molecules/Toast.d.ts +0 -35
- package/dist/components/molecules/Tooltip.d.ts +0 -25
- package/dist/components/molecules/ViolationAlert.d.ts +0 -49
- package/dist/components/molecules/WizardNavigation.d.ts +0 -51
- package/dist/components/molecules/WizardProgress.d.ts +0 -42
- package/dist/components/molecules/game/StatBadge.d.ts +0 -27
- package/dist/components/molecules/index.d.ts +0 -38
- package/dist/components/molecules/markdown/CodeBlock.d.ts +0 -25
- package/dist/components/molecules/markdown/MarkdownContent.d.ts +0 -26
- package/dist/components/organisms/CardGrid.d.ts +0 -72
- package/dist/components/organisms/Chart.d.ts +0 -59
- package/dist/components/organisms/CodeViewer.d.ts +0 -67
- package/dist/components/organisms/ComponentPatterns.d.ts +0 -441
- package/dist/components/organisms/ConfirmDialog.d.ts +0 -50
- package/dist/components/organisms/ContentRenderer.d.ts +0 -23
- package/dist/components/organisms/CustomPattern.d.ts +0 -104
- package/dist/components/organisms/DataTable.d.ts +0 -63
- package/dist/components/organisms/DetailPanel.d.ts +0 -71
- package/dist/components/organisms/DocumentViewer.d.ts +0 -60
- package/dist/components/organisms/DrawerSlot.d.ts +0 -39
- package/dist/components/organisms/Form.d.ts +0 -203
- package/dist/components/organisms/FormSection.d.ts +0 -59
- package/dist/components/organisms/GraphCanvas.d.ts +0 -69
- package/dist/components/organisms/Header.d.ts +0 -110
- package/dist/components/organisms/JazariStateMachine.d.ts +0 -60
- package/dist/components/organisms/LayoutPatterns.d.ts +0 -181
- package/dist/components/organisms/List.d.ts +0 -76
- package/dist/components/organisms/MasterDetail.d.ts +0 -43
- package/dist/components/organisms/MediaGallery.d.ts +0 -66
- package/dist/components/organisms/Meter.d.ts +0 -58
- package/dist/components/organisms/ModalSlot.d.ts +0 -35
- package/dist/components/organisms/Navigation.d.ts +0 -68
- package/dist/components/organisms/OrbitalVisualization.d.ts +0 -48
- package/dist/components/organisms/PageHeader.d.ts +0 -59
- package/dist/components/organisms/Section.d.ts +0 -44
- package/dist/components/organisms/Sidebar.d.ts +0 -65
- package/dist/components/organisms/SignaturePad.d.ts +0 -44
- package/dist/components/organisms/Split.d.ts +0 -42
- package/dist/components/organisms/StatCard.d.ts +0 -66
- package/dist/components/organisms/StateMachineView.d.ts +0 -36
- package/dist/components/organisms/Table.d.ts +0 -99
- package/dist/components/organisms/Timeline.d.ts +0 -58
- package/dist/components/organisms/ToastSlot.d.ts +0 -38
- package/dist/components/organisms/UISlotRenderer.d.ts +0 -112
- package/dist/components/organisms/WizardContainer.d.ts +0 -160
- package/dist/components/organisms/book/BookChapterView.d.ts +0 -17
- package/dist/components/organisms/book/BookCoverPage.d.ts +0 -19
- package/dist/components/organisms/book/BookNavBar.d.ts +0 -18
- package/dist/components/organisms/book/BookTableOfContents.d.ts +0 -18
- package/dist/components/organisms/book/BookViewer.d.ts +0 -28
- package/dist/components/organisms/book/index.d.ts +0 -7
- package/dist/components/organisms/book/types.d.ts +0 -77
- package/dist/components/organisms/game/BattleBoard.d.ts +0 -167
- package/dist/components/organisms/game/CanvasEffect.d.ts +0 -68
- package/dist/components/organisms/game/CastleBoard.d.ts +0 -85
- package/dist/components/organisms/game/DialogueBox.d.ts +0 -73
- package/dist/components/organisms/game/GameAudioProvider.d.ts +0 -47
- package/dist/components/organisms/game/GameAudioToggle.d.ts +0 -28
- package/dist/components/organisms/game/GameHud.d.ts +0 -40
- package/dist/components/organisms/game/GameMenu.d.ts +0 -43
- package/dist/components/organisms/game/GameOverScreen.d.ts +0 -56
- package/dist/components/organisms/game/InventoryPanel.d.ts +0 -67
- package/dist/components/organisms/game/IsometricCanvas.d.ts +0 -123
- package/dist/components/organisms/game/TraitSlot.d.ts +0 -86
- package/dist/components/organisms/game/TraitStateViewer.d.ts +0 -53
- package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts +0 -26
- package/dist/components/organisms/game/WorldMapBoard.d.ts +0 -147
- package/dist/components/organisms/game/editor/editorUtils.d.ts +0 -109
- package/dist/components/organisms/game/editor/index.d.ts +0 -9
- package/dist/components/organisms/game/hooks/useBattleState.d.ts +0 -35
- package/dist/components/organisms/game/hooks/useCamera.d.ts +0 -41
- package/dist/components/organisms/game/hooks/useGameAudio.d.ts +0 -47
- package/dist/components/organisms/game/hooks/useImageCache.d.ts +0 -16
- package/dist/components/organisms/game/hooks/usePhysics2D.d.ts +0 -45
- package/dist/components/organisms/game/hooks/useSpriteAnimations.d.ts +0 -43
- package/dist/components/organisms/game/index.d.ts +0 -36
- package/dist/components/organisms/game/managers/PhysicsManager.d.ts +0 -103
- package/dist/components/organisms/game/types/effects.d.ts +0 -253
- package/dist/components/organisms/game/types/isometric.d.ts +0 -109
- package/dist/components/organisms/game/types/spriteAnimation.d.ts +0 -73
- package/dist/components/organisms/game/utils/canvasEffects.d.ts +0 -50
- package/dist/components/organisms/game/utils/combatPresets.d.ts +0 -15
- package/dist/components/organisms/game/utils/isometric.d.ts +0 -61
- package/dist/components/organisms/game/utils/spriteAnimation.d.ts +0 -57
- package/dist/components/organisms/game/utils/spriteSheetConstants.d.ts +0 -16
- package/dist/components/organisms/index.d.ts +0 -37
- package/dist/components/organisms/layout/DashboardGrid.d.ts +0 -34
- package/dist/components/organisms/layout/MasterDetail.d.ts +0 -32
- package/dist/components/organisms/layout/SplitPane.d.ts +0 -34
- package/dist/components/organisms/layout/TabbedContainer.d.ts +0 -42
- package/dist/components/organisms/layout/index.d.ts +0 -9
- package/dist/components/organisms/types.d.ts +0 -65
- package/dist/components/templates/AuthLayout.d.ts +0 -14
- package/dist/components/templates/BattleTemplate.d.ts +0 -25
- package/dist/components/templates/CastleTemplate.d.ts +0 -23
- package/dist/components/templates/CounterTemplate.d.ts +0 -44
- package/dist/components/templates/DashboardLayout.d.ts +0 -32
- package/dist/components/templates/GameShell.d.ts +0 -33
- package/dist/components/templates/GameTemplate.d.ts +0 -36
- package/dist/components/templates/GenericAppTemplate.d.ts +0 -30
- package/dist/components/templates/WorldMapTemplate.d.ts +0 -29
- package/dist/components/templates/index.d.ts +0 -10
- package/dist/components/templates/types.d.ts +0 -17
- package/dist/context/DesignThemeContext.d.ts +0 -21
- package/dist/context/ThemeContext.d.ts +0 -104
- package/dist/context/UISlotContext.d.ts +0 -75
- package/dist/context/UserContext.d.ts +0 -111
- package/dist/context/index.d.ts +0 -8
- package/dist/hooks/event-bus-types.d.ts +0 -71
- package/dist/hooks/index.d.ts +0 -25
- package/dist/hooks/useAgentChat.d.ts +0 -104
- package/dist/hooks/useAuthContext.d.ts +0 -25
- package/dist/hooks/useCompile.d.ts +0 -22
- package/dist/hooks/useDeepAgentGeneration.d.ts +0 -46
- package/dist/hooks/useEntities.d.ts +0 -52
- package/dist/hooks/useEntityData.d.ts +0 -155
- package/dist/hooks/useEntityMutations.d.ts +0 -80
- package/dist/hooks/useEventBus.d.ts +0 -96
- package/dist/hooks/useExtensions.d.ts +0 -32
- package/dist/hooks/useFileEditor.d.ts +0 -32
- package/dist/hooks/useFileSystem.d.ts +0 -40
- package/dist/hooks/useGitHub.d.ts +0 -58
- package/dist/hooks/useOrbitalHistory.d.ts +0 -39
- package/dist/hooks/useOrbitalMutations.d.ts +0 -95
- package/dist/hooks/usePreview.d.ts +0 -57
- package/dist/hooks/useQuerySingleton.d.ts +0 -78
- package/dist/hooks/useResolvedEntity.d.ts +0 -32
- package/dist/hooks/useTranslate.d.ts +0 -35
- package/dist/hooks/useUIEvents.d.ts +0 -35
- package/dist/hooks/useUISlots.d.ts +0 -84
- package/dist/hooks/useValidation.d.ts +0 -46
- package/dist/lib/api-client.d.ts +0 -42
- package/dist/lib/cn.d.ts +0 -6
- package/dist/lib/debug.d.ts +0 -43
- package/dist/lib/debugRegistry.d.ts +0 -29
- package/dist/lib/debugUtils.d.ts +0 -27
- package/dist/lib/entityDebug.d.ts +0 -38
- package/dist/lib/getNestedValue.d.ts +0 -33
- package/dist/lib/guardRegistry.d.ts +0 -32
- package/dist/lib/index.d.ts +0 -18
- package/dist/lib/jazari/svg-paths.d.ts +0 -61
- package/dist/lib/parseContentSegments.d.ts +0 -41
- package/dist/lib/tickRegistry.d.ts +0 -40
- package/dist/lib/traitRegistry.d.ts +0 -34
- package/dist/lib/verificationRegistry.d.ts +0 -107
- package/dist/lib/visualizer/index.d.ts +0 -143
- package/dist/locales/index.d.ts +0 -20
- package/dist/providers/EventBusProvider.d.ts +0 -60
- package/dist/providers/FetchedDataProvider.d.ts +0 -105
- package/dist/providers/OfflineModeProvider.d.ts +0 -79
- package/dist/providers/OrbitalProvider.d.ts +0 -101
- package/dist/providers/SelectionProvider.d.ts +0 -81
- package/dist/providers/VerificationProvider.d.ts +0 -63
- package/dist/providers/index.d.ts +0 -17
- package/dist/renderer/client-effect-executor.d.ts +0 -68
- package/dist/renderer/data-resolver.d.ts +0 -68
- package/dist/renderer/index.d.ts +0 -28
- package/dist/renderer/init.d.ts +0 -14
- package/dist/renderer/navigation.d.ts +0 -142
- package/dist/renderer/offline-executor.d.ts +0 -238
- package/dist/renderer/pattern-resolver.d.ts +0 -91
- package/dist/renderer/slot-definitions.d.ts +0 -45
- package/dist/renderer/types.d.ts +0 -160
- package/dist/renderer/useClientEffects.d.ts +0 -88
- package/dist/stores/entityStore.d.ts +0 -99
- package/dist/stores/filtering.d.ts +0 -51
- package/dist/stores/index.d.ts +0 -7
- package/dist/{chunk-RIZ76XRF.js → chunk-X3IKFHFT.js} +1 -1
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WorldMapBoard
|
|
3
|
-
*
|
|
4
|
-
* Organism for the strategic world-map view. Renders an isometric hex/iso
|
|
5
|
-
* map with hero selection, movement animation, and encounter callbacks.
|
|
6
|
-
* Game-specific panels (hero detail, hero lists, resource bars) are injected
|
|
7
|
-
* via render-prop slots.
|
|
8
|
-
*
|
|
9
|
-
* **State categories (closed-circuit compliant):**
|
|
10
|
-
* - Game data (hexes, heroes, selectedHeroId, features) → received via
|
|
11
|
-
* `entity` prop; the Orbital trait owns this state.
|
|
12
|
-
* - Rendering state (hoveredTile, movingPositions animation) → local only.
|
|
13
|
-
* - Events → emitted via `useEventBus()` for trait integration.
|
|
14
|
-
*
|
|
15
|
-
* This component is mostly prop-driven. The only internal state is hover
|
|
16
|
-
* tracking and movement animation interpolation, both of which are
|
|
17
|
-
* rendering-only concerns that cannot (and should not) be externalised.
|
|
18
|
-
*
|
|
19
|
-
* @packageDocumentation
|
|
20
|
-
*/
|
|
21
|
-
import React from 'react';
|
|
22
|
-
import type { IsometricFeature } from './types/isometric';
|
|
23
|
-
import type { ResolvedFrame } from './types/spriteAnimation';
|
|
24
|
-
/** A hero on the world map */
|
|
25
|
-
export interface MapHero {
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
owner: 'player' | 'enemy' | string;
|
|
29
|
-
position: {
|
|
30
|
-
x: number;
|
|
31
|
-
y: number;
|
|
32
|
-
};
|
|
33
|
-
movement: number;
|
|
34
|
-
sprite?: string;
|
|
35
|
-
level?: number;
|
|
36
|
-
}
|
|
37
|
-
/** A hex on the map */
|
|
38
|
-
export interface MapHex {
|
|
39
|
-
x: number;
|
|
40
|
-
y: number;
|
|
41
|
-
terrain: string;
|
|
42
|
-
terrainSprite?: string;
|
|
43
|
-
feature?: string;
|
|
44
|
-
featureData?: Record<string, unknown>;
|
|
45
|
-
passable?: boolean;
|
|
46
|
-
}
|
|
47
|
-
/** Context exposed to render-prop slots */
|
|
48
|
-
export interface WorldMapSlotContext {
|
|
49
|
-
/** Currently hovered tile */
|
|
50
|
-
hoveredTile: {
|
|
51
|
-
x: number;
|
|
52
|
-
y: number;
|
|
53
|
-
} | null;
|
|
54
|
-
/** Hex at the hovered tile */
|
|
55
|
-
hoveredHex: MapHex | null;
|
|
56
|
-
/** Hero at the hovered tile */
|
|
57
|
-
hoveredHero: MapHero | null;
|
|
58
|
-
/** Currently selected hero */
|
|
59
|
-
selectedHero: MapHero | null;
|
|
60
|
-
/** Valid move tiles for selected hero */
|
|
61
|
-
validMoves: Array<{
|
|
62
|
-
x: number;
|
|
63
|
-
y: number;
|
|
64
|
-
}>;
|
|
65
|
-
/** Selects a hero */
|
|
66
|
-
selectHero: (id: string) => void;
|
|
67
|
-
/** Resolve screen position of a tile for overlays */
|
|
68
|
-
tileToScreen: (x: number, y: number) => {
|
|
69
|
-
x: number;
|
|
70
|
-
y: number;
|
|
71
|
-
};
|
|
72
|
-
/** Canvas scale */
|
|
73
|
-
scale: number;
|
|
74
|
-
}
|
|
75
|
-
/** Entity shape for the WorldMapBoard */
|
|
76
|
-
export interface WorldMapEntity {
|
|
77
|
-
id: string;
|
|
78
|
-
hexes: MapHex[];
|
|
79
|
-
heroes: MapHero[];
|
|
80
|
-
features?: IsometricFeature[];
|
|
81
|
-
selectedHeroId?: string | null;
|
|
82
|
-
assetManifest?: {
|
|
83
|
-
baseUrl: string;
|
|
84
|
-
terrains?: Record<string, string>;
|
|
85
|
-
units?: Record<string, string>;
|
|
86
|
-
features?: Record<string, string>;
|
|
87
|
-
};
|
|
88
|
-
backgroundImage?: string;
|
|
89
|
-
}
|
|
90
|
-
export interface WorldMapBoardProps {
|
|
91
|
-
/** World map entity data */
|
|
92
|
-
entity: WorldMapEntity;
|
|
93
|
-
/** Loading state indicator */
|
|
94
|
-
isLoading?: boolean;
|
|
95
|
-
/** Error state */
|
|
96
|
-
error?: Error | null;
|
|
97
|
-
/** Canvas render scale */
|
|
98
|
-
scale?: number;
|
|
99
|
-
/** Unit draw-size multiplier */
|
|
100
|
-
unitScale?: number;
|
|
101
|
-
/** Allow selecting / moving ALL heroes (including enemy). For testing. */
|
|
102
|
-
allowMoveAllHeroes?: boolean;
|
|
103
|
-
/** Custom movement range validator */
|
|
104
|
-
isInRange?: (from: {
|
|
105
|
-
x: number;
|
|
106
|
-
y: number;
|
|
107
|
-
}, to: {
|
|
108
|
-
x: number;
|
|
109
|
-
y: number;
|
|
110
|
-
}, range: number) => boolean;
|
|
111
|
-
/** Emits UI:{heroSelectEvent} with { heroId } */
|
|
112
|
-
heroSelectEvent?: string;
|
|
113
|
-
/** Emits UI:{heroMoveEvent} with { heroId, toX, toY } */
|
|
114
|
-
heroMoveEvent?: string;
|
|
115
|
-
/** Emits UI:{battleEncounterEvent} with { attackerId, defenderId } */
|
|
116
|
-
battleEncounterEvent?: string;
|
|
117
|
-
/** Emits UI:{featureEnterEvent} with { heroId, feature, hex } */
|
|
118
|
-
featureEnterEvent?: string;
|
|
119
|
-
/** Emits UI:{tileClickEvent} with { x, y } */
|
|
120
|
-
tileClickEvent?: string;
|
|
121
|
-
/** Header / top bar */
|
|
122
|
-
header?: (ctx: WorldMapSlotContext) => React.ReactNode;
|
|
123
|
-
/** Side panel (hero detail, hero lists, etc.) */
|
|
124
|
-
sidePanel?: (ctx: WorldMapSlotContext) => React.ReactNode;
|
|
125
|
-
/** Canvas overlay (tooltips, popups) */
|
|
126
|
-
overlay?: (ctx: WorldMapSlotContext) => React.ReactNode;
|
|
127
|
-
/** Footer */
|
|
128
|
-
footer?: (ctx: WorldMapSlotContext) => React.ReactNode;
|
|
129
|
-
onHeroSelect?: (heroId: string) => void;
|
|
130
|
-
onHeroMove?: (heroId: string, toX: number, toY: number) => void;
|
|
131
|
-
/** Called when hero clicks an enemy hero tile */
|
|
132
|
-
onBattleEncounter?: (attackerId: string, defenderId: string) => void;
|
|
133
|
-
/** Called when hero enters a feature hex (castle, resource, etc.) */
|
|
134
|
-
onFeatureEnter?: (heroId: string, hex: MapHex) => void;
|
|
135
|
-
/** Override for the diamond-top Y offset within tile sprites (default: 374). */
|
|
136
|
-
diamondTopY?: number;
|
|
137
|
-
/** Disable pan/zoom camera (default: true). Set false for fixed maps where overlay labels need stable positions. */
|
|
138
|
-
enableCamera?: boolean;
|
|
139
|
-
effectSpriteUrls?: string[];
|
|
140
|
-
resolveUnitFrame?: (unitId: string) => ResolvedFrame | null;
|
|
141
|
-
className?: string;
|
|
142
|
-
}
|
|
143
|
-
export declare function WorldMapBoard({ entity, scale, unitScale, allowMoveAllHeroes, isInRange, heroSelectEvent, heroMoveEvent, battleEncounterEvent, featureEnterEvent, tileClickEvent, header, sidePanel, overlay, footer, onHeroSelect, onHeroMove, onBattleEncounter, onFeatureEnter, diamondTopY, enableCamera, effectSpriteUrls, resolveUnitFrame, className, }: WorldMapBoardProps): React.JSX.Element;
|
|
144
|
-
export declare namespace WorldMapBoard {
|
|
145
|
-
var displayName: string;
|
|
146
|
-
}
|
|
147
|
-
export default WorldMapBoard;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Map Editor Utilities
|
|
3
|
-
*
|
|
4
|
-
* Reusable editor components for Storybook-based map editing.
|
|
5
|
-
* All composed from @almadar/ui atoms (Box, VStack, HStack, Typography, Button, Badge).
|
|
6
|
-
*
|
|
7
|
-
* NOTE: These are Storybook editor controls, NOT Orbital templates.
|
|
8
|
-
* They use native HTML inputs wrapped in Box for lightweight editor UX.
|
|
9
|
-
*/
|
|
10
|
-
import React from 'react';
|
|
11
|
-
export type EditorMode = 'select' | 'paint' | 'unit' | 'feature' | 'erase';
|
|
12
|
-
export declare const TERRAIN_COLORS: Record<string, string>;
|
|
13
|
-
export declare const FEATURE_TYPES: readonly ["goldMine", "resonanceCrystal", "traitCache", "salvageYard", "portal", "battleMarker", "treasure", "castle"];
|
|
14
|
-
export interface CollapsibleSectionProps {
|
|
15
|
-
title: string;
|
|
16
|
-
expanded: boolean;
|
|
17
|
-
onToggle: () => void;
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
className?: string;
|
|
20
|
-
}
|
|
21
|
-
export declare function CollapsibleSection({ title, expanded, onToggle, children, className }: CollapsibleSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare namespace CollapsibleSection {
|
|
23
|
-
var displayName: string;
|
|
24
|
-
}
|
|
25
|
-
export interface EditorSliderProps {
|
|
26
|
-
label: string;
|
|
27
|
-
value: number;
|
|
28
|
-
min: number;
|
|
29
|
-
max: number;
|
|
30
|
-
step?: number;
|
|
31
|
-
onChange: (value: number) => void;
|
|
32
|
-
className?: string;
|
|
33
|
-
}
|
|
34
|
-
export declare function EditorSlider({ label, value, min, max, step, onChange, className }: EditorSliderProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
export declare namespace EditorSlider {
|
|
36
|
-
var displayName: string;
|
|
37
|
-
}
|
|
38
|
-
export interface EditorSelectProps {
|
|
39
|
-
label: string;
|
|
40
|
-
value: string;
|
|
41
|
-
options: Array<{
|
|
42
|
-
value: string;
|
|
43
|
-
label: string;
|
|
44
|
-
}>;
|
|
45
|
-
onChange: (value: string) => void;
|
|
46
|
-
className?: string;
|
|
47
|
-
}
|
|
48
|
-
export declare function EditorSelect({ label, value, options, onChange, className }: EditorSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
-
export declare namespace EditorSelect {
|
|
50
|
-
var displayName: string;
|
|
51
|
-
}
|
|
52
|
-
export interface EditorCheckboxProps {
|
|
53
|
-
label: string;
|
|
54
|
-
checked: boolean;
|
|
55
|
-
onChange: (checked: boolean) => void;
|
|
56
|
-
className?: string;
|
|
57
|
-
}
|
|
58
|
-
export declare function EditorCheckbox({ label, checked, onChange, className }: EditorCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
59
|
-
export declare namespace EditorCheckbox {
|
|
60
|
-
var displayName: string;
|
|
61
|
-
}
|
|
62
|
-
export interface EditorTextInputProps {
|
|
63
|
-
label: string;
|
|
64
|
-
value: string;
|
|
65
|
-
onChange: (value: string) => void;
|
|
66
|
-
placeholder?: string;
|
|
67
|
-
className?: string;
|
|
68
|
-
}
|
|
69
|
-
export declare function EditorTextInput({ label, value, onChange, placeholder, className }: EditorTextInputProps): import("react/jsx-runtime").JSX.Element;
|
|
70
|
-
export declare namespace EditorTextInput {
|
|
71
|
-
var displayName: string;
|
|
72
|
-
}
|
|
73
|
-
export interface StatusBarProps {
|
|
74
|
-
hoveredTile: {
|
|
75
|
-
x: number;
|
|
76
|
-
y: number;
|
|
77
|
-
} | null;
|
|
78
|
-
mode: EditorMode;
|
|
79
|
-
gridSize?: {
|
|
80
|
-
width: number;
|
|
81
|
-
height: number;
|
|
82
|
-
};
|
|
83
|
-
unitCount?: number;
|
|
84
|
-
featureCount?: number;
|
|
85
|
-
className?: string;
|
|
86
|
-
}
|
|
87
|
-
export declare function StatusBar({ hoveredTile, mode, gridSize, unitCount, featureCount, className }: StatusBarProps): import("react/jsx-runtime").JSX.Element;
|
|
88
|
-
export declare namespace StatusBar {
|
|
89
|
-
var displayName: string;
|
|
90
|
-
}
|
|
91
|
-
export interface TerrainPaletteProps {
|
|
92
|
-
terrains: string[];
|
|
93
|
-
selectedTerrain: string;
|
|
94
|
-
onSelect: (terrain: string) => void;
|
|
95
|
-
className?: string;
|
|
96
|
-
}
|
|
97
|
-
export declare function TerrainPalette({ terrains, selectedTerrain, onSelect, className }: TerrainPaletteProps): import("react/jsx-runtime").JSX.Element;
|
|
98
|
-
export declare namespace TerrainPalette {
|
|
99
|
-
var displayName: string;
|
|
100
|
-
}
|
|
101
|
-
export interface EditorToolbarProps {
|
|
102
|
-
mode: EditorMode;
|
|
103
|
-
onModeChange: (mode: EditorMode) => void;
|
|
104
|
-
className?: string;
|
|
105
|
-
}
|
|
106
|
-
export declare function EditorToolbar({ mode, onModeChange, className }: EditorToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
107
|
-
export declare namespace EditorToolbar {
|
|
108
|
-
var displayName: string;
|
|
109
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Map Editor Utilities
|
|
3
|
-
*
|
|
4
|
-
* Reusable editor components for Storybook-based isometric map editing.
|
|
5
|
-
* All composed from @almadar/ui atoms.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
export { CollapsibleSection, EditorSlider, EditorSelect, EditorCheckbox, EditorTextInput, StatusBar, TerrainPalette, EditorToolbar, TERRAIN_COLORS, FEATURE_TYPES, type EditorMode, type CollapsibleSectionProps, type EditorSliderProps, type EditorSelectProps, type EditorCheckboxProps, type EditorTextInputProps, type StatusBarProps, type TerrainPaletteProps, type EditorToolbarProps, } from './editorUtils';
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { BattleUnit, BattlePhase } from '../BattleBoard';
|
|
2
|
-
export interface BattleStateEventConfig {
|
|
3
|
-
tileClickEvent?: string;
|
|
4
|
-
unitClickEvent?: string;
|
|
5
|
-
endTurnEvent?: string;
|
|
6
|
-
cancelEvent?: string;
|
|
7
|
-
gameEndEvent?: string;
|
|
8
|
-
playAgainEvent?: string;
|
|
9
|
-
attackEvent?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface BattleStateCallbacks {
|
|
12
|
-
/** Called when a unit attacks another */
|
|
13
|
-
onAttack?: (attacker: BattleUnit, target: BattleUnit, damage: number) => void;
|
|
14
|
-
/** Called when battle ends */
|
|
15
|
-
onGameEnd?: (result: 'victory' | 'defeat') => void;
|
|
16
|
-
/** Called after a unit moves */
|
|
17
|
-
onUnitMove?: (unit: BattleUnit, to: {
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
|
-
}) => void;
|
|
21
|
-
/** Custom combat damage calculator */
|
|
22
|
-
calculateDamage?: (attacker: BattleUnit, target: BattleUnit) => number;
|
|
23
|
-
}
|
|
24
|
-
export interface BattleStateResult {
|
|
25
|
-
units: BattleUnit[];
|
|
26
|
-
selectedUnitId: string | null;
|
|
27
|
-
phase: BattlePhase;
|
|
28
|
-
turn: number;
|
|
29
|
-
gameResult: 'victory' | 'defeat' | null;
|
|
30
|
-
handleTileClick: (x: number, y: number) => void;
|
|
31
|
-
handleUnitClick: (unitId: string) => void;
|
|
32
|
-
handleEndTurn: () => void;
|
|
33
|
-
handleRestart: () => void;
|
|
34
|
-
}
|
|
35
|
-
export declare function useBattleState(initialUnits: BattleUnit[], eventConfig?: BattleStateEventConfig, callbacks?: BattleStateCallbacks): BattleStateResult;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { CameraState } from '../types/isometric';
|
|
2
|
-
interface CameraResult {
|
|
3
|
-
/** Mutable camera state ref (x, y, zoom) */
|
|
4
|
-
cameraRef: React.MutableRefObject<CameraState>;
|
|
5
|
-
/** Target camera position for smooth lerp centering. Set to null when reached. */
|
|
6
|
-
targetCameraRef: React.MutableRefObject<{
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
} | null>;
|
|
10
|
-
/** Whether the user is currently dragging */
|
|
11
|
-
isDragging: () => boolean;
|
|
12
|
-
/** Total drag distance — used to distinguish click from pan (threshold: 5px) */
|
|
13
|
-
dragDistance: () => number;
|
|
14
|
-
/** Mouse down handler — starts panning */
|
|
15
|
-
handleMouseDown: (e: React.MouseEvent) => void;
|
|
16
|
-
/** Mouse up handler — stops panning */
|
|
17
|
-
handleMouseUp: () => void;
|
|
18
|
-
/** Mouse move handler — pans camera if dragging, returns true if panning */
|
|
19
|
-
handleMouseMove: (e: React.MouseEvent, drawFn?: () => void) => boolean;
|
|
20
|
-
/** Mouse leave handler — cancels drag */
|
|
21
|
-
handleMouseLeave: () => void;
|
|
22
|
-
/** Wheel handler — zoom in/out */
|
|
23
|
-
handleWheel: (e: React.WheelEvent, drawFn?: () => void) => void;
|
|
24
|
-
/** Convert screen coordinates to world coordinates (inverse camera transform) */
|
|
25
|
-
screenToWorld: (clientX: number, clientY: number, canvas: HTMLCanvasElement, viewportSize: {
|
|
26
|
-
width: number;
|
|
27
|
-
height: number;
|
|
28
|
-
}) => {
|
|
29
|
-
x: number;
|
|
30
|
-
y: number;
|
|
31
|
-
};
|
|
32
|
-
/** Lerp camera toward target. Call in animation loop. Returns true if still animating. */
|
|
33
|
-
lerpToTarget: (t?: number) => boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Camera hook for pan/zoom canvas rendering.
|
|
37
|
-
*
|
|
38
|
-
* @returns Camera state, event handlers, and coordinate conversion
|
|
39
|
-
*/
|
|
40
|
-
export declare function useCamera(): CameraResult;
|
|
41
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export interface SoundEntry {
|
|
2
|
-
/** Single path or array of paths — array picks randomly on each play */
|
|
3
|
-
path: string | string[];
|
|
4
|
-
/** Volume 0–1 (multiplied by masterVolume; default 1) */
|
|
5
|
-
volume?: number;
|
|
6
|
-
/** Whether this sound loops (background music) */
|
|
7
|
-
loop?: boolean;
|
|
8
|
-
/** Number of concurrent Audio instances in the pool (default 1) */
|
|
9
|
-
poolSize?: number;
|
|
10
|
-
/** Start automatically on first user interaction */
|
|
11
|
-
autostart?: boolean;
|
|
12
|
-
/** Use crossfade transitions when played via playMusic() */
|
|
13
|
-
crossfade?: boolean;
|
|
14
|
-
/** Crossfade duration in ms (default 1500) */
|
|
15
|
-
crossfadeDurationMs?: number;
|
|
16
|
-
}
|
|
17
|
-
export type AudioManifest = Record<string, SoundEntry>;
|
|
18
|
-
export interface GameAudioControls {
|
|
19
|
-
/** Play a sound effect (instant, pooled) */
|
|
20
|
-
play: (key: string) => void;
|
|
21
|
-
/** Stop all instances of a sound effect */
|
|
22
|
-
stop: (key: string) => void;
|
|
23
|
-
/** Stop all sounds including music */
|
|
24
|
-
stopAll: () => void;
|
|
25
|
-
/** Crossfade to a new music track */
|
|
26
|
-
playMusic: (key: string) => void;
|
|
27
|
-
/** Fade out and stop the current music */
|
|
28
|
-
stopMusic: (fadeDurationMs?: number) => void;
|
|
29
|
-
muted: boolean;
|
|
30
|
-
setMuted: (muted: boolean) => void;
|
|
31
|
-
masterVolume: number;
|
|
32
|
-
setMasterVolume: (volume: number) => void;
|
|
33
|
-
}
|
|
34
|
-
export interface UseGameAudioOptions {
|
|
35
|
-
/** Sound definitions keyed by logical name */
|
|
36
|
-
manifest: AudioManifest;
|
|
37
|
-
/** Prefix prepended to all `path` values (default '') */
|
|
38
|
-
baseUrl?: string;
|
|
39
|
-
/** Start muted (default false) */
|
|
40
|
-
initialMuted?: boolean;
|
|
41
|
-
/** Master volume 0–1 (default 1) */
|
|
42
|
-
initialVolume?: number;
|
|
43
|
-
}
|
|
44
|
-
export declare function useGameAudio({ manifest, baseUrl, initialMuted, initialVolume, }: UseGameAudioOptions): GameAudioControls;
|
|
45
|
-
export declare namespace useGameAudio {
|
|
46
|
-
var displayName: string;
|
|
47
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface ImageCacheResult {
|
|
2
|
-
/** Get a cached image by URL. Returns undefined if not yet loaded. */
|
|
3
|
-
getImage: (url: string) => HTMLImageElement | undefined;
|
|
4
|
-
/** Whether all requested images have loaded */
|
|
5
|
-
isLoaded: boolean;
|
|
6
|
-
/** Number of images currently loading */
|
|
7
|
-
pendingCount: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Preload and cache images for canvas rendering.
|
|
11
|
-
*
|
|
12
|
-
* @param urls - Array of image URLs to preload
|
|
13
|
-
* @returns Cache getter, loading state, and pending count
|
|
14
|
-
*/
|
|
15
|
-
export declare function useImageCache(urls: string[]): ImageCacheResult;
|
|
16
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Physics2DState, PhysicsConfig, PhysicsBounds } from '../managers/PhysicsManager';
|
|
2
|
-
export interface UsePhysics2DOptions extends PhysicsConfig {
|
|
3
|
-
/** Enable physics debug visualization */
|
|
4
|
-
debug?: boolean;
|
|
5
|
-
/** Callback when collision occurs */
|
|
6
|
-
onCollision?: (entityIdA: string, entityIdB: string) => void;
|
|
7
|
-
/** Ground Y position (default: 500) */
|
|
8
|
-
groundY?: number;
|
|
9
|
-
}
|
|
10
|
-
export interface UsePhysics2DReturn {
|
|
11
|
-
/** Register a unit for physics simulation */
|
|
12
|
-
registerUnit: (unitId: string, options?: Partial<Physics2DState>) => void;
|
|
13
|
-
/** Unregister a unit from physics */
|
|
14
|
-
unregisterUnit: (unitId: string) => void;
|
|
15
|
-
/** Get current physics position for a unit */
|
|
16
|
-
getPosition: (unitId: string) => {
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
} | null;
|
|
20
|
-
/** Get full physics state for a unit */
|
|
21
|
-
getState: (unitId: string) => Physics2DState | undefined;
|
|
22
|
-
/** Apply force to a unit */
|
|
23
|
-
applyForce: (unitId: string, fx: number, fy: number) => void;
|
|
24
|
-
/** Set velocity directly */
|
|
25
|
-
setVelocity: (unitId: string, vx: number, vy: number) => void;
|
|
26
|
-
/** Set position directly (teleport) */
|
|
27
|
-
setPosition: (unitId: string, x: number, y: number) => void;
|
|
28
|
-
/** Run physics tick - call this in your RAF loop */
|
|
29
|
-
tick: (deltaTime?: number) => void;
|
|
30
|
-
/** Check collision between two units */
|
|
31
|
-
checkCollision: (unitIdA: string, unitIdB: string, boundsA: PhysicsBounds, boundsB: PhysicsBounds) => boolean;
|
|
32
|
-
/** Resolve collision between two units */
|
|
33
|
-
resolveCollision: (unitIdA: string, unitIdB: string) => void;
|
|
34
|
-
/** Freeze/unfreeze a unit */
|
|
35
|
-
setFrozen: (unitId: string, frozen: boolean) => void;
|
|
36
|
-
/** Get all physics-enabled units */
|
|
37
|
-
getAllUnits: () => Physics2DState[];
|
|
38
|
-
/** Reset all physics */
|
|
39
|
-
reset: () => void;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Hook for managing 2D physics simulation
|
|
43
|
-
*/
|
|
44
|
-
export declare function usePhysics2D(options?: UsePhysics2DOptions): UsePhysics2DReturn;
|
|
45
|
-
export default usePhysics2D;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { IsometricUnit } from '../types/isometric';
|
|
2
|
-
import type { AnimationName, FacingDirection, ResolvedFrame, SpriteFrameDims, SpriteSheetUrls } from '../types/spriteAnimation';
|
|
3
|
-
export interface UseSpriteAnimationsResult {
|
|
4
|
-
/**
|
|
5
|
-
* Sync unit list and advance all animation timers.
|
|
6
|
-
* Call once per animation frame. Auto-detects movement
|
|
7
|
-
* and infers direction from position deltas.
|
|
8
|
-
*/
|
|
9
|
-
syncUnits: (units: IsometricUnit[], deltaMs: number) => void;
|
|
10
|
-
/**
|
|
11
|
-
* Explicitly set a unit's animation (for combat: attack, hit, death).
|
|
12
|
-
* Optionally override direction.
|
|
13
|
-
*/
|
|
14
|
-
setUnitAnimation: (unitId: string, animation: AnimationName, direction?: FacingDirection) => void;
|
|
15
|
-
/**
|
|
16
|
-
* Resolve the current frame for a unit. Returns null if no sprite sheet
|
|
17
|
-
* is available for this unit (falls back to static sprite in canvas).
|
|
18
|
-
* Pass this to IsometricCanvas.resolveUnitFrame.
|
|
19
|
-
*/
|
|
20
|
-
resolveUnitFrame: (unitId: string) => ResolvedFrame | null;
|
|
21
|
-
}
|
|
22
|
-
export interface UseSpriteAnimationsOptions {
|
|
23
|
-
/** Playback speed multiplier. 1.0 = baseline, 2.0 = double speed. Default: 1. */
|
|
24
|
-
speed?: number;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Resolve sprite sheet URLs for a unit. Return null if no sheet available.
|
|
28
|
-
* This is the project-agnostic callback version — projects pass manifest-specific logic.
|
|
29
|
-
*/
|
|
30
|
-
export type SheetUrlResolver = (unit: IsometricUnit) => SpriteSheetUrls | null;
|
|
31
|
-
/**
|
|
32
|
-
* Resolve frame dimensions for a unit's sprite sheet.
|
|
33
|
-
* Projects pass manifest-specific logic.
|
|
34
|
-
*/
|
|
35
|
-
export type FrameDimsResolver = (unit: IsometricUnit) => SpriteFrameDims | null;
|
|
36
|
-
/**
|
|
37
|
-
* Hook for managing per-unit sprite sheet animations.
|
|
38
|
-
*
|
|
39
|
-
* @param getSheetUrls - Callback to resolve sprite sheet URLs for a unit
|
|
40
|
-
* @param getFrameDims - Callback to resolve frame dimensions for a unit
|
|
41
|
-
* @param options - Playback speed options
|
|
42
|
-
*/
|
|
43
|
-
export declare function useSpriteAnimations(getSheetUrls: SheetUrlResolver, getFrameDims: FrameDimsResolver, options?: UseSpriteAnimationsOptions): UseSpriteAnimationsResult;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Game Organism Components
|
|
3
|
-
*
|
|
4
|
-
* Complex UI patterns for game interfaces.
|
|
5
|
-
* Composable isometric canvas system with hooks, utils, and types.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
export { IsometricCanvas, type IsometricCanvasProps } from './IsometricCanvas';
|
|
10
|
-
export { CanvasEffect, type CanvasEffectProps, type CombatActionType } from './CanvasEffect';
|
|
11
|
-
export type { IsometricTile, IsometricUnit, IsometricFeature, CameraState, } from './types/isometric';
|
|
12
|
-
export type { AnimationName, FacingDirection, SpriteDirection, ResolvedFrame, UnitAnimationState, SpriteFrameDims, SpriteSheetUrls, AnimationDef, } from './types/spriteAnimation';
|
|
13
|
-
export { GameAudioProvider, GameAudioContext, useGameAudioContext, type GameAudioProviderProps, type GameAudioContextValue, } from './GameAudioProvider';
|
|
14
|
-
export { GameAudioToggle, type GameAudioToggleProps, } from './GameAudioToggle';
|
|
15
|
-
export { useGameAudio, type AudioManifest, type SoundEntry, type GameAudioControls, type UseGameAudioOptions, } from './hooks/useGameAudio';
|
|
16
|
-
export { useImageCache } from './hooks/useImageCache';
|
|
17
|
-
export { useCamera } from './hooks/useCamera';
|
|
18
|
-
export { useSpriteAnimations, type UseSpriteAnimationsResult, type UseSpriteAnimationsOptions, type SheetUrlResolver, type FrameDimsResolver, } from './hooks/useSpriteAnimations';
|
|
19
|
-
export { usePhysics2D, type UsePhysics2DOptions, type UsePhysics2DReturn, } from './hooks/usePhysics2D';
|
|
20
|
-
export { PhysicsManager, type Physics2DState, type PhysicsBounds, type PhysicsConfig, } from './managers/PhysicsManager';
|
|
21
|
-
export { isoToScreen, screenToIso, TILE_WIDTH, TILE_HEIGHT, FLOOR_HEIGHT, DIAMOND_TOP_Y, FEATURE_COLORS, } from './utils/isometric';
|
|
22
|
-
export { inferDirection, resolveSheetDirection, getCurrentFrame, resolveFrame, createUnitAnimationState, transitionAnimation, tickAnimationState, } from './utils/spriteAnimation';
|
|
23
|
-
export { SPRITE_SHEET_LAYOUT, SHEET_COLUMNS } from './utils/spriteSheetConstants';
|
|
24
|
-
export { GameHud, type GameHudProps, type GameHudStat, type GameHudElement } from './GameHud';
|
|
25
|
-
export { GameMenu, type GameMenuProps, type MenuOption } from './GameMenu';
|
|
26
|
-
export { GameOverScreen, type GameOverScreenProps, type GameOverStat, type GameOverAction } from './GameOverScreen';
|
|
27
|
-
export { InventoryPanel, type InventoryPanelProps, type InventoryItem } from './InventoryPanel';
|
|
28
|
-
export { DialogueBox, type DialogueBoxProps, type DialogueNode, type DialogueChoice } from './DialogueBox';
|
|
29
|
-
export { BattleBoard, type BattleBoardProps, type BattleEntity, type BattlePhase, type BattleUnit, type BattleTile, type BattleSlotContext, } from './BattleBoard';
|
|
30
|
-
export { UncontrolledBattleBoard, type UncontrolledBattleBoardProps, } from './UncontrolledBattleBoard';
|
|
31
|
-
export { useBattleState, type BattleStateEventConfig, type BattleStateCallbacks, type BattleStateResult, } from './hooks/useBattleState';
|
|
32
|
-
export { WorldMapBoard, type WorldMapBoardProps, type WorldMapEntity, type MapHero, type MapHex, type WorldMapSlotContext, } from './WorldMapBoard';
|
|
33
|
-
export { CastleBoard, type CastleBoardProps, type CastleEntity, type CastleSlotContext, } from './CastleBoard';
|
|
34
|
-
export { TraitStateViewer, type TraitStateViewerProps, type TraitStateMachineDefinition, type TraitTransition, } from './TraitStateViewer';
|
|
35
|
-
export { TraitSlot, type TraitSlotProps, type SlotItemData, } from './TraitSlot';
|
|
36
|
-
export { CollapsibleSection, EditorSlider, EditorSelect, EditorCheckbox, EditorTextInput, StatusBar, TerrainPalette, EditorToolbar, TERRAIN_COLORS, FEATURE_TYPES, type EditorMode, type CollapsibleSectionProps, type EditorSliderProps, type EditorSelectProps, type EditorCheckboxProps, type EditorTextInputProps, type StatusBarProps, type TerrainPaletteProps, type EditorToolbarProps, } from './editor';
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PhysicsManager
|
|
3
|
-
*
|
|
4
|
-
* Manages 2D physics simulation for entities with Physics2D state.
|
|
5
|
-
* This implements the tick logic that would normally be compiled from .orb schemas.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
export interface Physics2DState {
|
|
10
|
-
id: string;
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
vx: number;
|
|
14
|
-
vy: number;
|
|
15
|
-
isGrounded: boolean;
|
|
16
|
-
gravity: number;
|
|
17
|
-
friction: number;
|
|
18
|
-
airResistance: number;
|
|
19
|
-
maxVelocityY: number;
|
|
20
|
-
mass?: number;
|
|
21
|
-
restitution?: number;
|
|
22
|
-
state: 'Active' | 'Frozen';
|
|
23
|
-
}
|
|
24
|
-
export interface PhysicsBounds {
|
|
25
|
-
x: number;
|
|
26
|
-
y: number;
|
|
27
|
-
width: number;
|
|
28
|
-
height: number;
|
|
29
|
-
}
|
|
30
|
-
export interface PhysicsConfig {
|
|
31
|
-
gravity?: number;
|
|
32
|
-
friction?: number;
|
|
33
|
-
airResistance?: number;
|
|
34
|
-
maxVelocityY?: number;
|
|
35
|
-
groundY?: number;
|
|
36
|
-
}
|
|
37
|
-
export declare class PhysicsManager {
|
|
38
|
-
private entities;
|
|
39
|
-
private config;
|
|
40
|
-
constructor(config?: PhysicsConfig);
|
|
41
|
-
/**
|
|
42
|
-
* Register an entity for physics simulation
|
|
43
|
-
*/
|
|
44
|
-
registerEntity(entityId: string, initialState?: Partial<Physics2DState>): Physics2DState;
|
|
45
|
-
/**
|
|
46
|
-
* Unregister an entity from physics simulation
|
|
47
|
-
*/
|
|
48
|
-
unregisterEntity(entityId: string): void;
|
|
49
|
-
/**
|
|
50
|
-
* Get physics state for an entity
|
|
51
|
-
*/
|
|
52
|
-
getState(entityId: string): Physics2DState | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Get all registered entities
|
|
55
|
-
*/
|
|
56
|
-
getAllEntities(): Physics2DState[];
|
|
57
|
-
/**
|
|
58
|
-
* Apply a force to an entity (impulse)
|
|
59
|
-
*/
|
|
60
|
-
applyForce(entityId: string, fx: number, fy: number): void;
|
|
61
|
-
/**
|
|
62
|
-
* Set velocity directly
|
|
63
|
-
*/
|
|
64
|
-
setVelocity(entityId: string, vx: number, vy: number): void;
|
|
65
|
-
/**
|
|
66
|
-
* Set position directly
|
|
67
|
-
*/
|
|
68
|
-
setPosition(entityId: string, x: number, y: number): void;
|
|
69
|
-
/**
|
|
70
|
-
* Freeze/unfreeze an entity
|
|
71
|
-
*/
|
|
72
|
-
setFrozen(entityId: string, frozen: boolean): void;
|
|
73
|
-
/**
|
|
74
|
-
* Main tick function - call this every frame
|
|
75
|
-
* Implements the logic from std-physics2d ticks
|
|
76
|
-
*/
|
|
77
|
-
tick(deltaTime?: number): void;
|
|
78
|
-
/**
|
|
79
|
-
* ApplyGravity tick implementation
|
|
80
|
-
*/
|
|
81
|
-
private applyGravity;
|
|
82
|
-
/**
|
|
83
|
-
* ApplyVelocity tick implementation
|
|
84
|
-
*/
|
|
85
|
-
private applyVelocity;
|
|
86
|
-
/**
|
|
87
|
-
* Check and handle ground collision
|
|
88
|
-
*/
|
|
89
|
-
private checkGroundCollision;
|
|
90
|
-
/**
|
|
91
|
-
* Check AABB collision between two entities
|
|
92
|
-
*/
|
|
93
|
-
checkCollision(entityIdA: string, entityIdB: string, boundsA: PhysicsBounds, boundsB: PhysicsBounds): boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Resolve collision with bounce
|
|
96
|
-
*/
|
|
97
|
-
resolveCollision(entityIdA: string, entityIdB: string): void;
|
|
98
|
-
/**
|
|
99
|
-
* Reset all physics state
|
|
100
|
-
*/
|
|
101
|
-
reset(): void;
|
|
102
|
-
}
|
|
103
|
-
export default PhysicsManager;
|