@adminide-stack/yantra-mobile 12.0.171-alpha.0 → 12.0.172-alpha.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/lib/compute.js +51 -1
- package/lib/compute.js.map +1 -1
- package/lib/features/apps/AppsCatalog.js +10 -0
- package/lib/features/apps/AppsCatalog.js.map +1 -1
- package/lib/features/apps/mobileAppCatalog.js +9 -0
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/apps/nativeSurfaceTwin.js +2 -1
- package/lib/features/apps/nativeSurfaceTwin.js.map +1 -1
- package/lib/features/canvas/set/agent/prompt.js +4 -5
- package/lib/features/canvas/set/agent/prompt.js.map +1 -1
- package/lib/features/canvas/set/supplyLibrary.js +1294 -2
- package/lib/features/canvas/set/supplyLibrary.js.map +1 -1
- package/lib/features/games/cubeforge3D.js +26 -0
- package/lib/features/games/cubeforge3D.js.map +1 -0
- package/lib/features/games/vendored/core/classroom/permissions.js +76 -0
- package/lib/features/games/vendored/core/classroom/permissions.js.map +1 -0
- package/lib/features/games/vendored/core/classroom/resourceLink.js +101 -0
- package/lib/features/games/vendored/core/classroom/resourceLink.js.map +1 -0
- package/lib/features/games/vendored/core/classroom/rules.js +83 -0
- package/lib/features/games/vendored/core/classroom/rules.js.map +1 -0
- package/lib/features/games/vendored/core/classroom/worldSettings.js +49 -0
- package/lib/features/games/vendored/core/classroom/worldSettings.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/cycle.js +15 -0
- package/lib/features/games/vendored/core/cubeforge/cycle.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/inventory.js +75 -0
- package/lib/features/games/vendored/core/cubeforge/inventory.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/items.js +62 -0
- package/lib/features/games/vendored/core/cubeforge/items.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/nativeWorld.js +4 -0
- package/lib/features/games/vendored/core/cubeforge/nativeWorld.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/recipes.js +52 -0
- package/lib/features/games/vendored/core/cubeforge/recipes.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/save.js +92 -0
- package/lib/features/games/vendored/core/cubeforge/save.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/session.js +154 -0
- package/lib/features/games/vendored/core/cubeforge/session.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/worldgen.js +44 -0
- package/lib/features/games/vendored/core/cubeforge/worldgen.js.map +1 -0
- package/lib/features/games/vendored/core/engine/iso.js +41 -0
- package/lib/features/games/vendored/core/engine/iso.js.map +1 -0
- package/lib/features/games/vendored/core/engine/palette.js +53 -0
- package/lib/features/games/vendored/core/engine/palette.js.map +1 -0
- package/lib/features/games/vendored/core/engine/world.js +148 -0
- package/lib/features/games/vendored/core/engine/world.js.map +1 -0
- package/lib/features/games/vendored/core/games/catalog.js +34 -0
- package/lib/features/games/vendored/core/games/catalog.js.map +1 -0
- package/lib/features/games/vendored/core/lessons/lessons.js +97 -0
- package/lib/features/games/vendored/core/lessons/lessons.js.map +1 -0
- package/lib/features/games/vendored/core/logging/events.js +24 -0
- package/lib/features/games/vendored/core/logging/events.js.map +1 -0
- package/lib/features/games/vendored/core/logging/logger.js +54 -0
- package/lib/features/games/vendored/core/logging/logger.js.map +1 -0
- package/lib/features/games/vendored/core/session/gameSession.js +317 -0
- package/lib/features/games/vendored/core/session/gameSession.js.map +1 -0
- package/lib/features/games/vendored/core/storage/worldRepository.js +192 -0
- package/lib/features/games/vendored/core/storage/worldRepository.js.map +1 -0
- package/lib/features/games/vendored/core/store/reactive.js +78 -0
- package/lib/features/games/vendored/core/store/reactive.js.map +1 -0
- package/lib/features/games/vendored/ui/GamesRoot.js +159 -0
- package/lib/features/games/vendored/ui/GamesRoot.js.map +1 -0
- package/lib/features/games/vendored/ui/components/BlockPalette.js +64 -0
- package/lib/features/games/vendored/ui/components/BlockPalette.js.map +1 -0
- package/lib/features/games/vendored/ui/components/IsoCanvas.js +124 -0
- package/lib/features/games/vendored/ui/components/IsoCanvas.js.map +1 -0
- package/lib/features/games/vendored/ui/components/primitives.js +257 -0
- package/lib/features/games/vendored/ui/components/primitives.js.map +1 -0
- package/lib/features/games/vendored/ui/hooks/useReactiveQuery.js +3 -0
- package/lib/features/games/vendored/ui/hooks/useReactiveQuery.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/ActivityScreen.js +68 -0
- package/lib/features/games/vendored/ui/screens/ActivityScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/BuilderScreen.js +227 -0
- package/lib/features/games/vendored/ui/screens/BuilderScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/ClassroomScreen.js +95 -0
- package/lib/features/games/vendored/ui/screens/ClassroomScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/CubeforgeScreen.js +342 -0
- package/lib/features/games/vendored/ui/screens/CubeforgeScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/HubScreen.js +131 -0
- package/lib/features/games/vendored/ui/screens/HubScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/ScreenHeader.js +51 -0
- package/lib/features/games/vendored/ui/screens/ScreenHeader.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/WorldListScreen.js +134 -0
- package/lib/features/games/vendored/ui/screens/WorldListScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/storage/asyncStorageAdapter.js +23 -0
- package/lib/features/games/vendored/ui/storage/asyncStorageAdapter.js.map +1 -0
- package/lib/features/games/vendored/ui/theme.js +53 -0
- package/lib/features/games/vendored/ui/theme.js.map +1 -0
- package/lib/routes.json +50 -0
- package/lib/screens/GamesNative/index.js +30 -0
- package/lib/screens/GamesNative/index.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {DEFAULT_BOUNDS,VoxelWorld}from'../engine/world.js';function mulberry32(seed) {
|
|
2
|
+
let a = seed >>> 0;
|
|
3
|
+
return () => {
|
|
4
|
+
a = a + 1831565813 | 0;
|
|
5
|
+
let t = Math.imul(a ^ a >>> 15, 1 | a);
|
|
6
|
+
t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t;
|
|
7
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function seedFromString(input) {
|
|
11
|
+
let h = 2166136261;
|
|
12
|
+
for (let i = 0; i < input.length; i += 1) {
|
|
13
|
+
h ^= input.charCodeAt(i);
|
|
14
|
+
h = Math.imul(h, 16777619);
|
|
15
|
+
}
|
|
16
|
+
return h >>> 0;
|
|
17
|
+
}
|
|
18
|
+
const GRASS = 1;
|
|
19
|
+
const SOIL = 2;
|
|
20
|
+
const STONE = 3;
|
|
21
|
+
const WOOD = 4;
|
|
22
|
+
const SAND = 6;
|
|
23
|
+
function generateWorld(seed, bounds = DEFAULT_BOUNDS) {
|
|
24
|
+
const world = VoxelWorld.create(bounds);
|
|
25
|
+
const rnd = mulberry32(seed || 1);
|
|
26
|
+
for (let x = 0; x < bounds.x; x += 1) {
|
|
27
|
+
for (let y = 0; y < bounds.y; y += 1) {
|
|
28
|
+
const r = rnd();
|
|
29
|
+
const ground = r < 0.12 ? SAND : r < 0.26 ? SOIL : GRASS;
|
|
30
|
+
world.place(x, y, 0, ground);
|
|
31
|
+
if (bounds.z > 1 && rnd() < 0.06) world.place(x, y, 1, STONE);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const treeCount = Math.max(3, Math.floor(bounds.x * bounds.y / 24));
|
|
35
|
+
for (let i = 0; i < treeCount; i += 1) {
|
|
36
|
+
const x = Math.floor(rnd() * bounds.x);
|
|
37
|
+
const y = Math.floor(rnd() * bounds.y);
|
|
38
|
+
const height = 2 + Math.floor(rnd() * 2);
|
|
39
|
+
for (let z = 1; z <= height && z < bounds.z; z += 1) {
|
|
40
|
+
world.place(x, y, z, WOOD);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return world;
|
|
44
|
+
}export{generateWorld,seedFromString};//# sourceMappingURL=worldgen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worldgen.js","sources":["../../../../../../src/features/games/vendored/core/cubeforge/worldgen.ts"],"sourcesContent":["/**\n * Cubeforge world generation.\n *\n * A small, deterministic, seeded generator: a grass/soil/sand ground layer with\n * scattered stone outcrops and a handful of wood \"trees\" to gather. Deterministic\n * (same seed -> same world) so it is unit-testable and a player's world is stable\n * across sessions. Original implementation.\n */\n\nimport { VoxelWorld, DEFAULT_BOUNDS, type WorldBounds } from '../engine/world';\n\n/** mulberry32 - a tiny, fast, well-distributed 32-bit PRNG. */\nfunction mulberry32(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** Turn an arbitrary string (e.g. an org name) into a stable 32-bit seed. */\nexport function seedFromString(input: string): number {\n let h = 2166136261;\n for (let i = 0; i < input.length; i += 1) {\n h ^= input.charCodeAt(i);\n h = Math.imul(h, 16777619);\n }\n return h >>> 0;\n}\n\n// Block ids from the shared palette.\nconst GRASS = 1;\nconst SOIL = 2;\nconst STONE = 3;\nconst WOOD = 4;\nconst SAND = 6;\n\nexport function generateWorld(seed: number, bounds: WorldBounds = DEFAULT_BOUNDS): VoxelWorld {\n const world = VoxelWorld.create(bounds);\n const rnd = mulberry32(seed || 1);\n\n // Ground layer with soil / sand patches.\n for (let x = 0; x < bounds.x; x += 1) {\n for (let y = 0; y < bounds.y; y += 1) {\n const r = rnd();\n const ground = r < 0.12 ? SAND : r < 0.26 ? SOIL : GRASS;\n world.place(x, y, 0, ground);\n // Occasional stone outcrop one block high.\n if (bounds.z > 1 && rnd() < 0.06) world.place(x, y, 1, STONE);\n }\n }\n\n // A few trees: short wood columns the player can harvest.\n const treeCount = Math.max(3, Math.floor((bounds.x * bounds.y) / 24));\n for (let i = 0; i < treeCount; i += 1) {\n const x = Math.floor(rnd() * bounds.x);\n const y = Math.floor(rnd() * bounds.y);\n const height = 2 + Math.floor(rnd() * 2); // 2-3 tall\n for (let z = 1; z <= height && z < bounds.z; z += 1) {\n // place() no-ops on an occupied cell (e.g. a stone outcrop), which is fine.\n world.place(x, y, z, WOOD);\n }\n }\n\n return world;\n}\n"],"names":[],"mappings":"2DAYA,SAAS,WAAW,IAA4B,EAAA;AAC9C,EAAA,IAAI,IAAI,IAAS,KAAA,CAAA;AACjB,EAAA,OAAO,MAAM;AACX,IAAA,CAAA,GAAI,IAAI,UAAa,GAAA,CAAA;AACrB,IAAA,IAAI,IAAI,IAAK,CAAA,IAAA,CAAK,IAAI,CAAM,KAAA,EAAA,EAAI,IAAI,CAAC,CAAA;AACrC,IAAI,CAAA,GAAA,CAAA,GAAI,KAAK,IAAK,CAAA,CAAA,GAAI,MAAM,CAAG,EAAA,EAAA,GAAK,CAAC,CAAI,GAAA,CAAA;AACzC,IAAS,OAAA,CAAA,CAAA,CAAA,GAAI,CAAM,KAAA,EAAA,MAAQ,CAAK,IAAA,UAAA;AAAA,GAClC;AACF;AAGO,SAAS,eAAe,KAAuB,EAAA;AACpD,EAAA,IAAI,CAAI,GAAA,UAAA;AACR,EAAA,KAAA,IAAS,IAAI,CAAG,EAAA,CAAA,GAAI,KAAM,CAAA,MAAA,EAAQ,KAAK,CAAG,EAAA;AACxC,IAAK,CAAA,IAAA,KAAA,CAAM,WAAW,CAAC,CAAA;AACvB,IAAI,CAAA,GAAA,IAAA,CAAK,IAAK,CAAA,CAAA,EAAG,QAAQ,CAAA;AAAA;AAE3B,EAAA,OAAO,CAAM,KAAA,CAAA;AACf;AAGA,MAAM,KAAQ,GAAA,CAAA;AACd,MAAM,IAAO,GAAA,CAAA;AACb,MAAM,KAAQ,GAAA,CAAA;AACd,MAAM,IAAO,GAAA,CAAA;AACb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AM,SAAS,CAAI,GAAA,IAAA,CAAK,KAAM,CAAA,GAAA,KAAQ,CAAC,CAAA;AACvC,IAAS,KAAA,IAAA,CAAA,GAAI,GAAG,CAAK,IAAA,MAAA,IAAU,IAAI,MAAO,CAAA,CAAA,EAAG,KAAK,CAAG,EAAA;AAEnD,MAAA,KAAA,CAAM,KAAM,CAAA,CAAA,EAAG,CAAG,EAAA,CAAA,EAAG,IAAI,CAAA;AAAA;AAC3B;AAEF,EAAO,OAAA,KAAA;AACT"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function project(x, y, z, cfg) {
|
|
2
|
+
const sx = cfg.originX + (x - y) * (cfg.tileWidth / 2);
|
|
3
|
+
const sy = cfg.originY + (x + y) * (cfg.tileHeight / 2) - z * cfg.blockHeight;
|
|
4
|
+
return {
|
|
5
|
+
sx,
|
|
6
|
+
sy
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function unprojectToCell(sx, sy, z, cfg) {
|
|
10
|
+
const u = (sx - cfg.originX) / (cfg.tileWidth / 2);
|
|
11
|
+
const v = (sy - cfg.originY + z * cfg.blockHeight) / (cfg.tileHeight / 2);
|
|
12
|
+
return {
|
|
13
|
+
x: Math.round((u + v) / 2),
|
|
14
|
+
y: Math.round((v - u) / 2)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function depthKey(x, y, z) {
|
|
18
|
+
return x + y + z;
|
|
19
|
+
}
|
|
20
|
+
function blockFaces(x, y, z, cfg) {
|
|
21
|
+
const top0 = project(x, y, z + 1, cfg);
|
|
22
|
+
const top1 = project(x + 1, y, z + 1, cfg);
|
|
23
|
+
const top2 = project(x + 1, y + 1, z + 1, cfg);
|
|
24
|
+
const top3 = project(x, y + 1, z + 1, cfg);
|
|
25
|
+
const botL0 = project(x, y + 1, z, cfg);
|
|
26
|
+
const botL1 = project(x + 1, y + 1, z, cfg);
|
|
27
|
+
const botR1 = project(x + 1, y, z, cfg);
|
|
28
|
+
return {
|
|
29
|
+
top: [top0, top1, top2, top3],
|
|
30
|
+
// Left face faces toward +y (down-left on screen).
|
|
31
|
+
left: [top3, top2, botL1, botL0],
|
|
32
|
+
// Right face faces toward +x (down-right on screen).
|
|
33
|
+
right: [top2, top1, botR1, botL1]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function toSvgPoints(points) {
|
|
37
|
+
return points.map((p) => `${round(p.sx)},${round(p.sy)}`).join(" ");
|
|
38
|
+
}
|
|
39
|
+
function round(n) {
|
|
40
|
+
return Math.round(n * 100) / 100;
|
|
41
|
+
}export{blockFaces,depthKey,project,toSvgPoints,unprojectToCell};//# sourceMappingURL=iso.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iso.js","sources":["../../../../../../src/features/games/vendored/core/engine/iso.ts"],"sourcesContent":["/**\n * Isometric projection math for the block-building game.\n *\n * Original implementation. A block lives on an integer grid (x, y, z); this maps\n * grid coordinates to 2D screen points for a 2:1 isometric view and builds the\n * three visible faces of a cube so a renderer can paint them back-to-front.\n */\n\nexport interface Point {\n readonly sx: number;\n readonly sy: number;\n}\n\nexport interface IsoConfig {\n /** Full width of a tile diamond, in px. */\n readonly tileWidth: number;\n /** Full height of a tile diamond, in px (classically tileWidth / 2). */\n readonly tileHeight: number;\n /** Vertical screen offset per +1 in z (block height), in px. */\n readonly blockHeight: number;\n /** Screen-space origin the grid is drawn around. */\n readonly originX: number;\n readonly originY: number;\n}\n\nexport const defaultIsoConfig = (originX = 0, originY = 0): IsoConfig => ({\n tileWidth: 48,\n tileHeight: 24,\n blockHeight: 28,\n originX,\n originY,\n});\n\n/** Project a grid coordinate to a 2D screen point. */\nexport function project(x: number, y: number, z: number, cfg: IsoConfig): Point {\n const sx = cfg.originX + (x - y) * (cfg.tileWidth / 2);\n const sy = cfg.originY + (x + y) * (cfg.tileHeight / 2) - z * cfg.blockHeight;\n return { sx, sy };\n}\n\n/**\n * Inverse of `project` for a known z-plane: map a screen point back to the grid\n * cell on that plane, rounded to the nearest integer cell. Used for tap-to-build\n * hit testing when editing a single height layer.\n */\nexport function unprojectToCell(sx: number, sy: number, z: number, cfg: IsoConfig): { x: number; y: number } {\n const u = (sx - cfg.originX) / (cfg.tileWidth / 2); // = x - y\n const v = (sy - cfg.originY + z * cfg.blockHeight) / (cfg.tileHeight / 2); // = x + y\n return { x: Math.round((u + v) / 2), y: Math.round((v - u) / 2) };\n}\n\n/**\n * Painter's-algorithm depth key. Blocks with a smaller key are farther from the\n * camera and must be drawn first. For this projection, draw order along\n * (x + y + z) ascending yields correct occlusion for axis-aligned stacked cubes.\n */\nexport function depthKey(x: number, y: number, z: number): number {\n return x + y + z;\n}\n\nexport interface BlockFaces {\n /** Top rhombus (brightest). */\n readonly top: readonly Point[];\n /** Left face (medium shade). */\n readonly left: readonly Point[];\n /** Right face (darkest). */\n readonly right: readonly Point[];\n}\n\n/**\n * The three visible faces of the unit cube occupying cell (x, y, z), as screen\n * polygons. Corners are named by grid offset; z+1 is the top of the cube.\n */\nexport function blockFaces(x: number, y: number, z: number, cfg: IsoConfig): BlockFaces {\n const top0 = project(x, y, z + 1, cfg);\n const top1 = project(x + 1, y, z + 1, cfg);\n const top2 = project(x + 1, y + 1, z + 1, cfg);\n const top3 = project(x, y + 1, z + 1, cfg);\n\n const botL0 = project(x, y + 1, z, cfg);\n const botL1 = project(x + 1, y + 1, z, cfg);\n const botR1 = project(x + 1, y, z, cfg);\n\n return {\n top: [top0, top1, top2, top3],\n // Left face faces toward +y (down-left on screen).\n left: [top3, top2, botL1, botL0],\n // Right face faces toward +x (down-right on screen).\n right: [top2, top1, botR1, botL1],\n };\n}\n\n/** Serialize a polygon to an SVG `points` string. */\nexport function toSvgPoints(points: readonly Point[]): string {\n return points.map((p) => `${round(p.sx)},${round(p.sy)}`).join(' ');\n}\n\nfunction round(n: number): number {\n return Math.round(n * 100) / 100;\n}\n"],"names":[],"mappings":"AAgCO,SAAS,OAAQ,CAAA,CAAA,EAAW,CAAW,EAAA,CAAA,E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b", "#5aa64f", "#49893f"]
|
|
7
|
+
}, {
|
|
8
|
+
id: 2,
|
|
9
|
+
key: "soil",
|
|
10
|
+
name: "Soil",
|
|
11
|
+
faces: ["#b07a4e", "#95623b", "#7a4e2c"]
|
|
12
|
+
}, {
|
|
13
|
+
id: 3,
|
|
14
|
+
key: "stone",
|
|
15
|
+
name: "Stone",
|
|
16
|
+
faces: ["#b9bdc6", "#9aa0aa", "#7f858f"]
|
|
17
|
+
}, {
|
|
18
|
+
id: 4,
|
|
19
|
+
key: "wood",
|
|
20
|
+
name: "Wood",
|
|
21
|
+
faces: ["#d6a86a", "#b98a4f", "#9c7039"]
|
|
22
|
+
}, {
|
|
23
|
+
id: 5,
|
|
24
|
+
key: "water",
|
|
25
|
+
name: "Water",
|
|
26
|
+
faces: ["#5bb3e6", "#3f95cc", "#2f7cae"]
|
|
27
|
+
}, {
|
|
28
|
+
id: 6,
|
|
29
|
+
key: "sand",
|
|
30
|
+
name: "Sand",
|
|
31
|
+
faces: ["#ead9a0", "#d4bf7f", "#bca564"]
|
|
32
|
+
}, {
|
|
33
|
+
id: 7,
|
|
34
|
+
key: "brick",
|
|
35
|
+
name: "Brick",
|
|
36
|
+
faces: ["#d1684f", "#b34e38", "#953c29"]
|
|
37
|
+
}, {
|
|
38
|
+
id: 8,
|
|
39
|
+
key: "glass",
|
|
40
|
+
name: "Glass",
|
|
41
|
+
faces: ["#bfe9ef", "#a3d6df", "#8bc3cf"]
|
|
42
|
+
}];
|
|
43
|
+
const BY_ID = new Map(BLOCKS.map((b) => [b.id, b]));
|
|
44
|
+
const BY_KEY = new Map(BLOCKS.map((b) => [b.key, b]));
|
|
45
|
+
function blockById(id) {
|
|
46
|
+
return BY_ID.get(id);
|
|
47
|
+
}
|
|
48
|
+
function blockByKey(key) {
|
|
49
|
+
return BY_KEY.get(key);
|
|
50
|
+
}
|
|
51
|
+
function isValidBlockId(id) {
|
|
52
|
+
return id !== EMPTY && BY_ID.has(id);
|
|
53
|
+
}export{BLOCKS,EMPTY,blockById,blockByKey,isValidBlockId};//# sourceMappingURL=palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.js","sources":["../../../../../../src/features/games/vendored/core/engine/palette.ts"],"sourcesContent":["/**\n * The block palette for the block-building game. Original art direction: a small,\n * friendly set of material blocks, each with top / left / right face shades for\n * the isometric renderer. Ids are stable and used in saved worlds.\n */\n\nexport type BlockId = number;\n\nexport const EMPTY: BlockId = 0;\n\nexport interface BlockType {\n readonly id: BlockId;\n readonly key: string;\n readonly name: string;\n /** [top, left, right] face colors, light to dark. */\n readonly faces: readonly [string, string, string];\n}\n\nexport const BLOCKS: readonly BlockType[] = [\n { id: 1, key: 'grass', name: 'Grass', faces: ['#7cc86b', '#5aa64f', '#49893f'] },\n { id: 2, key: 'soil', name: 'Soil', faces: ['#b07a4e', '#95623b', '#7a4e2c'] },\n { id: 3, key: 'stone', name: 'Stone', faces: ['#b9bdc6', '#9aa0aa', '#7f858f'] },\n { id: 4, key: 'wood', name: 'Wood', faces: ['#d6a86a', '#b98a4f', '#9c7039'] },\n { id: 5, key: 'water', name: 'Water', faces: ['#5bb3e6', '#3f95cc', '#2f7cae'] },\n { id: 6, key: 'sand', name: 'Sand', faces: ['#ead9a0', '#d4bf7f', '#bca564'] },\n { id: 7, key: 'brick', name: 'Brick', faces: ['#d1684f', '#b34e38', '#953c29'] },\n { id: 8, key: 'glass', name: 'Glass', faces: ['#bfe9ef', '#a3d6df', '#8bc3cf'] },\n];\n\nconst BY_ID = new Map<BlockId, BlockType>(BLOCKS.map((b) => [b.id, b]));\nconst BY_KEY = new Map<string, BlockType>(BLOCKS.map((b) => [b.key, b]));\n\nexport function blockById(id: BlockId): BlockType | undefined {\n return BY_ID.get(id);\n}\n\nexport function blockByKey(key: string): BlockType | undefined {\n return BY_KEY.get(key);\n}\n\nexport function isValidBlockId(id: BlockId): boolean {\n return id !== EMPTY && BY_ID.has(id);\n}\n"],"names":[],"mappings":"AAOO,M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AA,EACJ,GAAK,EAAA,OAAA;AAAA,EACL,IAAM,EAAA,OAAA;AAAA,EACN,KAAO,EAAA,CAAC,SAAW,EAAA,SAAA,EAAW,SAAS;AACzC,CAAC;AACD,MAAM,KAAA,GAAQ,IAAI,GAAA,CAAwB,MAAO,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAC,CAAE,CAAA,EAAA,EAAI,CAAC,CAAC,CAAC,CAAA;AACpE,MAAM,MAAA,GAAS,IAAI,GAAA,CAAuB,MAAO,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAC,CAAE,CAAA,GAAA,EAAK,CAAC,CAAC,CAAC,CAAA;AAC9D,SAAS,UAAU,EAAoC,EAAA;AAC5D,EAAO,OAAA,KAAA,CAAM,IAAI,EAAE,CAAA;AACrB;AACO,SAAS,WAAW,GAAoC,EAAA;AAC7D,EAAO,OAAA,MAAA,CAAO,IAAI,GAAG,CAAA;AACvB;AACO,SAAS,eAAe,EAAsB,EAAA;AACnD,EAAA,OAAO,EAAO,KAAA,KAAA,IAAS,KAAM,CAAA,GAAA,CAAI,EAAE,CAAA;AACrC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import {isValidBlockId,EMPTY}from'./palette.js';import {depthKey}from'./iso.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
+
const DEFAULT_BOUNDS = {
|
|
22
|
+
x: 12,
|
|
23
|
+
y: 12,
|
|
24
|
+
z: 8
|
|
25
|
+
};
|
|
26
|
+
class VoxelWorld {
|
|
27
|
+
constructor(bounds, blocks) {
|
|
28
|
+
__publicField(this, "bounds");
|
|
29
|
+
__publicField(this, "blocks");
|
|
30
|
+
this.bounds = bounds;
|
|
31
|
+
this.blocks = blocks != null ? blocks : /* @__PURE__ */ new Map();
|
|
32
|
+
}
|
|
33
|
+
static create(bounds = DEFAULT_BOUNDS) {
|
|
34
|
+
return new VoxelWorld(bounds);
|
|
35
|
+
}
|
|
36
|
+
static deserialize(data) {
|
|
37
|
+
const blocks = /* @__PURE__ */ new Map();
|
|
38
|
+
for (const [key, id] of Object.entries(data.blocks)) {
|
|
39
|
+
const coord = parseKey(key);
|
|
40
|
+
if (!coord) continue;
|
|
41
|
+
if (!isValidBlockId(id)) continue;
|
|
42
|
+
if (!inBounds(coord.x, coord.y, coord.z, data.bounds)) continue;
|
|
43
|
+
blocks.set(key, id);
|
|
44
|
+
}
|
|
45
|
+
return new VoxelWorld(data.bounds, blocks);
|
|
46
|
+
}
|
|
47
|
+
serialize() {
|
|
48
|
+
const blocks = {};
|
|
49
|
+
for (const [key, id] of this.blocks) blocks[key] = id;
|
|
50
|
+
return {
|
|
51
|
+
bounds: this.bounds,
|
|
52
|
+
blocks
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
inBounds(x, y, z) {
|
|
56
|
+
return inBounds(x, y, z, this.bounds);
|
|
57
|
+
}
|
|
58
|
+
get(x, y, z) {
|
|
59
|
+
var _a;
|
|
60
|
+
return (_a = this.blocks.get(keyOf(x, y, z))) != null ? _a : EMPTY;
|
|
61
|
+
}
|
|
62
|
+
has(x, y, z) {
|
|
63
|
+
return this.blocks.has(keyOf(x, y, z));
|
|
64
|
+
}
|
|
65
|
+
place(x, y, z, block) {
|
|
66
|
+
if (!isValidBlockId(block)) return {
|
|
67
|
+
ok: false,
|
|
68
|
+
reason: "invalid-block"
|
|
69
|
+
};
|
|
70
|
+
if (!this.inBounds(x, y, z)) return {
|
|
71
|
+
ok: false,
|
|
72
|
+
reason: "out-of-bounds"
|
|
73
|
+
};
|
|
74
|
+
if (this.has(x, y, z)) return {
|
|
75
|
+
ok: false,
|
|
76
|
+
reason: "occupied"
|
|
77
|
+
};
|
|
78
|
+
this.blocks.set(keyOf(x, y, z), block);
|
|
79
|
+
return {
|
|
80
|
+
ok: true
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
break(x, y, z) {
|
|
84
|
+
if (!this.inBounds(x, y, z)) return {
|
|
85
|
+
ok: false,
|
|
86
|
+
reason: "out-of-bounds"
|
|
87
|
+
};
|
|
88
|
+
const key = keyOf(x, y, z);
|
|
89
|
+
const existing = this.blocks.get(key);
|
|
90
|
+
if (existing === void 0) return {
|
|
91
|
+
ok: false,
|
|
92
|
+
reason: "empty"
|
|
93
|
+
};
|
|
94
|
+
this.blocks.delete(key);
|
|
95
|
+
return {
|
|
96
|
+
ok: true,
|
|
97
|
+
removed: existing
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
clear() {
|
|
101
|
+
this.blocks.clear();
|
|
102
|
+
}
|
|
103
|
+
count() {
|
|
104
|
+
return this.blocks.size;
|
|
105
|
+
}
|
|
106
|
+
/** Count of placed blocks of a specific type. */
|
|
107
|
+
countOf(block) {
|
|
108
|
+
let n = 0;
|
|
109
|
+
for (const id of this.blocks.values()) if (id === block) n += 1;
|
|
110
|
+
return n;
|
|
111
|
+
}
|
|
112
|
+
list() {
|
|
113
|
+
const out = [];
|
|
114
|
+
for (const [key, block] of this.blocks) {
|
|
115
|
+
const coord = parseKey(key);
|
|
116
|
+
if (coord) out.push(__spreadProps(__spreadValues({}, coord), {
|
|
117
|
+
block
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
return out;
|
|
121
|
+
}
|
|
122
|
+
/** Blocks sorted back-to-front for painter's-algorithm rendering. */
|
|
123
|
+
drawOrder() {
|
|
124
|
+
return this.list().sort((a, b) => depthKey(a.x, a.y, a.z) - depthKey(b.x, b.y, b.z));
|
|
125
|
+
}
|
|
126
|
+
clone() {
|
|
127
|
+
return new VoxelWorld(this.bounds, new Map(this.blocks));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function keyOf(x, y, z) {
|
|
131
|
+
return `${x},${y},${z}`;
|
|
132
|
+
}
|
|
133
|
+
function parseKey(key) {
|
|
134
|
+
const parts = key.split(",");
|
|
135
|
+
if (parts.length !== 3) return null;
|
|
136
|
+
const x = Number(parts[0]);
|
|
137
|
+
const y = Number(parts[1]);
|
|
138
|
+
const z = Number(parts[2]);
|
|
139
|
+
if (!Number.isInteger(x) || !Number.isInteger(y) || !Number.isInteger(z)) return null;
|
|
140
|
+
return {
|
|
141
|
+
x,
|
|
142
|
+
y,
|
|
143
|
+
z
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function inBounds(x, y, z, bounds) {
|
|
147
|
+
return Number.isInteger(x) && Number.isInteger(y) && Number.isInteger(z) && x >= 0 && y >= 0 && z >= 0 && x < bounds.x && y < bounds.y && z < bounds.z;
|
|
148
|
+
}export{DEFAULT_BOUNDS,VoxelWorld};//# sourceMappingURL=world.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world.js","sources":["../../../../../../src/features/games/vendored/core/engine/world.ts"],"sourcesContent":["/**\n * The voxel world: a bounded integer grid of blocks. Pure data structure with\n * no rule logic - rule enforcement lives in the game session, which owns a world\n * and gates mutations. Stored sparsely (only non-empty cells) and serialisable.\n */\n\nimport { EMPTY, isValidBlockId, type BlockId } from './palette';\nimport { depthKey } from './iso';\n\nexport interface WorldBounds {\n readonly x: number;\n readonly y: number;\n readonly z: number;\n}\n\nexport interface PlacedBlock {\n readonly x: number;\n readonly y: number;\n readonly z: number;\n readonly block: BlockId;\n}\n\nexport interface SerializedWorld {\n readonly bounds: WorldBounds;\n /** Sparse map of \"x,y,z\" -> block id. */\n readonly blocks: Record<string, BlockId>;\n}\n\nexport type PlaceResult = { ok: true } | { ok: false; reason: 'out-of-bounds' | 'occupied' | 'invalid-block' };\n\nexport type BreakResult = { ok: true; removed: BlockId } | { ok: false; reason: 'out-of-bounds' | 'empty' };\n\nexport const DEFAULT_BOUNDS: WorldBounds = { x: 12, y: 12, z: 8 };\n\nexport class VoxelWorld {\n readonly bounds: WorldBounds;\n private readonly blocks: Map<string, BlockId>;\n\n constructor(bounds: WorldBounds, blocks?: Map<string, BlockId>) {\n this.bounds = bounds;\n this.blocks = blocks ?? new Map();\n }\n\n static create(bounds: WorldBounds = DEFAULT_BOUNDS): VoxelWorld {\n return new VoxelWorld(bounds);\n }\n\n static deserialize(data: SerializedWorld): VoxelWorld {\n const blocks = new Map<string, BlockId>();\n for (const [key, id] of Object.entries(data.blocks)) {\n const coord = parseKey(key);\n if (!coord) continue;\n if (!isValidBlockId(id)) continue;\n if (!inBounds(coord.x, coord.y, coord.z, data.bounds)) continue;\n blocks.set(key, id);\n }\n return new VoxelWorld(data.bounds, blocks);\n }\n\n serialize(): SerializedWorld {\n const blocks: Record<string, BlockId> = {};\n for (const [key, id] of this.blocks) blocks[key] = id;\n return { bounds: this.bounds, blocks };\n }\n\n inBounds(x: number, y: number, z: number): boolean {\n return inBounds(x, y, z, this.bounds);\n }\n\n get(x: number, y: number, z: number): BlockId {\n return this.blocks.get(keyOf(x, y, z)) ?? EMPTY;\n }\n\n has(x: number, y: number, z: number): boolean {\n return this.blocks.has(keyOf(x, y, z));\n }\n\n place(x: number, y: number, z: number, block: BlockId): PlaceResult {\n if (!isValidBlockId(block)) return { ok: false, reason: 'invalid-block' };\n if (!this.inBounds(x, y, z)) return { ok: false, reason: 'out-of-bounds' };\n if (this.has(x, y, z)) return { ok: false, reason: 'occupied' };\n this.blocks.set(keyOf(x, y, z), block);\n return { ok: true };\n }\n\n break(x: number, y: number, z: number): BreakResult {\n if (!this.inBounds(x, y, z)) return { ok: false, reason: 'out-of-bounds' };\n const key = keyOf(x, y, z);\n const existing = this.blocks.get(key);\n if (existing === undefined) return { ok: false, reason: 'empty' };\n this.blocks.delete(key);\n return { ok: true, removed: existing };\n }\n\n clear(): void {\n this.blocks.clear();\n }\n\n count(): number {\n return this.blocks.size;\n }\n\n /** Count of placed blocks of a specific type. */\n countOf(block: BlockId): number {\n let n = 0;\n for (const id of this.blocks.values()) if (id === block) n += 1;\n return n;\n }\n\n list(): PlacedBlock[] {\n const out: PlacedBlock[] = [];\n for (const [key, block] of this.blocks) {\n const coord = parseKey(key);\n if (coord) out.push({ ...coord, block });\n }\n return out;\n }\n\n /** Blocks sorted back-to-front for painter's-algorithm rendering. */\n drawOrder(): PlacedBlock[] {\n return this.list().sort((a, b) => depthKey(a.x, a.y, a.z) - depthKey(b.x, b.y, b.z));\n }\n\n clone(): VoxelWorld {\n return new VoxelWorld(this.bounds, new Map(this.blocks));\n }\n}\n\nfunction keyOf(x: number, y: number, z: number): string {\n return `${x},${y},${z}`;\n}\n\nfunction parseKey(key: string): { x: number; y: number; z: number } | null {\n const parts = key.split(',');\n if (parts.length !== 3) return null;\n const x = Number(parts[0]);\n const y = Number(parts[1]);\n const z = Number(parts[2]);\n if (!Number.isInteger(x) || !Number.isInteger(y) || !Number.isInteger(z)) return null;\n return { x, y, z };\n}\n\nfunction inBounds(x: number, y: number, z: number, bounds: WorldBounds): boolean {\n return (\n Number.isInteger(x) &&\n Number.isInteger(y) &&\n Number.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EAAA,MAAM,CAAI,GAAA,MAAA,CAAO,KAAM,CAAA,CAAC,CAAC,CAAA;AACzB,EAAA,IAAI,CAAC,MAAA,CAAO,SAAU,CAAA,CAAC,KAAK,CAAC,MAAA,CAAO,SAAU,CAAA,CAAC,KAAK,CAAC,MAAA,CAAO,SAAU,CAAA,CAAC,GAAU,OAAA,IAAA;AACjF,EAAO,OAAA;AAAA,IACL,CAAA;AAAA,IACA,CAAA;AAAA,IACA;AAAA,GACF;AACF;AACA,SAAS,QAAS,CAAA,CAAA,EAAW,CAAW,EAAA,CAAA,EAAW,MAA8B,EAAA;AAC/E,EAAO,OAAA,MAAA,CAAO,SAAU,CAAA,CAAC,CAAK,IAAA,MAAA,CAAO,UAAU,CAAC,CAAA,IAAK,MAAO,CAAA,SAAA,CAAU,CAAC,CAAA,IAAK,KAAK,CAAK,IAAA,CAAA,IAAK,CAAK,IAAA,CAAA,IAAK,CAAK,IAAA,CAAA,GAAI,MAAO,CAAA,CAAA,IAAK,CAAI,GAAA,MAAA,CAAO,CAAK,IAAA,CAAA,GAAI,MAAO,CAAA,CAAA;AACvJ"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const BLOCKWRIGHT_ID = "blockwright";
|
|
2
|
+
const CUBEFORGE_ID = "cubeforge";
|
|
3
|
+
const GAMES = [{
|
|
4
|
+
id: BLOCKWRIGHT_ID,
|
|
5
|
+
name: "Blockwright",
|
|
6
|
+
tagline: "Build worlds block by block, with guided lessons and a classroom mode.",
|
|
7
|
+
status: "available",
|
|
8
|
+
accent: "#7cc86b",
|
|
9
|
+
icon: "cube-outline"
|
|
10
|
+
}, {
|
|
11
|
+
id: CUBEFORGE_ID,
|
|
12
|
+
name: "Cubeforge",
|
|
13
|
+
tagline: "Gather, craft, and build to survive - day turns to night.",
|
|
14
|
+
status: "available",
|
|
15
|
+
accent: "#e0a24e",
|
|
16
|
+
icon: "pickaxe"
|
|
17
|
+
}, {
|
|
18
|
+
id: "numberforge",
|
|
19
|
+
name: "Numberforge",
|
|
20
|
+
tagline: "Shape numbers into towers and patterns. Coming soon.",
|
|
21
|
+
status: "coming-soon",
|
|
22
|
+
accent: "#5bb3e6",
|
|
23
|
+
icon: "numeric"
|
|
24
|
+
}, {
|
|
25
|
+
id: "wordsmith",
|
|
26
|
+
name: "Wordsmith",
|
|
27
|
+
tagline: "Craft words from letter blocks. Coming soon.",
|
|
28
|
+
status: "coming-soon",
|
|
29
|
+
accent: "#d1684f",
|
|
30
|
+
icon: "alphabetical-variant"
|
|
31
|
+
}];
|
|
32
|
+
function gameById(id) {
|
|
33
|
+
return GAMES.find((g) => g.id === id);
|
|
34
|
+
}export{BLOCKWRIGHT_ID,CUBEFORGE_ID,GAMES,gameById};//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sources":["../../../../../../src/features/games/vendored/core/games/catalog.ts"],"sourcesContent":["/**\n * The games hub catalog. The hub screen renders this list. New games are added\n * here; the flagship block-building game (\"Blockwright\") is the first available\n * title, with placeholders expressing the wider learning-games direction.\n *\n * All titles, taglines, and art direction are original to Yantra.\n */\n\nexport type GameStatus = 'available' | 'coming-soon';\n\nexport interface GameDefinition {\n readonly id: string;\n readonly name: string;\n readonly tagline: string;\n readonly status: GameStatus;\n /** Accent colour for the hub tile. */\n readonly accent: string;\n /** MaterialCommunityIcons glyph name used by the app shell. */\n readonly icon: string;\n}\n\nexport const BLOCKWRIGHT_ID = 'blockwright';\nexport const CUBEFORGE_ID = 'cubeforge';\n\nexport const GAMES: readonly GameDefinition[] = [\n {\n id: BLOCKWRIGHT_ID,\n name: 'Blockwright',\n tagline: 'Build worlds block by block, with guided lessons and a classroom mode.',\n status: 'available',\n accent: '#7cc86b',\n icon: 'cube-outline',\n },\n {\n id: CUBEFORGE_ID,\n name: 'Cubeforge',\n tagline: 'Gather, craft, and build to survive - day turns to night.',\n status: 'available',\n accent: '#e0a24e',\n icon: 'pickaxe',\n },\n {\n id: 'numberforge',\n name: 'Numberforge',\n tagline: 'Shape numbers into towers and patterns. Coming soon.',\n status: 'coming-soon',\n accent: '#5bb3e6',\n icon: 'numeric',\n },\n {\n id: 'wordsmith',\n name: 'Wordsmith',\n tagline: 'Craft words from letter blocks. Coming soon.',\n status: 'coming-soon',\n accent: '#d1684f',\n icon: 'alphabetical-variant',\n },\n];\n\nexport function availableGames(): GameDefinition[] {\n return GAMES.filter((g) => g.status === 'available');\n}\n\nexport function gameById(id: string): GameDefinition | undefined {\n return GAMES.find((g) => g.id === id);\n}\n"],"names":[],"mappings":"AAmBO,MAAM,cAAiB,GAAA;AACvB,MAAM,YAAe,GAAA;AACrB,MAAM,QAAmC,CAAC;AAAA,EAC/C,EAAI,EAAA,cAAA;AAAA,EACJ,IAAM,EAAA,aAAA;AAAA,EACN,OAAS,EAAA,wEAAA;AAAA,EACT,MAAQ,EAAA,WAAA;AAAA,EACR,MAAQ,EAAA,SAAA;AAAA,EACR,IAAM,EAAA;AACR,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,YAAA;AAAA,EACJ,IAAM,EAAA,WAAA;AAAA,EACN,OAAS,EAAA,2DAAA;AAAA,EACT,MAAQ,EAAA,WAAA;AAAA,EACR,MAAQ,EAAA,SAAA;AAAA,EACR,IAAM,EAAA;AACR,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,aAAA;AAAA,EACJ,IAAM,EAAA,aAAA;AAAA,EACN,OAAS,EAAA,sDAAA;AAAA,EACT,MAAQ,EAAA,aAAA;AAAA,EACR,MAAQ,EAAA,SAAA;AAAA,EACR,IAAM,EAAA;AACR,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,WAAA;AAAA,EACJ,IAAM,EAAA,WAAA;AAAA,EACN,OAAS,EAAA,8CAAA;AAAA,EACT,MAAQ,EAAA,aAAA;AAAA,EACR,MAAQ,EAAA,SAAA;AAAA,EACR,IAAM,EAAA;AACR,CAAC;AAIM,SAAS,SAAS,EAAwC,EAAA;AAC/D,EAAA,OAAO,KAAM,CAAA,IAAA,CAAK,CAAK,CAAA,KAAA,CAAA,CAAE,OAAO,EAAE,CAAA;AACpC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {blockByKey}from'../engine/palette.js';var _a, _b;
|
|
2
|
+
const grass = (_a = blockByKey("grass")) == null ? void 0 : _a.id;
|
|
3
|
+
(_b = blockByKey("stone")) == null ? void 0 : _b.id;
|
|
4
|
+
const LESSONS = [{
|
|
5
|
+
id: "first-blocks",
|
|
6
|
+
title: "First Blocks",
|
|
7
|
+
summary: "Tap the ground to place your first five blocks.",
|
|
8
|
+
goal: {
|
|
9
|
+
kind: "placeCount",
|
|
10
|
+
target: 5
|
|
11
|
+
}
|
|
12
|
+
}, {
|
|
13
|
+
id: "solid-ground",
|
|
14
|
+
title: "Solid Ground",
|
|
15
|
+
summary: "Lay a 3 x 3 floor of grass to stand on.",
|
|
16
|
+
goal: grass !== void 0 ? {
|
|
17
|
+
kind: "placeCount",
|
|
18
|
+
target: 9,
|
|
19
|
+
block: grass
|
|
20
|
+
} : {
|
|
21
|
+
kind: "placeCount",
|
|
22
|
+
target: 9
|
|
23
|
+
}
|
|
24
|
+
}, {
|
|
25
|
+
id: "raise-a-pillar",
|
|
26
|
+
title: "Raise a Pillar",
|
|
27
|
+
summary: "Stack four stone blocks straight up.",
|
|
28
|
+
goal: buildPillar()
|
|
29
|
+
}, {
|
|
30
|
+
id: "build-an-arch",
|
|
31
|
+
title: "Build an Arch",
|
|
32
|
+
summary: "Place the blocks to complete a small arch.",
|
|
33
|
+
goal: {
|
|
34
|
+
kind: "buildShape",
|
|
35
|
+
cells: [{
|
|
36
|
+
x: 3,
|
|
37
|
+
y: 5,
|
|
38
|
+
z: 0
|
|
39
|
+
}, {
|
|
40
|
+
x: 3,
|
|
41
|
+
y: 5,
|
|
42
|
+
z: 1
|
|
43
|
+
}, {
|
|
44
|
+
x: 3,
|
|
45
|
+
y: 5,
|
|
46
|
+
z: 2
|
|
47
|
+
}, {
|
|
48
|
+
x: 4,
|
|
49
|
+
y: 5,
|
|
50
|
+
z: 2
|
|
51
|
+
}, {
|
|
52
|
+
x: 5,
|
|
53
|
+
y: 5,
|
|
54
|
+
z: 2
|
|
55
|
+
}, {
|
|
56
|
+
x: 5,
|
|
57
|
+
y: 5,
|
|
58
|
+
z: 1
|
|
59
|
+
}, {
|
|
60
|
+
x: 5,
|
|
61
|
+
y: 5,
|
|
62
|
+
z: 0
|
|
63
|
+
}]
|
|
64
|
+
}
|
|
65
|
+
}];
|
|
66
|
+
function buildPillar(block) {
|
|
67
|
+
const cells = [0, 1, 2, 3].map((z) => ({
|
|
68
|
+
x: 6,
|
|
69
|
+
y: 6,
|
|
70
|
+
z
|
|
71
|
+
}));
|
|
72
|
+
return {
|
|
73
|
+
kind: "buildShape",
|
|
74
|
+
cells
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function evaluateLesson(lesson, blocks) {
|
|
78
|
+
const goal = lesson.goal;
|
|
79
|
+
if (goal.kind === "placeCount") {
|
|
80
|
+
const count = goal.block === void 0 ? blocks.length : blocks.reduce((n, b) => b.block === goal.block ? n + 1 : n, 0);
|
|
81
|
+
return clampProgress(count, goal.target);
|
|
82
|
+
}
|
|
83
|
+
const present = new Set(blocks.map((b) => `${b.x},${b.y},${b.z}`));
|
|
84
|
+
let matched = 0;
|
|
85
|
+
for (const cell of goal.cells) {
|
|
86
|
+
if (present.has(`${cell.x},${cell.y},${cell.z}`)) matched += 1;
|
|
87
|
+
}
|
|
88
|
+
return clampProgress(matched, goal.cells.length);
|
|
89
|
+
}
|
|
90
|
+
function clampProgress(rawCurrent, target) {
|
|
91
|
+
const current = Math.max(0, Math.min(rawCurrent, target));
|
|
92
|
+
return {
|
|
93
|
+
current,
|
|
94
|
+
target,
|
|
95
|
+
done: rawCurrent >= target
|
|
96
|
+
};
|
|
97
|
+
}export{LESSONS,evaluateLesson};//# sourceMappingURL=lessons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lessons.js","sources":["../../../../../../src/features/games/vendored/core/lessons/lessons.ts"],"sourcesContent":["/**\n * Guided lessons for the block-building game. Original content.\n *\n * Progress is clamped to the target so a completed lesson never reads like\n * \"15 of 5\" when a learner keeps building past the goal.\n */\n\nimport { blockByKey } from '../engine/palette';\nimport type { BlockId } from '../engine/palette';\nimport type { PlacedBlock } from '../engine/world';\n\nexport type LessonGoal =\n | { kind: 'placeCount'; target: number; block?: BlockId }\n | { kind: 'buildShape'; cells: readonly { x: number; y: number; z: number }[] };\n\nexport interface Lesson {\n readonly id: string;\n readonly title: string;\n readonly summary: string;\n readonly goal: LessonGoal;\n}\n\nexport interface LessonProgress {\n /** Progress toward the goal, clamped to [0, target]. */\n readonly current: number;\n readonly target: number;\n readonly done: boolean;\n}\n\nconst grass = blockByKey('grass')?.id;\nconst stone = blockByKey('stone')?.id;\n\nexport const LESSONS: readonly Lesson[] = [\n {\n id: 'first-blocks',\n title: 'First Blocks',\n summary: 'Tap the ground to place your first five blocks.',\n goal: { kind: 'placeCount', target: 5 },\n },\n {\n id: 'solid-ground',\n title: 'Solid Ground',\n summary: 'Lay a 3 x 3 floor of grass to stand on.',\n goal: grass !== undefined ? { kind: 'placeCount', target: 9, block: grass } : { kind: 'placeCount', target: 9 },\n },\n {\n id: 'raise-a-pillar',\n title: 'Raise a Pillar',\n summary: 'Stack four stone blocks straight up.',\n goal: buildPillar(stone),\n },\n {\n id: 'build-an-arch',\n title: 'Build an Arch',\n summary: 'Place the blocks to complete a small arch.',\n goal: {\n kind: 'buildShape',\n cells: [\n { x: 3, y: 5, z: 0 },\n { x: 3, y: 5, z: 1 },\n { x: 3, y: 5, z: 2 },\n { x: 4, y: 5, z: 2 },\n { x: 5, y: 5, z: 2 },\n { x: 5, y: 5, z: 1 },\n { x: 5, y: 5, z: 0 },\n ],\n },\n },\n];\n\nfunction buildPillar(block: BlockId | undefined): LessonGoal {\n const cells = [0, 1, 2, 3].map((z) => ({ x: 6, y: 6, z }));\n // Represent as a shape so it must be an actual stacked pillar, not any 4 blocks.\n return { kind: 'buildShape', cells };\n void block;\n}\n\n/** Evaluate how far a world has progressed through a lesson. */\nexport function evaluateLesson(lesson: Lesson, blocks: readonly PlacedBlock[]): LessonProgress {\n const goal = lesson.goal;\n if (goal.kind === 'placeCount') {\n const count =\n goal.block === undefined ? blocks.length : blocks.reduce((n, b) => (b.block === goal.block ? n + 1 : n), 0);\n return clampProgress(count, goal.target);\n }\n\n const present = new Set(blocks.map((b) => `${b.x},${b.y},${b.z}`));\n let matched = 0;\n for (const cell of goal.cells) {\n if (present.has(`${cell.x},${cell.y},${cell.z}`)) matched += 1;\n }\n return clampProgress(matched, goal.cells.length);\n}\n\nfunction clampProgress(rawCurrent: number, target: number): LessonProgress {\n const current = Math.max(0, Math.min(rawCurrent, target));\n return { current, target, done: rawCurrent >= target };\n}\n\nexport function lessonById(id: string): Lesson | undefined {\n return LESSONS.find((l) => l.id === id);\n}\n"],"names":[],"mappings":"8CAAA,IAAA,EAAA,EAAA,EAAA;AAkCA,MAAM,KAAQ,GAAA,CAAA,EAAA,GAAA,UAAA,CAAW,OAAO,CAAA,KAAlB,IAAqB,GAAA,MAAA,GAAA,EAAA,CAAA,EAAA;AACrB,CAAA,EAAA,GAAA,UAAA,CAAW,OAAO,CAAA,KAAlB,IAAqB,GAAA,MAAA,GAAA,EAAA,CAAA;AAC5B,MAAM,UAA6B,CAAC;AAAA,EACzC,EAAI,EAAA,cAAA;AAAA,EACJ,KAAO,EAAA,cAAA;AAAA,EACP,OAAS,EAAA,iDAAA;AAAA,EACT,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA,YAAA;AAAA,IACN,MAAQ,EAAA;AAAA;AAEZ,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,cAAA;AAAA,EACJ,KAAO,EAAA,cAAA;AAAA,EACP,OAAS,EAAA,yCAAA;AAAA,EACT,IAAA,EAAM,UAAU,MAAY,GAAA;AAAA,IAC1B,IAAM,EAAA,YAAA;AA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AA;AACzE,EAAM,MAAA,OAAA,GAAU,KAAK,GAAI,CAAA,CAAA,EAAG,KAAK,GAAI,CAAA,UAAA,EAAY,MAAM,CAAC,CAAA;AACxD,EAAO,OAAA;AAAA,IACL,OAAA;AAAA,IACA,MAAA;AAAA,IACA,MAAM,UAAc,IAAA;AAAA,GACtB;AACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function describeEvent(event) {
|
|
2
|
+
switch (event.type) {
|
|
3
|
+
case "session.start":
|
|
4
|
+
return "Opened the world";
|
|
5
|
+
case "block.place":
|
|
6
|
+
return `Placed a block at ${event.x}, ${event.y}, ${event.z}`;
|
|
7
|
+
case "block.break":
|
|
8
|
+
return `Removed a block at ${event.x}, ${event.y}, ${event.z}`;
|
|
9
|
+
case "world.reset":
|
|
10
|
+
return "Cleared the world";
|
|
11
|
+
case "world.undo":
|
|
12
|
+
return "Undid a change";
|
|
13
|
+
case "setting.change":
|
|
14
|
+
return `Changed "${event.key}" to ${event.value ? "on" : "off"}`;
|
|
15
|
+
case "resourceLink.set":
|
|
16
|
+
return event.hasUrl ? "Set the resource link" : "Cleared the resource link";
|
|
17
|
+
case "resourceLink.open":
|
|
18
|
+
return `Opened the resource link (${event.host})`;
|
|
19
|
+
case "permission.change":
|
|
20
|
+
return `Changed ${event.field} to ${String(event.value)}`;
|
|
21
|
+
case "lesson.complete":
|
|
22
|
+
return `Completed lesson "${event.lessonId}"`;
|
|
23
|
+
}
|
|
24
|
+
}export{describeEvent};//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sources":["../../../../../../src/features/games/vendored/core/logging/events.ts"],"sourcesContent":["/**\n * Game activity events.\n *\n * The analysed classroom product routes activity through a native `telemetry`\n * surface. Yantra Games keeps an equivalent, but local-first and\n * privacy-respecting: events carry no personal data (just what happened, where,\n * and when), nothing leaves the device by default, and the host app may attach a\n * sink to forward events to Yantra telemetry if a deployment opts in.\n */\n\nimport type { BlockId } from '../engine/palette';\nimport type { BooleanSettingKey } from '../classroom/worldSettings';\nimport type { PermissionLevel } from '../classroom/permissions';\n\ntype Ev<T extends string, P = Record<never, never>> = { type: T } & P;\n\n/** An event before it is time-stamped by the logger. */\nexport type GameEventInput =\n | Ev<'session.start', { worldId?: string }>\n | Ev<'block.place', { block: BlockId; x: number; y: number; z: number }>\n | Ev<'block.break', { x: number; y: number; z: number }>\n | Ev<'world.reset'>\n | Ev<'world.undo'>\n | Ev<'setting.change', { key: BooleanSettingKey; value: boolean }>\n | Ev<'resourceLink.set', { hasUrl: boolean }>\n | Ev<'resourceLink.open', { host: string }>\n | Ev<'permission.change', { field: 'hostEnabled' | 'defaultLevel'; value: boolean | PermissionLevel }>\n | Ev<'lesson.complete', { lessonId: string }>;\n\n/** A time-stamped event as stored and surfaced. */\nexport type GameEvent = GameEventInput & { at: number };\n\nexport type GameEventType = GameEvent['type'];\n\n/** Short, human-readable one-liner for an activity-log row. */\nexport function describeEvent(event: GameEvent): string {\n switch (event.type) {\n case 'session.start':\n return 'Opened the world';\n case 'block.place':\n return `Placed a block at ${event.x}, ${event.y}, ${event.z}`;\n case 'block.break':\n return `Removed a block at ${event.x}, ${event.y}, ${event.z}`;\n case 'world.reset':\n return 'Cleared the world';\n case 'world.undo':\n return 'Undid a change';\n case 'setting.change':\n return `Changed \"${event.key}\" to ${event.value ? 'on' : 'off'}`;\n case 'resourceLink.set':\n return event.hasUrl ? 'Set the resource link' : 'Cleared the resource link';\n case 'resourceLink.open':\n return `Opened the resource link (${event.host})`;\n case 'permission.change':\n return `Changed ${event.field} to ${String(event.value)}`;\n case 'lesson.complete':\n return `Completed lesson \"${event.lessonId}\"`;\n }\n}\n"],"names":[],"mappings":"AAkDO,SAAS,cAAc,KAA0B,EAAA;AACtD,EAAA,QAAQ,MAAM,IAAM;AAAA,IAClB,KAAK,eAAA;AACH,MAAO,OAAA,kBAAA;AAAA,IACT,KAAK,aAAA;AACH,MAAO,OAAA,CAAA,kBAAA,EAAqB,MAAM,CAAC,CAAA,EAAA,EAAK,MAAM,CAAC,CAAA,EAAA,EAAK,MAAM,CAAC,CAAA,CAAA;AAAA,IAC7D,KAAK,aAAA;AACH,MAAO,OAAA,CAAA,mBAAA,EAAsB,MAAM,CAAC,CAAA,EAAA,EAAK,MAAM,CAAC,CAAA,EAAA,EAAK,MAAM,CAAC,CAAA,CAAA;AAAA,IAC9D,KAAK,aAAA;AACH,MAAO,OAAA,mBAAA;AAAA,IACT,KAAK,YAAA;AACH,MAAO,OAAA,gBAAA;AAAA,IACT,KAAK,gBAAA;AACH,MAAA,OAAO,YAAY,KAAM,CAAA,GAAG,QAAQ,KAAM,CAAA,KAAA,GAAQ,OAAO,KAAK,CAAA,CAAA;AAAA,IAChE,KAAK,kBAAA;AACH,MAAO,OAAA,KAAA,CAAM,SAAS,uBAA0B,GAAA,2BAAA;AAAA,IAClD,KAAK,mBAAA;AACH,MAAO,OAAA,CAAA,0BAAA,EAA6B,MAAM,IAAI,CAAA,CAAA,CAAA;AAAA,IAChD,KAAK,mBAAA;AACH,MAAA,OAAO,WAAW,KAAM,CAAA,KAAK,OAAO,MAAO,CAAA,KAAA,CAAM,KAAK,CAAC,CAAA,CAAA;AAAA,IACzD,KAAK,iBAAA;AACH,MAAO,OAAA,CAAA,kBAAA,EAAqB,MAAM,QAAQ,CAAA,CAAA,CAAA;AAAA;AAEhD"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {ReactiveValue}from'../store/reactive.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
21
|
+
const DEFAULT_RECENT_LIMIT = 200;
|
|
22
|
+
class GameLogger {
|
|
23
|
+
constructor(sinks = [], clock = () => Date.now(), recentLimit = DEFAULT_RECENT_LIMIT) {
|
|
24
|
+
this.clock = clock;
|
|
25
|
+
this.recentLimit = recentLimit;
|
|
26
|
+
__publicField(this, "sinks");
|
|
27
|
+
__publicField(this, "recentBuffer");
|
|
28
|
+
this.sinks = [...sinks];
|
|
29
|
+
this.recentBuffer = new ReactiveValue([]);
|
|
30
|
+
}
|
|
31
|
+
/** Newest-first reactive buffer of recent events. */
|
|
32
|
+
get recent() {
|
|
33
|
+
return this.recentBuffer;
|
|
34
|
+
}
|
|
35
|
+
log(input) {
|
|
36
|
+
const event = __spreadProps(__spreadValues({}, input), {
|
|
37
|
+
at: this.clock()
|
|
38
|
+
});
|
|
39
|
+
this.recentBuffer.update((prev) => [event, ...prev].slice(0, this.recentLimit));
|
|
40
|
+
for (const sink of this.sinks) {
|
|
41
|
+
try {
|
|
42
|
+
sink.write(event);
|
|
43
|
+
} catch (e) {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return event;
|
|
47
|
+
}
|
|
48
|
+
addSink(sink) {
|
|
49
|
+
this.sinks.push(sink);
|
|
50
|
+
}
|
|
51
|
+
clear() {
|
|
52
|
+
this.recentBuffer.set([]);
|
|
53
|
+
}
|
|
54
|
+
}export{GameLogger};//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sources":["../../../../../../src/features/games/vendored/core/logging/logger.ts"],"sourcesContent":["/**\n * The game activity logger.\n *\n * Fans events out to zero or more sinks and keeps a bounded, reactive buffer of\n * recent events for an in-app activity view. Sinks are pluggable: nothing is\n * emitted off-device unless the host app attaches a sink that does so.\n */\n\nimport { ReactiveValue, type Query } from '../store/reactive';\nimport type { GameEvent, GameEventInput } from './events';\n\nexport interface LogSink {\n write(event: GameEvent): void;\n}\n\n/** Buffers every event in memory - handy for tests and an activity view. */\nexport class MemorySink implements LogSink {\n readonly events: GameEvent[] = [];\n write(event: GameEvent): void {\n this.events.push(event);\n }\n}\n\n/** Writes a compact line per event to the console. Opt-in (debug aid). */\nexport class ConsoleSink implements LogSink {\n constructor(private readonly prefix = '[yantra-games]') {}\n write(event: GameEvent): void {\n // eslint-disable-next-line no-console\n console.log(this.prefix, event.type, event);\n }\n}\n\nconst DEFAULT_RECENT_LIMIT = 200;\n\nexport class GameLogger {\n private readonly sinks: LogSink[];\n private readonly recentBuffer: ReactiveValue<readonly GameEvent[]>;\n\n constructor(\n sinks: LogSink[] = [],\n private readonly clock: () => number = () => Date.now(),\n private readonly recentLimit: number = DEFAULT_RECENT_LIMIT,\n ) {\n this.sinks = [...sinks];\n this.recentBuffer = new ReactiveValue<readonly GameEvent[]>([]);\n }\n\n /** Newest-first reactive buffer of recent events. */\n get recent(): Query<readonly GameEvent[]> {\n return this.recentBuffer;\n }\n\n log(input: GameEventInput): GameEvent {\n const event = { ...input, at: this.clock() } as GameEvent;\n this.recentBuffer.update((prev) => [event, ...prev].slice(0, this.recentLimit));\n for (const sink of this.sinks) {\n try {\n sink.write(event);\n } catch {\n // A misbehaving sink must never break gameplay.\n }\n }\n return event;\n }\n\n add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