@almadar/ui 5.105.0 → 5.108.0
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/avl/index.cjs +2127 -5818
- package/dist/avl/index.js +1234 -4925
- package/dist/components/{game/2d → core}/atoms/GameIcon.d.ts +1 -1
- package/dist/components/core/atoms/index.d.ts +2 -1
- package/dist/components/core/molecules/index.d.ts +1 -1
- package/dist/components/core/organisms/index.d.ts +1 -1
- package/dist/components/core/templates/index.d.ts +1 -2
- package/dist/components/game/{2d/atoms → atoms}/ChoiceButton.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/ControlButton.d.ts +1 -1
- package/dist/components/game/atoms/DrawShape.d.ts +50 -0
- package/dist/components/game/atoms/DrawSprite.d.ts +47 -0
- package/dist/components/game/atoms/DrawText.d.ts +31 -0
- package/dist/components/game/{2d/atoms → atoms}/GameAudioToggle.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/MiniMap.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/ScoreDisplay.d.ts +1 -1
- package/dist/components/game/{2d/atoms → atoms}/StateIndicator.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/ActionTile.d.ts +1 -1
- package/dist/components/game/molecules/Canvas.d.ts +96 -0
- package/dist/components/game/molecules/Canvas2D.d.ts +120 -0
- package/dist/components/game/{2d/molecules → molecules}/ControlGrid.d.ts +1 -1
- package/dist/components/game/molecules/DrawShapeLayer.d.ts +19 -0
- package/dist/components/game/molecules/DrawSpriteLayer.d.ts +21 -0
- package/dist/components/game/molecules/DrawTextLayer.d.ts +22 -0
- package/dist/components/game/{2d/molecules → molecules}/GameHud.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/StatBadge.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/StateNode.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/TraitSlot.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/TraitStateViewer.d.ts +1 -1
- package/dist/components/game/{2d/molecules → molecules}/TransitionArrow.d.ts +1 -1
- package/dist/components/game/molecules/index.d.ts +39 -0
- package/dist/components/game/patterns.d.ts +20 -0
- package/dist/components/index.cjs +2417 -5988
- package/dist/components/index.js +1520 -5074
- package/dist/{components/game/shared/hooks → hooks}/useCamera.d.ts +1 -1
- package/dist/{components/game/shared/hooks → hooks}/useUnitSpriteAtlas.d.ts +2 -2
- package/dist/lib/drawable/contract.d.ts +68 -0
- package/dist/lib/drawable/hitTest.d.ts +23 -0
- package/dist/lib/drawable/paintDispatch.d.ts +22 -0
- package/dist/lib/drawable/projector.d.ts +14 -0
- package/dist/lib/drawable/projector3d.d.ts +20 -0
- package/dist/lib/drawable/three/Canvas3DHost.d.ts +178 -0
- package/dist/lib/drawable/three/Drawable3D.d.ts +20 -0
- package/dist/lib/drawable/three/GameCamera3D.d.ts +16 -0
- package/dist/lib/drawable/three/game3dTheme.d.ts +14 -0
- package/dist/{components/game/shared → lib/drawable/three}/hooks/useGameCanvas3DEvents.d.ts +4 -3
- package/dist/{components/game/3d → lib/drawable/three}/index.cjs +2223 -4466
- package/dist/{components/game/3d → lib/drawable/three}/index.css +3 -3
- package/dist/lib/drawable/three/index.d.ts +39 -0
- package/dist/{components/game/3d → lib/drawable/three}/index.js +2132 -4375
- package/dist/lib/drawable/three/mesh3d.d.ts +28 -0
- package/dist/{components/game/shared/index.d.ts → lib/gameShared.d.ts} +1 -2
- package/dist/lib/imageCache.d.ts +9 -0
- package/dist/lib/painter2d.d.ts +81 -0
- package/dist/{components/game/shared/lib → lib}/puzzleObject.d.ts +11 -2
- package/dist/lib/webPainter2d.d.ts +7 -0
- package/dist/marketing/index.cjs +10 -0
- package/dist/marketing/index.js +10 -0
- package/dist/{components/game/shared/providers → providers}/GameAudioProvider.d.ts +1 -1
- package/dist/providers/index.cjs +2524 -5889
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +1743 -5112
- package/dist/runtime/index.cjs +1982 -5673
- package/dist/runtime/index.js +1208 -4899
- package/package.json +13 -13
- package/dist/components/game/2d/atoms/ActionButton.d.ts +0 -31
- package/dist/components/game/2d/atoms/ComboCounter.d.ts +0 -20
- package/dist/components/game/2d/atoms/DamageNumber.d.ts +0 -18
- package/dist/components/game/2d/atoms/GameCard.d.ts +0 -34
- package/dist/components/game/2d/atoms/ItemSlot.d.ts +0 -31
- package/dist/components/game/2d/atoms/ResourceCounter.d.ts +0 -26
- package/dist/components/game/2d/atoms/Sprite.d.ts +0 -52
- package/dist/components/game/2d/atoms/StatusEffect.d.ts +0 -25
- package/dist/components/game/2d/atoms/TurnIndicator.d.ts +0 -22
- package/dist/components/game/2d/atoms/WaypointMarker.d.ts +0 -23
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +0 -175
- package/dist/components/game/2d/molecules/EventLog.d.ts +0 -31
- package/dist/components/game/2d/molecules/InventoryGrid.d.ts +0 -35
- package/dist/components/game/2d/molecules/ObjectRulePanel.d.ts +0 -32
- package/dist/components/game/2d/molecules/ResourceBar.d.ts +0 -26
- package/dist/components/game/2d/molecules/RuleEditor.d.ts +0 -39
- package/dist/components/game/2d/molecules/SideCanvas2D.d.ts +0 -36
- package/dist/components/game/2d/molecules/VariablePanel.d.ts +0 -28
- package/dist/components/game/2d/molecules/index.d.ts +0 -66
- package/dist/components/game/2d/organisms/BuilderBoard.d.ts +0 -60
- package/dist/components/game/2d/organisms/ClassifierBoard.d.ts +0 -66
- package/dist/components/game/2d/organisms/DebuggerBoard.d.ts +0 -61
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +0 -42
- package/dist/components/game/2d/organisms/NegotiatorBoard.d.ts +0 -56
- package/dist/components/game/2d/organisms/SequencerBoard.d.ts +0 -69
- package/dist/components/game/2d/organisms/SimulatorBoard.d.ts +0 -58
- package/dist/components/game/2d/organisms/StateArchitectBoard.d.ts +0 -61
- package/dist/components/game/2d/templates/GameTemplate.d.ts +0 -35
- package/dist/components/game/3d/atoms/EventMarker3D.d.ts +0 -17
- package/dist/components/game/3d/atoms/SpriteBillboard3D.d.ts +0 -18
- package/dist/components/game/3d/index.d.ts +0 -13
- package/dist/components/game/3d/molecules/FeatureMesh3D.d.ts +0 -21
- package/dist/components/game/3d/molecules/GameCamera3D.d.ts +0 -35
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +0 -259
- package/dist/components/game/3d/molecules/SideScene3D.d.ts +0 -31
- package/dist/components/game/3d/molecules/TileMesh3D.d.ts +0 -28
- package/dist/components/game/3d/molecules/UnitMesh3D.d.ts +0 -29
- package/dist/components/game/3d/molecules/index.d.ts +0 -35
- package/dist/components/game/3d/organisms/GameBoard3D.d.ts +0 -66
- package/dist/components/game/3d/patterns.d.ts +0 -20
- package/dist/components/game/3d/templates/GameCanvas3DBattleTemplate.d.ts +0 -82
- package/dist/components/game/3d/templates/GameCanvas3DCastleTemplate.d.ts +0 -87
- package/dist/components/game/3d/templates/GameCanvas3DWorldMapTemplate.d.ts +0 -95
- package/dist/components/game/shared/effects.d.ts +0 -253
- package/dist/components/game/shared/game3dTheme.d.ts +0 -55
- package/dist/components/game/shared/lib/game3dAssetManifest.d.ts +0 -48
- /package/dist/components/game/{2d/atoms → atoms}/DialogueBubble.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/HealthBar.d.ts +0 -0
- /package/dist/components/game/{2d/atoms → atoms}/TimerDisplay.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/ActionPalette.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/GameMenu.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/SequenceBar.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/StateGraph.d.ts +0 -0
- /package/dist/components/game/{2d/molecules → molecules}/StateJsonView.d.ts +0 -0
- /package/dist/components/game/{2d/templates → templates}/GameShell.d.ts +0 -0
- /package/dist/{components/game/shared/hooks → hooks}/useGameAudio.d.ts +0 -0
- /package/dist/{components/game/shared → hooks}/useImageCache.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/boardEntity.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Camera3D.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Canvas3DErrorBoundary.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Canvas3DLoadingState.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Lighting3D.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/ModelLoader.d.ts +0 -0
- /package/dist/{components/game/3d/molecules → lib/drawable/three}/Scene3D.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/hooks/useAssetLoader.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/hooks/useRaycaster.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/hooks/useSceneGraph.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/hooks/useThree.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/lib/AssetLoader.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/lib/culling.d.ts +0 -0
- /package/dist/{components/game/shared → lib/drawable/three}/lib/grid3D.d.ts +0 -0
- /package/dist/{components/game/shared/lib → lib}/editorUtils.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/game.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/isometric.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/isometricTypes.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/makeAsset.d.ts +0 -0
- /package/dist/{components/game/shared/lib → lib}/mechanics.d.ts +0 -0
- /package/dist/{components/game/shared/lib → lib}/physicsPresets.d.ts +0 -0
- /package/dist/{components/game/shared/lib → lib}/physicsTypes.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/spriteAnimation.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/spriteAnimationTypes.d.ts +0 -0
- /package/dist/{components/game/shared → lib}/spriteSheetConstants.d.ts +0 -0
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GameTemplate
|
|
3
|
-
*
|
|
4
|
-
* A presentational template for game applications.
|
|
5
|
-
* Includes a main game canvas/area, HUD overlay, and an optional debug sidebar.
|
|
6
|
-
* **Atomic Design**: Composed using Box, Typography, and Layout molecules/atoms.
|
|
7
|
-
*/
|
|
8
|
-
import React from "react";
|
|
9
|
-
import type { Asset } from "@almadar/core";
|
|
10
|
-
import type { TemplateProps } from "../../../core/templates/types";
|
|
11
|
-
export interface GameControls {
|
|
12
|
-
onPlay?: () => void;
|
|
13
|
-
onPause?: () => void;
|
|
14
|
-
onReset?: () => void;
|
|
15
|
-
isPlaying?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export interface GameTemplateProps extends TemplateProps {
|
|
18
|
-
/** Title of the game */
|
|
19
|
-
title?: string;
|
|
20
|
-
/** The main game canvas or content */
|
|
21
|
-
children: React.ReactNode;
|
|
22
|
-
/** HUD overlay content (scores, health, etc.) */
|
|
23
|
-
hud?: React.ReactNode;
|
|
24
|
-
/** Debug panel content */
|
|
25
|
-
debugPanel?: React.ReactNode;
|
|
26
|
-
/** Whether the debug panel is visible */
|
|
27
|
-
showDebugPanel?: boolean;
|
|
28
|
-
/** Game controls */
|
|
29
|
-
controls?: GameControls;
|
|
30
|
-
/** Additional class name */
|
|
31
|
-
className?: string;
|
|
32
|
-
/** Background image for the canvas area. Falls back to bg-muted flat color. */
|
|
33
|
-
backgroundAsset?: Asset;
|
|
34
|
-
}
|
|
35
|
-
export declare const GameTemplate: React.FC<GameTemplateProps>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EventMarker3D
|
|
3
|
-
*
|
|
4
|
-
* Floating combat/feedback marker for one `GameEvent` — billboarded text above
|
|
5
|
-
* the cell. Lifetime is LOLO-owned: boards append events on actions and expire
|
|
6
|
-
* them in their tick (same contract as the 2D effects array).
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import type { GameEvent } from '../molecules/GameCanvas3D';
|
|
12
|
-
export interface EventMarker3DProps {
|
|
13
|
-
event: GameEvent;
|
|
14
|
-
position: [number, number, number];
|
|
15
|
-
}
|
|
16
|
-
export declare function EventMarker3D({ event, position }: EventMarker3DProps): React.JSX.Element;
|
|
17
|
-
export default EventMarker3D;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SpriteBillboard3D
|
|
3
|
-
*
|
|
4
|
-
* Billboarded sprite-sheet plane for a unit. Loads the atlas's PNG sheet as a
|
|
5
|
-
* texture and crops a SINGLE frame via UV `repeat`/`offset`, advancing per
|
|
6
|
-
* animation state. Mirrors the 2D canvas: one frame, never the whole sheet.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import type { ResolvedFrame } from '../../shared/spriteAnimationTypes';
|
|
12
|
-
export interface SpriteBillboard3DProps {
|
|
13
|
-
sheetUrl: string;
|
|
14
|
-
resolveFrame: () => ResolvedFrame | null;
|
|
15
|
-
height?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare function SpriteBillboard3D({ sheetUrl, resolveFrame, height, }: SpriteBillboard3DProps): React.JSX.Element | null;
|
|
18
|
-
export default SpriteBillboard3D;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Game 3D (three.js) — public code-split barrel.
|
|
3
|
-
*
|
|
4
|
-
* Published behind the `@almadar/ui/components/{molecules,organisms}/game/three`
|
|
5
|
-
* subpath only, NEVER from the main `components/index.ts` barrel — re-exporting
|
|
6
|
-
* it there would statically pull @react-three/fiber into every app's bundle.
|
|
7
|
-
* The component registry lazy-imports this barrel so the 3D family stays a
|
|
8
|
-
* dynamic, code-split chunk.
|
|
9
|
-
*
|
|
10
|
-
* @packageDocumentation
|
|
11
|
-
*/
|
|
12
|
-
export * from './molecules';
|
|
13
|
-
export { GameBoard3D, type GameBoard3DProps } from './organisms/GameBoard3D';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* FeatureMesh3D
|
|
3
|
-
*
|
|
4
|
-
* Default feature renderer for GameCanvas3D. GLB model when resolved (tinted
|
|
5
|
-
* via `feature.color`); otherwise a procedural tree or rock primitive using
|
|
6
|
-
* the `game3dTheme` default palette.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import type { Asset } from '@almadar/core';
|
|
12
|
-
import type { IsometricFeature } from '../../shared/isometricTypes';
|
|
13
|
-
import type { MinimalMouseEvent } from '../../shared/hooks/useGameCanvas3DEvents';
|
|
14
|
-
export interface FeatureMesh3DProps {
|
|
15
|
-
feature: IsometricFeature;
|
|
16
|
-
position: [number, number, number];
|
|
17
|
-
model?: Asset;
|
|
18
|
-
onFeatureClick: (feature: IsometricFeature, event: MinimalMouseEvent | null) => void;
|
|
19
|
-
}
|
|
20
|
-
export declare function FeatureMesh3D({ feature, position, model, onFeatureClick, }: FeatureMesh3DProps): React.JSX.Element | null;
|
|
21
|
-
export default FeatureMesh3D;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GameCamera3D
|
|
3
|
-
*
|
|
4
|
-
* Camera-tracking helpers extracted from GameCanvas3D: an imperative-handle
|
|
5
|
-
* position reporter, a smooth-follow camera for `follow`/`chase` modes, and a
|
|
6
|
-
* lerped group wrapper for interpolated positions between LOLO tick snapshots.
|
|
7
|
-
*
|
|
8
|
-
* @packageDocumentation
|
|
9
|
-
*/
|
|
10
|
-
import React from 'react';
|
|
11
|
-
/** Reports the live camera position on every change (imperative handle integration). */
|
|
12
|
-
export declare function CameraController3D({ onCameraChange, }: {
|
|
13
|
-
onCameraChange?: (pos: {
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
|
-
z: number;
|
|
17
|
-
}) => void;
|
|
18
|
-
}): null;
|
|
19
|
-
/**
|
|
20
|
-
* Camera that smooth-tracks a world-space target (side-view player or selected unit).
|
|
21
|
-
* OrbitControls is disabled while following — the camera is authoritative.
|
|
22
|
-
*/
|
|
23
|
-
export declare function FollowCamera3D({ target, offset, }: {
|
|
24
|
-
target: [number, number, number];
|
|
25
|
-
offset: [number, number, number];
|
|
26
|
-
}): null;
|
|
27
|
-
/**
|
|
28
|
-
* Group that smooth-lerps toward its target position between LOLO tick snapshots
|
|
29
|
-
* (the 3D analogue of Canvas2D's `interpolateUnits`). Disabled → snaps.
|
|
30
|
-
*/
|
|
31
|
-
export declare function LerpedGroup3D({ target, enabled, children, }: {
|
|
32
|
-
target: [number, number, number];
|
|
33
|
-
enabled: boolean;
|
|
34
|
-
children: React.ReactNode;
|
|
35
|
-
}): React.JSX.Element;
|
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GameCanvas3D
|
|
3
|
-
*
|
|
4
|
-
* 3D game canvas component using Three.js.
|
|
5
|
-
* Mirrors the IsometricCanvas API for easy migration.
|
|
6
|
-
*
|
|
7
|
-
* **State categories (closed-circuit compliant):**
|
|
8
|
-
* - All game data (tiles, units, features, selection, validMoves) → received via props
|
|
9
|
-
* - Rendering state (hoveredTile, internalError, asset loading, camera) → local only
|
|
10
|
-
* - Events → emitted via `useGameCanvas3DEvents()` hook for trait integration
|
|
11
|
-
*
|
|
12
|
-
* This component is a **pure 3D renderer** — it holds no game logic state.
|
|
13
|
-
*
|
|
14
|
-
* @packageDocumentation
|
|
15
|
-
*/
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import type { EventEmit, Asset } from '@almadar/core';
|
|
18
|
-
import type { Platform, SidePlayer } from '../../2d/molecules/Canvas2D';
|
|
19
|
-
import * as THREE from 'three';
|
|
20
|
-
import { AssetLoader } from '../../shared/lib/AssetLoader';
|
|
21
|
-
import { type MinimalMouseEvent } from '../../shared/hooks/useGameCanvas3DEvents';
|
|
22
|
-
import type { IsometricTile, IsometricUnit, IsometricFeature } from '../../shared/isometricTypes';
|
|
23
|
-
import './GameCanvas3D.css';
|
|
24
|
-
export type { IsometricTile, IsometricUnit, IsometricFeature };
|
|
25
|
-
/** Game event for canvas display */
|
|
26
|
-
export interface GameEvent {
|
|
27
|
-
id: string;
|
|
28
|
-
type: string;
|
|
29
|
-
x: number;
|
|
30
|
-
z?: number;
|
|
31
|
-
y?: number;
|
|
32
|
-
message?: string;
|
|
33
|
-
}
|
|
34
|
-
/** Camera mode for 3D view.
|
|
35
|
-
* - `follow` tracks the side-view player (or the selected unit) from a fixed offset.
|
|
36
|
-
* - `chase` sits behind + above the followed unit relative to its `heading` (driving). */
|
|
37
|
-
export type CameraMode = 'isometric' | 'perspective' | 'top-down' | 'follow' | 'chase';
|
|
38
|
-
/** Per-role model manifest — the 3D analogue of Canvas2D's assetManifest (values are GLB Assets). */
|
|
39
|
-
export interface GameCanvas3DAssetManifest {
|
|
40
|
-
terrains?: Record<string, Asset>;
|
|
41
|
-
units?: Record<string, Asset>;
|
|
42
|
-
features?: Record<string, Asset>;
|
|
43
|
-
effects?: Record<string, Asset>;
|
|
44
|
-
}
|
|
45
|
-
/** Map orientation */
|
|
46
|
-
export type MapOrientation = 'standard' | 'rotated';
|
|
47
|
-
/** Overlay control */
|
|
48
|
-
export type OverlayControl = 'default' | 'hidden' | 'minimap';
|
|
49
|
-
/** Props for GameCanvas3D component */
|
|
50
|
-
export interface GameCanvas3DProps {
|
|
51
|
-
/** Additional CSS classes */
|
|
52
|
-
className?: string;
|
|
53
|
-
/** Children to render inside the 3D canvas (e.g., physics objects, custom meshes) */
|
|
54
|
-
children?: React.ReactNode;
|
|
55
|
-
/** Loading state indicator */
|
|
56
|
-
isLoading?: boolean;
|
|
57
|
-
/** Error state */
|
|
58
|
-
error?: string | null;
|
|
59
|
-
/** Array of tiles to render */
|
|
60
|
-
tiles?: IsometricTile[];
|
|
61
|
-
/** Array of units to render */
|
|
62
|
-
units?: IsometricUnit[];
|
|
63
|
-
/** Array of features to render */
|
|
64
|
-
features?: IsometricFeature[];
|
|
65
|
-
/** Array of events to display */
|
|
66
|
-
events?: Array<GameEvent>;
|
|
67
|
-
/** Fog of war data */
|
|
68
|
-
fogOfWar?: boolean[][];
|
|
69
|
-
/** Map orientation */
|
|
70
|
-
orientation?: MapOrientation;
|
|
71
|
-
/** Camera mode */
|
|
72
|
-
cameraMode?: CameraMode;
|
|
73
|
-
/** Show grid */
|
|
74
|
-
showGrid?: boolean;
|
|
75
|
-
/** Show coordinates overlay */
|
|
76
|
-
showCoordinates?: boolean;
|
|
77
|
-
/** Show tile information */
|
|
78
|
-
showTileInfo?: boolean;
|
|
79
|
-
/** Overlay control mode */
|
|
80
|
-
overlay?: OverlayControl;
|
|
81
|
-
/** Enable shadows */
|
|
82
|
-
shadows?: boolean;
|
|
83
|
-
/** Background color */
|
|
84
|
-
backgroundColor?: string;
|
|
85
|
-
/** Callback when a tile is clicked */
|
|
86
|
-
onTileClick?: (tile: IsometricTile, event: MinimalMouseEvent) => void;
|
|
87
|
-
/** Callback when a unit is clicked */
|
|
88
|
-
onUnitClick?: (unit: IsometricUnit, event: MinimalMouseEvent) => void;
|
|
89
|
-
/** Callback when a feature is clicked */
|
|
90
|
-
onFeatureClick?: (feature: IsometricFeature, event: MinimalMouseEvent) => void;
|
|
91
|
-
/** Callback when canvas is clicked (background) */
|
|
92
|
-
onCanvasClick?: (event: MinimalMouseEvent) => void;
|
|
93
|
-
/** Callback when mouse moves over a tile */
|
|
94
|
-
onTileHover?: (tile: IsometricTile | null, event: MinimalMouseEvent) => void;
|
|
95
|
-
/** Callback for unit animation state change */
|
|
96
|
-
onUnitAnimation?: (unitId: string, state: string) => void;
|
|
97
|
-
/** Asset loader instance (uses global singleton if not provided) */
|
|
98
|
-
assetLoader?: AssetLoader;
|
|
99
|
-
/** Custom tile renderer component */
|
|
100
|
-
tileRenderer?: React.FC<{
|
|
101
|
-
tile: IsometricTile;
|
|
102
|
-
position: [number, number, number];
|
|
103
|
-
}>;
|
|
104
|
-
/** Custom unit renderer component */
|
|
105
|
-
unitRenderer?: React.FC<{
|
|
106
|
-
unit: IsometricUnit;
|
|
107
|
-
position: [number, number, number];
|
|
108
|
-
}>;
|
|
109
|
-
/** Custom feature renderer component */
|
|
110
|
-
featureRenderer?: React.FC<{
|
|
111
|
-
feature: IsometricFeature;
|
|
112
|
-
position: [number, number, number];
|
|
113
|
-
}>;
|
|
114
|
-
/** URLs to preload */
|
|
115
|
-
preloadAssets?: string[];
|
|
116
|
-
/** Declarative event: tile click */
|
|
117
|
-
tileClickEvent?: EventEmit<{
|
|
118
|
-
tileId: string;
|
|
119
|
-
x: number;
|
|
120
|
-
z: number;
|
|
121
|
-
type?: string;
|
|
122
|
-
terrain?: string;
|
|
123
|
-
elevation?: number;
|
|
124
|
-
}>;
|
|
125
|
-
/** Declarative event: unit click */
|
|
126
|
-
unitClickEvent?: EventEmit<{
|
|
127
|
-
unitId: string;
|
|
128
|
-
x: number;
|
|
129
|
-
z: number;
|
|
130
|
-
unitType?: string;
|
|
131
|
-
name?: string;
|
|
132
|
-
team?: string;
|
|
133
|
-
faction?: string;
|
|
134
|
-
health?: number;
|
|
135
|
-
maxHealth?: number;
|
|
136
|
-
}>;
|
|
137
|
-
/** Declarative event: feature click */
|
|
138
|
-
featureClickEvent?: EventEmit<{
|
|
139
|
-
featureId: string;
|
|
140
|
-
x: number;
|
|
141
|
-
z: number;
|
|
142
|
-
type?: string;
|
|
143
|
-
elevation?: number;
|
|
144
|
-
}>;
|
|
145
|
-
/** Declarative event: canvas click */
|
|
146
|
-
canvasClickEvent?: EventEmit<{
|
|
147
|
-
clientX: number;
|
|
148
|
-
clientY: number;
|
|
149
|
-
button: number;
|
|
150
|
-
}>;
|
|
151
|
-
/** Declarative event: tile hover */
|
|
152
|
-
tileHoverEvent?: EventEmit<{
|
|
153
|
-
tileId: string;
|
|
154
|
-
x: number;
|
|
155
|
-
z: number;
|
|
156
|
-
type?: string;
|
|
157
|
-
}>;
|
|
158
|
-
/** Declarative event: tile leave */
|
|
159
|
-
tileLeaveEvent?: EventEmit<Record<string, never>>;
|
|
160
|
-
/** Declarative event: unit animation */
|
|
161
|
-
unitAnimationEvent?: EventEmit<{
|
|
162
|
-
unitId: string;
|
|
163
|
-
state: string;
|
|
164
|
-
timestamp: number;
|
|
165
|
-
}>;
|
|
166
|
-
/** Declarative event: camera change */
|
|
167
|
-
cameraChangeEvent?: EventEmit<{
|
|
168
|
-
position: {
|
|
169
|
-
x: number;
|
|
170
|
-
y: number;
|
|
171
|
-
z: number;
|
|
172
|
-
};
|
|
173
|
-
timestamp: number;
|
|
174
|
-
}>;
|
|
175
|
-
/** Loading message */
|
|
176
|
-
loadingMessage?: string;
|
|
177
|
-
/** Whether to use instancing for tiles */
|
|
178
|
-
useInstancing?: boolean;
|
|
179
|
-
/** Valid move positions */
|
|
180
|
-
validMoves?: Array<{
|
|
181
|
-
x: number;
|
|
182
|
-
z: number;
|
|
183
|
-
}>;
|
|
184
|
-
/** Attack target positions */
|
|
185
|
-
attackTargets?: Array<{
|
|
186
|
-
x: number;
|
|
187
|
-
z: number;
|
|
188
|
-
}>;
|
|
189
|
-
/** Selected tile IDs */
|
|
190
|
-
selectedTileIds?: string[];
|
|
191
|
-
/** Selected unit ID */
|
|
192
|
-
selectedUnitId?: string | null;
|
|
193
|
-
/** Unit draw-size multiplier. 1 = default tile-proportional size. */
|
|
194
|
-
unitScale?: number;
|
|
195
|
-
/** Board zoom/group scale. Applied to the scene group. Default 0.45. */
|
|
196
|
-
scale?: number;
|
|
197
|
-
/** Maps a keydown `e.code` → the board's SEMANTIC event, e.g. `{ ArrowLeft: "LEFT", Space: "JUMP" }`.
|
|
198
|
-
* The input layer emits `UI:<event>` so the FSM stays device-agnostic — keyboard and d-pad converge. */
|
|
199
|
-
keyMap?: Record<string, string>;
|
|
200
|
-
/** Maps a keyup `e.code` → the board's SEMANTIC event, e.g. `{ ArrowLeft: "STOP" }`. */
|
|
201
|
-
keyUpMap?: Record<string, string>;
|
|
202
|
-
/** Side-view player (pixel coords, LOLO-owned physics) — presence switches to side-scroller rendering. */
|
|
203
|
-
player?: SidePlayer;
|
|
204
|
-
/** Side-view level geometry (pixel AABBs, same contract as Canvas2D). */
|
|
205
|
-
platforms?: Platform[];
|
|
206
|
-
/** Side-view world size in pixels. */
|
|
207
|
-
worldWidth?: number;
|
|
208
|
-
/** Side-view world size in pixels. */
|
|
209
|
-
worldHeight?: number;
|
|
210
|
-
/** Pixel→world-unit divisor for side view (default 32 = one 2D tile per 3D cell). */
|
|
211
|
-
pixelsPerUnit?: number;
|
|
212
|
-
/** Player model — named for 2D parity; in 3D the Asset's url is a GLB. */
|
|
213
|
-
playerSprite?: Asset;
|
|
214
|
-
/** Platform-type → model map — named for 2D parity; values are GLB Assets. */
|
|
215
|
-
tileSprites?: Record<string, Asset>;
|
|
216
|
-
/** Per-role model manifest; resolves tiles/units/features without explicit modelUrl/assetUrl. */
|
|
217
|
-
assetManifest?: GameCanvas3DAssetManifest;
|
|
218
|
-
/** Opt-in: smooth-lerp unit positions between LOLO tick snapshots. DEFAULT OFF. */
|
|
219
|
-
interpolateUnits?: boolean;
|
|
220
|
-
}
|
|
221
|
-
/** Imperative handle for GameCanvas3D */
|
|
222
|
-
export interface GameCanvas3DHandle {
|
|
223
|
-
/** Get current camera position */
|
|
224
|
-
getCameraPosition: () => THREE.Vector3 | null;
|
|
225
|
-
/** Set camera position */
|
|
226
|
-
setCameraPosition: (x: number, y: number, z: number) => void;
|
|
227
|
-
/** Look at a specific point */
|
|
228
|
-
lookAt: (x: number, y: number, z: number) => void;
|
|
229
|
-
/** Reset camera to default position */
|
|
230
|
-
resetCamera: () => void;
|
|
231
|
-
/** Take a screenshot */
|
|
232
|
-
screenshot: () => string | null;
|
|
233
|
-
/** Export current view as data */
|
|
234
|
-
export: () => {
|
|
235
|
-
tiles: IsometricTile[];
|
|
236
|
-
units: IsometricUnit[];
|
|
237
|
-
features: IsometricFeature[];
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* GameCanvas3D Component
|
|
242
|
-
*
|
|
243
|
-
* 3D game canvas that mirrors the IsometricCanvas API.
|
|
244
|
-
* Uses Three.js and React Three Fiber for rendering.
|
|
245
|
-
*
|
|
246
|
-
* @example
|
|
247
|
-
* ```tsx
|
|
248
|
-
* <GameCanvas3D
|
|
249
|
-
* tiles={tiles}
|
|
250
|
-
* units={units}
|
|
251
|
-
* features={features}
|
|
252
|
-
* cameraMode="isometric"
|
|
253
|
-
* tileClickEvent="TILE_SELECTED"
|
|
254
|
-
* onTileClick={(tile) => console.log('Clicked:', tile)}
|
|
255
|
-
* />
|
|
256
|
-
* ```
|
|
257
|
-
*/
|
|
258
|
-
export declare const GameCanvas3D: React.ForwardRefExoticComponent<GameCanvas3DProps & React.RefAttributes<GameCanvas3DHandle>>;
|
|
259
|
-
export default GameCanvas3D;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SideScene3D
|
|
3
|
-
*
|
|
4
|
-
* Side-scroller scene: renders the LOLO-owned pixel-space `player`/`platforms`
|
|
5
|
-
* as 3D geometry. Physics stays in the board's tick (same contract as Canvas2D's
|
|
6
|
-
* SideView) — this only maps px → world units and draws. Platform and player
|
|
7
|
-
* fallback colors come from `game3dTheme` defaults.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import type { Asset } from '@almadar/core';
|
|
13
|
-
import type { Platform, SidePlayer } from '../../2d/molecules/Canvas2D';
|
|
14
|
-
import type { IsometricFeature } from '../../shared/isometricTypes';
|
|
15
|
-
import type { GameEvent, GameCanvas3DAssetManifest } from './GameCanvas3D';
|
|
16
|
-
export interface SideScene3DProps {
|
|
17
|
-
player: SidePlayer;
|
|
18
|
-
platforms: Platform[];
|
|
19
|
-
worldHeight: number;
|
|
20
|
-
ppu: number;
|
|
21
|
-
playerSprite?: Asset;
|
|
22
|
-
tileSprites?: Record<string, Asset>;
|
|
23
|
-
interpolate: boolean;
|
|
24
|
-
/** Side-view features (collectibles/props) — x/y are PIXELS like platforms. */
|
|
25
|
-
features?: IsometricFeature[];
|
|
26
|
-
/** Feedback markers — x/y are PIXELS in side view. */
|
|
27
|
-
events?: GameEvent[];
|
|
28
|
-
assetManifest?: GameCanvas3DAssetManifest;
|
|
29
|
-
}
|
|
30
|
-
export declare function SideScene3D({ player, platforms, worldHeight, ppu, playerSprite, tileSprites, interpolate, features, events, assetManifest, }: SideScene3DProps): React.JSX.Element;
|
|
31
|
-
export default SideScene3D;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TileMesh3D
|
|
3
|
-
*
|
|
4
|
-
* Default tile renderer for GameCanvas3D. GLB tile when a model is resolved
|
|
5
|
-
* (with a box fallback while loading/on error); otherwise a colored plate
|
|
6
|
-
* whose terrain color and highlight emissive come from `game3dTheme` defaults,
|
|
7
|
-
* overridable per-tile via `tile.color`.
|
|
8
|
-
*
|
|
9
|
-
* @packageDocumentation
|
|
10
|
-
*/
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import type { Asset } from '@almadar/core';
|
|
13
|
-
import type { IsometricTile } from '../../shared/isometricTypes';
|
|
14
|
-
import type { MinimalMouseEvent } from '../../shared/hooks/useGameCanvas3DEvents';
|
|
15
|
-
export interface TileMesh3DProps {
|
|
16
|
-
/** `color` is an optional per-tile override of the terrain default. */
|
|
17
|
-
tile: IsometricTile;
|
|
18
|
-
position: [number, number, number];
|
|
19
|
-
model?: Asset;
|
|
20
|
-
isSelected: boolean;
|
|
21
|
-
isHovered: boolean;
|
|
22
|
-
isValidMove: boolean;
|
|
23
|
-
isAttackTarget: boolean;
|
|
24
|
-
onTileClick: (tile: IsometricTile, event: MinimalMouseEvent) => void;
|
|
25
|
-
onTileHover: (tile: IsometricTile | null, event: MinimalMouseEvent) => void;
|
|
26
|
-
}
|
|
27
|
-
export declare function TileMesh3D({ tile, position, model, isSelected, isHovered, isValidMove, isAttackTarget, onTileClick, onTileHover, }: TileMesh3DProps): React.JSX.Element;
|
|
28
|
-
export default TileMesh3D;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UnitMesh3D
|
|
3
|
-
*
|
|
4
|
-
* Default unit renderer for GameCanvas3D. Renders (in priority order) an
|
|
5
|
-
* animated sprite-sheet billboard, a GLB model, or a procedural
|
|
6
|
-
* base/body/head primitive stack — plus a selection ring and health bar.
|
|
7
|
-
* Faction color, selection ring, and health-bar palette come from
|
|
8
|
-
* `game3dTheme` defaults, overridable per-unit via `unit.tint`.
|
|
9
|
-
*
|
|
10
|
-
* @packageDocumentation
|
|
11
|
-
*/
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import type { Asset } from '@almadar/core';
|
|
14
|
-
import type { IsometricUnit } from '../../shared/isometricTypes';
|
|
15
|
-
import type { ResolvedFrame } from '../../shared/spriteAnimationTypes';
|
|
16
|
-
import type { MinimalMouseEvent } from '../../shared/hooks/useGameCanvas3DEvents';
|
|
17
|
-
export interface UnitMesh3DProps {
|
|
18
|
-
/** `tint` is an optional per-unit override of the faction default. */
|
|
19
|
-
unit: IsometricUnit;
|
|
20
|
-
position: [number, number, number];
|
|
21
|
-
model?: Asset;
|
|
22
|
-
isSelected: boolean;
|
|
23
|
-
unitScale: number;
|
|
24
|
-
cellSize: number;
|
|
25
|
-
resolveUnitFrame: (unitId: string) => ResolvedFrame | null;
|
|
26
|
-
onUnitClick: (unit: IsometricUnit, event: MinimalMouseEvent) => void;
|
|
27
|
-
}
|
|
28
|
-
export declare function UnitMesh3D({ unit, position, model, isSelected, unitScale, cellSize, resolveUnitFrame, onUnitClick, }: UnitMesh3DProps): React.JSX.Element;
|
|
29
|
-
export default UnitMesh3D;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Game 3D (three.js)
|
|
3
|
-
*
|
|
4
|
-
* Three.js components, hooks, loaders, renderers, and the GameCanvas3D family.
|
|
5
|
-
* Code-split behind the `@almadar/ui/components/molecules/game/three` subpath.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
export { Scene3D, type Scene3DProps } from './Scene3D';
|
|
10
|
-
export { Camera3D, type Camera3DProps, type Camera3DHandle, type CameraMode } from './Camera3D';
|
|
11
|
-
export { Lighting3D, type Lighting3DProps } from './Lighting3D';
|
|
12
|
-
export { Canvas3DLoadingState, type Canvas3DLoadingStateProps, } from './Canvas3DLoadingState';
|
|
13
|
-
export { Canvas3DErrorBoundary, type Canvas3DErrorBoundaryProps, type Canvas3DErrorBoundaryState, } from './Canvas3DErrorBoundary';
|
|
14
|
-
export { ModelLoader, type ModelLoaderProps, } from './ModelLoader';
|
|
15
|
-
export { useThree, type UseThreeOptions, type UseThreeReturn, } from '../../shared/hooks/useThree';
|
|
16
|
-
export { useAssetLoader, type UseAssetLoaderOptions, type UseAssetLoaderReturn, type AssetLoadingState, } from '../../shared/hooks/useAssetLoader';
|
|
17
|
-
export { useSceneGraph, type UseSceneGraphReturn, type SceneGraphNode, type NodeType, } from '../../shared/hooks/useSceneGraph';
|
|
18
|
-
export { useRaycaster, type UseRaycasterOptions, type UseRaycasterReturn, type RaycastHit, type GridHit, } from '../../shared/hooks/useRaycaster';
|
|
19
|
-
export { useGameCanvas3DEvents, type UseGameCanvas3DEventsOptions, type UseGameCanvas3DEventsReturn, type GameCanvas3DEventConfig, } from '../../shared/hooks/useGameCanvas3DEvents';
|
|
20
|
-
export { AssetLoader, assetLoader, type LoadedModel, } from '../../shared/lib/AssetLoader';
|
|
21
|
-
export type { UnitAnimationState } from '../../shared/spriteAnimationTypes';
|
|
22
|
-
export { GameCanvas3D, type GameCanvas3DProps } from './GameCanvas3D';
|
|
23
|
-
export { GameCanvas3DBattleTemplate, type GameCanvas3DBattleTemplateProps } from '../templates/GameCanvas3DBattleTemplate';
|
|
24
|
-
export { GameCanvas3DCastleTemplate, type GameCanvas3DCastleTemplateProps } from '../templates/GameCanvas3DCastleTemplate';
|
|
25
|
-
export { GameCanvas3DWorldMapTemplate, type GameCanvas3DWorldMapTemplateProps } from '../templates/GameCanvas3DWorldMapTemplate';
|
|
26
|
-
export { gridToWorld, worldToGrid, raycastToPlane, raycastToObjects, gridDistance, gridManhattanDistance, getNeighbors, isInBounds, getCellsInRadius, createGridHighlight, normalizeMouseCoordinates, type Grid3DConfig, type GridCoordinate, } from '../../shared/lib/grid3D';
|
|
27
|
-
export { Avl3DViewer, type Avl3DViewerProps } from '../../../avl/organisms/Avl3DViewer';
|
|
28
|
-
export { Avl3DApplicationScene, type Avl3DApplicationSceneProps } from '../../../avl/organisms/Avl3DApplicationScene';
|
|
29
|
-
export { Avl3DOrbitalScene, type Avl3DOrbitalSceneProps } from '../../../avl/organisms/Avl3DOrbitalScene';
|
|
30
|
-
export { Avl3DTraitScene, type Avl3DTraitSceneProps } from '../../../avl/organisms/Avl3DTraitScene';
|
|
31
|
-
export { Avl3DTransitionScene, type Avl3DTransitionSceneProps } from '../../../avl/organisms/Avl3DTransitionScene';
|
|
32
|
-
export { Avl3DEffects, type Avl3DEffectsProps } from '../../../avl/organisms/Avl3DEffects';
|
|
33
|
-
export { Avl3DContext, useAvl3DConfig, type Avl3DModelOverrides, type Avl3DConfig } from '../../../avl/providers/avl-3d-context';
|
|
34
|
-
export { AVL_3D_COLORS, CAMERA_POSITIONS, goldenSpiralPositions, fibonacciSpherePositions, orbitRingPositions, arcCurve3D, selfLoopCurve3D, treeLayout3D, type Position3D, } from '../../../avl/lib/avl-3d-layout';
|
|
35
|
-
export { isInFrustum, filterByFrustum, getVisibleIndices, calculateLODLevel, updateInstanceLOD, cullInstancedMesh, SpatialHashGrid, type CullingOptions, type LODLevel, type LODConfig, } from '../../shared/lib/culling';
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GameBoard3D
|
|
3
|
-
*
|
|
4
|
-
* Controlled 3D tactics board organism. Reads all gameplay state
|
|
5
|
-
* (selectedUnitId, validMoves, attackTargets, phase, result) from the entity
|
|
6
|
-
* prop and renders <GameCanvas3D> with those controlled values.
|
|
7
|
-
* Emits user interactions via event bus so the parent Orbital trait drives
|
|
8
|
-
* all state transitions.
|
|
9
|
-
*
|
|
10
|
-
* @packageDocumentation
|
|
11
|
-
*/
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import type { EventEmit, EntityRow } from '@almadar/core';
|
|
14
|
-
import type { CameraMode } from '../molecules/GameCanvas3D';
|
|
15
|
-
import type { IsometricTile, IsometricFeature } from '../../shared/isometricTypes';
|
|
16
|
-
export interface GameBoard3DProps {
|
|
17
|
-
/** Entity row carrying all gameplay state (controlled). */
|
|
18
|
-
entity?: EntityRow | readonly EntityRow[];
|
|
19
|
-
/** Static tile data (config default). */
|
|
20
|
-
tiles?: IsometricTile[];
|
|
21
|
-
/** Static feature data (config default). */
|
|
22
|
-
features?: IsometricFeature[];
|
|
23
|
-
/** Camera mode forwarded to GameCanvas3D. */
|
|
24
|
-
cameraMode?: CameraMode;
|
|
25
|
-
/** Background color forwarded to GameCanvas3D. */
|
|
26
|
-
backgroundColor?: string;
|
|
27
|
-
/** Unit draw-size multiplier forwarded to GameCanvas3D. Default 1. */
|
|
28
|
-
unitScale?: number;
|
|
29
|
-
/** Board zoom/group scale forwarded to GameCanvas3D. Default 0.45. */
|
|
30
|
-
scale?: number;
|
|
31
|
-
/** Declarative tile click event emitted to the model. */
|
|
32
|
-
tileClickEvent?: EventEmit<{
|
|
33
|
-
tileId: string;
|
|
34
|
-
x: number;
|
|
35
|
-
z: number;
|
|
36
|
-
}>;
|
|
37
|
-
/** Declarative unit click event emitted to the model. */
|
|
38
|
-
unitClickEvent?: EventEmit<{
|
|
39
|
-
unitId: string;
|
|
40
|
-
x: number;
|
|
41
|
-
z: number;
|
|
42
|
-
}>;
|
|
43
|
-
/** Emits UI:{attackEvent} with { attackerId, targetId, damage } on attack. */
|
|
44
|
-
attackEvent?: EventEmit<{
|
|
45
|
-
attackerId: string;
|
|
46
|
-
targetId: string;
|
|
47
|
-
damage: number;
|
|
48
|
-
}>;
|
|
49
|
-
/** Emits UI:{endTurnEvent} with {} on end turn. */
|
|
50
|
-
endTurnEvent?: EventEmit<Record<string, never>>;
|
|
51
|
-
/** Emits UI:{cancelEvent} with {} on cancel. */
|
|
52
|
-
cancelEvent?: EventEmit<Record<string, never>>;
|
|
53
|
-
/** Emits UI:{playAgainEvent} with {} on play again / reset. */
|
|
54
|
-
playAgainEvent?: EventEmit<Record<string, never>>;
|
|
55
|
-
/** Emits UI:{gameEndEvent} with { result } when win/loss is detected. */
|
|
56
|
-
gameEndEvent?: EventEmit<{
|
|
57
|
-
result: 'victory' | 'defeat';
|
|
58
|
-
}>;
|
|
59
|
-
/** Additional CSS class. */
|
|
60
|
-
className?: string;
|
|
61
|
-
}
|
|
62
|
-
export declare function GameBoard3D({ entity, tiles, features, cameraMode, backgroundColor, unitScale, scale, tileClickEvent, unitClickEvent, attackEvent, endTurnEvent, cancelEvent, playAgainEvent, gameEndEvent, className, }: GameBoard3DProps): React.JSX.Element | null;
|
|
63
|
-
export declare namespace GameBoard3D {
|
|
64
|
-
var displayName: string;
|
|
65
|
-
}
|
|
66
|
-
export default GameBoard3D;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Curated list of the PUBLIC 3D (Three.js) render-ui pattern components.
|
|
3
|
-
*
|
|
4
|
-
* The 3D family is a code-split optional surface (published via the
|
|
5
|
-
* `@almadar/ui/components/{organisms,molecules}/game/three` subpath, never in
|
|
6
|
-
* the main barrel — that would pull @react-three/fiber into every app). This
|
|
7
|
-
* file is the source of truth for WHICH 3D components are render-ui patterns:
|
|
8
|
-
* `pattern-sync` discovers `patterns.ts` files by walking the tree and admits
|
|
9
|
-
* exactly the names listed here, so the 3D scene internals re-exported alongside
|
|
10
|
-
* them (Scene3D, Camera3D, Lighting3D, ModelLoader, Canvas3D, …) do NOT leak in
|
|
11
|
-
* as factory patterns. Move this file anywhere under `components/` and the
|
|
12
|
-
* scanner still finds it.
|
|
13
|
-
*
|
|
14
|
-
* @packageDocumentation
|
|
15
|
-
*/
|
|
16
|
-
export { GameCanvas3D } from './molecules/GameCanvas3D';
|
|
17
|
-
export { GameBoard3D } from './organisms/GameBoard3D';
|
|
18
|
-
export { GameCanvas3DBattleTemplate } from './templates/GameCanvas3DBattleTemplate';
|
|
19
|
-
export { GameCanvas3DCastleTemplate } from './templates/GameCanvas3DCastleTemplate';
|
|
20
|
-
export { GameCanvas3DWorldMapTemplate } from './templates/GameCanvas3DWorldMapTemplate';
|