@almadar/ui 5.43.0 → 5.45.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 +8 -151
- package/dist/avl/index.js +9 -152
- package/dist/components/game/molecules/three/index.cjs +128 -17
- package/dist/components/game/molecules/three/index.css +1 -0
- package/dist/components/game/molecules/three/index.js +128 -17
- package/dist/components/game/templates/GameCanvas3DBattleTemplate.d.ts +8 -1
- package/dist/components/game/templates/GameCanvas3DCastleTemplate.d.ts +8 -1
- package/dist/components/game/templates/GameCanvas3DWorldMapTemplate.d.ts +8 -1
- package/dist/components/index.cjs +125 -145
- package/dist/components/index.js +126 -146
- package/dist/providers/index.cjs +8 -151
- package/dist/providers/index.js +9 -152
- package/dist/runtime/index.cjs +8 -151
- package/dist/runtime/index.js +9 -152
- package/package.json +1 -1
|
@@ -3206,8 +3206,46 @@ var Typography = ({
|
|
|
3206
3206
|
);
|
|
3207
3207
|
};
|
|
3208
3208
|
Typography.displayName = "Typography";
|
|
3209
|
+
var DEFAULT_3D_BATTLE_TILES = [
|
|
3210
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "stone", passable: false },
|
|
3211
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "stone", passable: false },
|
|
3212
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "stone", passable: false },
|
|
3213
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "stone", passable: false },
|
|
3214
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "stone", passable: false },
|
|
3215
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "stone", passable: false },
|
|
3216
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "dirt", passable: true },
|
|
3217
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true },
|
|
3218
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true },
|
|
3219
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "stone", passable: false },
|
|
3220
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "stone", passable: false },
|
|
3221
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true },
|
|
3222
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "dirt", passable: true },
|
|
3223
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true },
|
|
3224
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "stone", passable: false },
|
|
3225
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "stone", passable: false },
|
|
3226
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true },
|
|
3227
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true },
|
|
3228
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "dirt", passable: true },
|
|
3229
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "stone", passable: false },
|
|
3230
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "stone", passable: false },
|
|
3231
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "stone", passable: false },
|
|
3232
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "stone", passable: false },
|
|
3233
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "stone", passable: false },
|
|
3234
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "stone", passable: false }
|
|
3235
|
+
];
|
|
3236
|
+
var DEFAULT_3D_BATTLE_UNITS = [
|
|
3237
|
+
{ id: "u1", x: 1, y: 1, z: 1, unitType: "warrior", name: "Worker", faction: "player", health: 10, maxHealth: 10 },
|
|
3238
|
+
{ id: "u2", x: 3, y: 3, z: 3, unitType: "enemy", name: "Guardian", faction: "enemy", health: 8, maxHealth: 10 }
|
|
3239
|
+
];
|
|
3240
|
+
var DEFAULT_3D_BATTLE_FEATURES = [
|
|
3241
|
+
{ id: "f1", x: 2, y: 2, z: 2, type: "gold_mine", color: "#f4c542" },
|
|
3242
|
+
{ id: "f2", x: 3, y: 1, z: 1, type: "portal", color: "#8b5cf6" }
|
|
3243
|
+
];
|
|
3209
3244
|
function GameCanvas3DBattleTemplate({
|
|
3210
3245
|
entity,
|
|
3246
|
+
tiles: propTiles = DEFAULT_3D_BATTLE_TILES,
|
|
3247
|
+
units: propUnits = DEFAULT_3D_BATTLE_UNITS,
|
|
3248
|
+
features: propFeatures = DEFAULT_3D_BATTLE_FEATURES,
|
|
3211
3249
|
cameraMode = "perspective",
|
|
3212
3250
|
showGrid = true,
|
|
3213
3251
|
shadows = true,
|
|
@@ -3224,12 +3262,11 @@ function GameCanvas3DBattleTemplate({
|
|
|
3224
3262
|
className
|
|
3225
3263
|
}) {
|
|
3226
3264
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
3227
|
-
|
|
3228
|
-
const
|
|
3229
|
-
const
|
|
3230
|
-
const
|
|
3231
|
-
const
|
|
3232
|
-
const round = resolved.round == null ? void 0 : Number(resolved.round);
|
|
3265
|
+
const tiles = resolved ? Array.isArray(resolved.tiles) ? resolved.tiles : [] : propTiles;
|
|
3266
|
+
const units = resolved ? Array.isArray(resolved.units) ? resolved.units : [] : propUnits;
|
|
3267
|
+
const features = resolved ? Array.isArray(resolved.features) ? resolved.features : [] : propFeatures;
|
|
3268
|
+
const currentTurn = resolved?.currentTurn;
|
|
3269
|
+
const round = resolved?.round == null ? void 0 : Number(resolved.round);
|
|
3233
3270
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("game-canvas-3d-battle-template", className), children: [
|
|
3234
3271
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3235
3272
|
GameCanvas3D,
|
|
@@ -3269,8 +3306,46 @@ function GameCanvas3DBattleTemplate({
|
|
|
3269
3306
|
] });
|
|
3270
3307
|
}
|
|
3271
3308
|
GameCanvas3DBattleTemplate.displayName = "GameCanvas3DBattleTemplate";
|
|
3309
|
+
var DEFAULT_3D_CASTLE_TILES = [
|
|
3310
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "wall", passable: false },
|
|
3311
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "wall", passable: false },
|
|
3312
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "wall", passable: false },
|
|
3313
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "wall", passable: false },
|
|
3314
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "wall", passable: false },
|
|
3315
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "wall", passable: false },
|
|
3316
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "floor", passable: true },
|
|
3317
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "floor", passable: true },
|
|
3318
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "floor", passable: true },
|
|
3319
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "wall", passable: false },
|
|
3320
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "wall", passable: false },
|
|
3321
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "floor", passable: true },
|
|
3322
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "floor", passable: true },
|
|
3323
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "floor", passable: true },
|
|
3324
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "wall", passable: false },
|
|
3325
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "wall", passable: false },
|
|
3326
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "floor", passable: true },
|
|
3327
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "floor", passable: true },
|
|
3328
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "floor", passable: true },
|
|
3329
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "wall", passable: false },
|
|
3330
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "wall", passable: false },
|
|
3331
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "wall", passable: false },
|
|
3332
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "wall", passable: false },
|
|
3333
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "wall", passable: false },
|
|
3334
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "wall", passable: false }
|
|
3335
|
+
];
|
|
3336
|
+
var DEFAULT_3D_CASTLE_UNITS = [
|
|
3337
|
+
{ id: "u1", x: 1, y: 1, z: 1, unitType: "worker", name: "Worker", faction: "player", health: 10, maxHealth: 10 },
|
|
3338
|
+
{ id: "u2", x: 3, y: 3, z: 3, unitType: "guardian", name: "Guardian", faction: "player", health: 10, maxHealth: 10 }
|
|
3339
|
+
];
|
|
3340
|
+
var DEFAULT_3D_CASTLE_FEATURES = [
|
|
3341
|
+
{ id: "f1", x: 2, y: 2, z: 2, type: "chest", color: "#f4c542" },
|
|
3342
|
+
{ id: "f2", x: 3, y: 1, z: 1, type: "crystal", color: "#8b5cf6" }
|
|
3343
|
+
];
|
|
3272
3344
|
function GameCanvas3DCastleTemplate({
|
|
3273
3345
|
entity,
|
|
3346
|
+
tiles: propTiles = DEFAULT_3D_CASTLE_TILES,
|
|
3347
|
+
units: propUnits = DEFAULT_3D_CASTLE_UNITS,
|
|
3348
|
+
features: propFeatures = DEFAULT_3D_CASTLE_FEATURES,
|
|
3274
3349
|
cameraMode = "isometric",
|
|
3275
3350
|
showGrid = true,
|
|
3276
3351
|
shadows = true,
|
|
@@ -3287,13 +3362,12 @@ function GameCanvas3DCastleTemplate({
|
|
|
3287
3362
|
className
|
|
3288
3363
|
}) {
|
|
3289
3364
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
3290
|
-
|
|
3291
|
-
const
|
|
3292
|
-
const
|
|
3293
|
-
const
|
|
3294
|
-
const
|
|
3295
|
-
const
|
|
3296
|
-
const owner = resolved.owner == null ? void 0 : String(resolved.owner);
|
|
3365
|
+
const tiles = resolved ? Array.isArray(resolved.tiles) ? resolved.tiles : [] : propTiles;
|
|
3366
|
+
const units = resolved ? Array.isArray(resolved.units) ? resolved.units : [] : propUnits;
|
|
3367
|
+
const features = resolved ? Array.isArray(resolved.features) ? resolved.features : [] : propFeatures;
|
|
3368
|
+
const name = resolved?.name == null ? void 0 : String(resolved.name);
|
|
3369
|
+
const level = resolved?.level == null ? void 0 : Number(resolved.level);
|
|
3370
|
+
const owner = resolved?.owner == null ? void 0 : String(resolved.owner);
|
|
3297
3371
|
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { className: cn("game-canvas-3d-castle-template", className), children: [
|
|
3298
3372
|
showHeader && name && /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", align: "center", className: "castle-template__header", children: [
|
|
3299
3373
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h2", className: "header__name", children: name }),
|
|
@@ -3332,8 +3406,46 @@ function GameCanvas3DCastleTemplate({
|
|
|
3332
3406
|
] });
|
|
3333
3407
|
}
|
|
3334
3408
|
GameCanvas3DCastleTemplate.displayName = "GameCanvas3DCastleTemplate";
|
|
3409
|
+
var DEFAULT_3D_WORLDMAP_TILES = [
|
|
3410
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "mountain", passable: false },
|
|
3411
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "mountain", passable: false },
|
|
3412
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "water", passable: false },
|
|
3413
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "mountain", passable: false },
|
|
3414
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "mountain", passable: false },
|
|
3415
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "mountain", passable: false },
|
|
3416
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "grass", passable: true },
|
|
3417
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true },
|
|
3418
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true },
|
|
3419
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "water", passable: false },
|
|
3420
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "water", passable: false },
|
|
3421
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true },
|
|
3422
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "road", passable: true },
|
|
3423
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true },
|
|
3424
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "mountain", passable: false },
|
|
3425
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "mountain", passable: false },
|
|
3426
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true },
|
|
3427
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true },
|
|
3428
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "road", passable: true },
|
|
3429
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "mountain", passable: false },
|
|
3430
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "mountain", passable: false },
|
|
3431
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "water", passable: false },
|
|
3432
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "grass", passable: true },
|
|
3433
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "mountain", passable: false },
|
|
3434
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "mountain", passable: false }
|
|
3435
|
+
];
|
|
3436
|
+
var DEFAULT_3D_WORLDMAP_UNITS = [
|
|
3437
|
+
{ id: "h1", x: 1, y: 1, z: 1, unitType: "hero", name: "Amir", faction: "player", health: 10, maxHealth: 10 },
|
|
3438
|
+
{ id: "h2", x: 3, y: 3, z: 3, unitType: "scout", name: "Archivist", faction: "player", health: 10, maxHealth: 10 }
|
|
3439
|
+
];
|
|
3440
|
+
var DEFAULT_3D_WORLDMAP_FEATURES = [
|
|
3441
|
+
{ id: "f1", x: 2, y: 2, z: 2, type: "capital", color: "#f4c542" },
|
|
3442
|
+
{ id: "f2", x: 4, y: 2, z: 2, type: "power_node", color: "#8b5cf6" }
|
|
3443
|
+
];
|
|
3335
3444
|
function GameCanvas3DWorldMapTemplate({
|
|
3336
3445
|
entity,
|
|
3446
|
+
tiles: propTiles = DEFAULT_3D_WORLDMAP_TILES,
|
|
3447
|
+
units: propUnits = DEFAULT_3D_WORLDMAP_UNITS,
|
|
3448
|
+
features: propFeatures = DEFAULT_3D_WORLDMAP_FEATURES,
|
|
3337
3449
|
cameraMode = "isometric",
|
|
3338
3450
|
showGrid = true,
|
|
3339
3451
|
showCoordinates = true,
|
|
@@ -3352,10 +3464,9 @@ function GameCanvas3DWorldMapTemplate({
|
|
|
3352
3464
|
className
|
|
3353
3465
|
}) {
|
|
3354
3466
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
3355
|
-
|
|
3356
|
-
const
|
|
3357
|
-
const
|
|
3358
|
-
const features = Array.isArray(resolved.features) ? resolved.features : [];
|
|
3467
|
+
const tiles = resolved ? Array.isArray(resolved.tiles) ? resolved.tiles : [] : propTiles;
|
|
3468
|
+
const units = resolved ? Array.isArray(resolved.units) ? resolved.units : [] : propUnits;
|
|
3469
|
+
const features = resolved ? Array.isArray(resolved.features) ? resolved.features : [] : propFeatures;
|
|
3359
3470
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3360
3471
|
GameCanvas3D,
|
|
3361
3472
|
{
|
|
@@ -3182,8 +3182,46 @@ var Typography = ({
|
|
|
3182
3182
|
);
|
|
3183
3183
|
};
|
|
3184
3184
|
Typography.displayName = "Typography";
|
|
3185
|
+
var DEFAULT_3D_BATTLE_TILES = [
|
|
3186
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "stone", passable: false },
|
|
3187
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "stone", passable: false },
|
|
3188
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "stone", passable: false },
|
|
3189
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "stone", passable: false },
|
|
3190
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "stone", passable: false },
|
|
3191
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "stone", passable: false },
|
|
3192
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "dirt", passable: true },
|
|
3193
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true },
|
|
3194
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true },
|
|
3195
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "stone", passable: false },
|
|
3196
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "stone", passable: false },
|
|
3197
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true },
|
|
3198
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "dirt", passable: true },
|
|
3199
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true },
|
|
3200
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "stone", passable: false },
|
|
3201
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "stone", passable: false },
|
|
3202
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true },
|
|
3203
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true },
|
|
3204
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "dirt", passable: true },
|
|
3205
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "stone", passable: false },
|
|
3206
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "stone", passable: false },
|
|
3207
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "stone", passable: false },
|
|
3208
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "stone", passable: false },
|
|
3209
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "stone", passable: false },
|
|
3210
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "stone", passable: false }
|
|
3211
|
+
];
|
|
3212
|
+
var DEFAULT_3D_BATTLE_UNITS = [
|
|
3213
|
+
{ id: "u1", x: 1, y: 1, z: 1, unitType: "warrior", name: "Worker", faction: "player", health: 10, maxHealth: 10 },
|
|
3214
|
+
{ id: "u2", x: 3, y: 3, z: 3, unitType: "enemy", name: "Guardian", faction: "enemy", health: 8, maxHealth: 10 }
|
|
3215
|
+
];
|
|
3216
|
+
var DEFAULT_3D_BATTLE_FEATURES = [
|
|
3217
|
+
{ id: "f1", x: 2, y: 2, z: 2, type: "gold_mine", color: "#f4c542" },
|
|
3218
|
+
{ id: "f2", x: 3, y: 1, z: 1, type: "portal", color: "#8b5cf6" }
|
|
3219
|
+
];
|
|
3185
3220
|
function GameCanvas3DBattleTemplate({
|
|
3186
3221
|
entity,
|
|
3222
|
+
tiles: propTiles = DEFAULT_3D_BATTLE_TILES,
|
|
3223
|
+
units: propUnits = DEFAULT_3D_BATTLE_UNITS,
|
|
3224
|
+
features: propFeatures = DEFAULT_3D_BATTLE_FEATURES,
|
|
3187
3225
|
cameraMode = "perspective",
|
|
3188
3226
|
showGrid = true,
|
|
3189
3227
|
shadows = true,
|
|
@@ -3200,12 +3238,11 @@ function GameCanvas3DBattleTemplate({
|
|
|
3200
3238
|
className
|
|
3201
3239
|
}) {
|
|
3202
3240
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
3203
|
-
|
|
3204
|
-
const
|
|
3205
|
-
const
|
|
3206
|
-
const
|
|
3207
|
-
const
|
|
3208
|
-
const round = resolved.round == null ? void 0 : Number(resolved.round);
|
|
3241
|
+
const tiles = resolved ? Array.isArray(resolved.tiles) ? resolved.tiles : [] : propTiles;
|
|
3242
|
+
const units = resolved ? Array.isArray(resolved.units) ? resolved.units : [] : propUnits;
|
|
3243
|
+
const features = resolved ? Array.isArray(resolved.features) ? resolved.features : [] : propFeatures;
|
|
3244
|
+
const currentTurn = resolved?.currentTurn;
|
|
3245
|
+
const round = resolved?.round == null ? void 0 : Number(resolved.round);
|
|
3209
3246
|
return /* @__PURE__ */ jsxs(Box, { className: cn("game-canvas-3d-battle-template", className), children: [
|
|
3210
3247
|
/* @__PURE__ */ jsx(
|
|
3211
3248
|
GameCanvas3D,
|
|
@@ -3245,8 +3282,46 @@ function GameCanvas3DBattleTemplate({
|
|
|
3245
3282
|
] });
|
|
3246
3283
|
}
|
|
3247
3284
|
GameCanvas3DBattleTemplate.displayName = "GameCanvas3DBattleTemplate";
|
|
3285
|
+
var DEFAULT_3D_CASTLE_TILES = [
|
|
3286
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "wall", passable: false },
|
|
3287
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "wall", passable: false },
|
|
3288
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "wall", passable: false },
|
|
3289
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "wall", passable: false },
|
|
3290
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "wall", passable: false },
|
|
3291
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "wall", passable: false },
|
|
3292
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "floor", passable: true },
|
|
3293
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "floor", passable: true },
|
|
3294
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "floor", passable: true },
|
|
3295
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "wall", passable: false },
|
|
3296
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "wall", passable: false },
|
|
3297
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "floor", passable: true },
|
|
3298
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "floor", passable: true },
|
|
3299
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "floor", passable: true },
|
|
3300
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "wall", passable: false },
|
|
3301
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "wall", passable: false },
|
|
3302
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "floor", passable: true },
|
|
3303
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "floor", passable: true },
|
|
3304
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "floor", passable: true },
|
|
3305
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "wall", passable: false },
|
|
3306
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "wall", passable: false },
|
|
3307
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "wall", passable: false },
|
|
3308
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "wall", passable: false },
|
|
3309
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "wall", passable: false },
|
|
3310
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "wall", passable: false }
|
|
3311
|
+
];
|
|
3312
|
+
var DEFAULT_3D_CASTLE_UNITS = [
|
|
3313
|
+
{ id: "u1", x: 1, y: 1, z: 1, unitType: "worker", name: "Worker", faction: "player", health: 10, maxHealth: 10 },
|
|
3314
|
+
{ id: "u2", x: 3, y: 3, z: 3, unitType: "guardian", name: "Guardian", faction: "player", health: 10, maxHealth: 10 }
|
|
3315
|
+
];
|
|
3316
|
+
var DEFAULT_3D_CASTLE_FEATURES = [
|
|
3317
|
+
{ id: "f1", x: 2, y: 2, z: 2, type: "chest", color: "#f4c542" },
|
|
3318
|
+
{ id: "f2", x: 3, y: 1, z: 1, type: "crystal", color: "#8b5cf6" }
|
|
3319
|
+
];
|
|
3248
3320
|
function GameCanvas3DCastleTemplate({
|
|
3249
3321
|
entity,
|
|
3322
|
+
tiles: propTiles = DEFAULT_3D_CASTLE_TILES,
|
|
3323
|
+
units: propUnits = DEFAULT_3D_CASTLE_UNITS,
|
|
3324
|
+
features: propFeatures = DEFAULT_3D_CASTLE_FEATURES,
|
|
3250
3325
|
cameraMode = "isometric",
|
|
3251
3326
|
showGrid = true,
|
|
3252
3327
|
shadows = true,
|
|
@@ -3263,13 +3338,12 @@ function GameCanvas3DCastleTemplate({
|
|
|
3263
3338
|
className
|
|
3264
3339
|
}) {
|
|
3265
3340
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
3266
|
-
|
|
3267
|
-
const
|
|
3268
|
-
const
|
|
3269
|
-
const
|
|
3270
|
-
const
|
|
3271
|
-
const
|
|
3272
|
-
const owner = resolved.owner == null ? void 0 : String(resolved.owner);
|
|
3341
|
+
const tiles = resolved ? Array.isArray(resolved.tiles) ? resolved.tiles : [] : propTiles;
|
|
3342
|
+
const units = resolved ? Array.isArray(resolved.units) ? resolved.units : [] : propUnits;
|
|
3343
|
+
const features = resolved ? Array.isArray(resolved.features) ? resolved.features : [] : propFeatures;
|
|
3344
|
+
const name = resolved?.name == null ? void 0 : String(resolved.name);
|
|
3345
|
+
const level = resolved?.level == null ? void 0 : Number(resolved.level);
|
|
3346
|
+
const owner = resolved?.owner == null ? void 0 : String(resolved.owner);
|
|
3273
3347
|
return /* @__PURE__ */ jsxs(VStack, { className: cn("game-canvas-3d-castle-template", className), children: [
|
|
3274
3348
|
showHeader && name && /* @__PURE__ */ jsxs(HStack, { gap: "md", align: "center", className: "castle-template__header", children: [
|
|
3275
3349
|
/* @__PURE__ */ jsx(Typography, { variant: "h2", className: "header__name", children: name }),
|
|
@@ -3308,8 +3382,46 @@ function GameCanvas3DCastleTemplate({
|
|
|
3308
3382
|
] });
|
|
3309
3383
|
}
|
|
3310
3384
|
GameCanvas3DCastleTemplate.displayName = "GameCanvas3DCastleTemplate";
|
|
3385
|
+
var DEFAULT_3D_WORLDMAP_TILES = [
|
|
3386
|
+
{ id: "t00", x: 0, y: 0, z: 0, type: "mountain", passable: false },
|
|
3387
|
+
{ id: "t10", x: 1, y: 0, z: 0, type: "mountain", passable: false },
|
|
3388
|
+
{ id: "t20", x: 2, y: 0, z: 0, type: "water", passable: false },
|
|
3389
|
+
{ id: "t30", x: 3, y: 0, z: 0, type: "mountain", passable: false },
|
|
3390
|
+
{ id: "t40", x: 4, y: 0, z: 0, type: "mountain", passable: false },
|
|
3391
|
+
{ id: "t01", x: 0, y: 1, z: 1, type: "mountain", passable: false },
|
|
3392
|
+
{ id: "t11", x: 1, y: 1, z: 1, type: "grass", passable: true },
|
|
3393
|
+
{ id: "t21", x: 2, y: 1, z: 1, type: "grass", passable: true },
|
|
3394
|
+
{ id: "t31", x: 3, y: 1, z: 1, type: "grass", passable: true },
|
|
3395
|
+
{ id: "t41", x: 4, y: 1, z: 1, type: "water", passable: false },
|
|
3396
|
+
{ id: "t02", x: 0, y: 2, z: 2, type: "water", passable: false },
|
|
3397
|
+
{ id: "t12", x: 1, y: 2, z: 2, type: "grass", passable: true },
|
|
3398
|
+
{ id: "t22", x: 2, y: 2, z: 2, type: "road", passable: true },
|
|
3399
|
+
{ id: "t32", x: 3, y: 2, z: 2, type: "grass", passable: true },
|
|
3400
|
+
{ id: "t42", x: 4, y: 2, z: 2, type: "mountain", passable: false },
|
|
3401
|
+
{ id: "t03", x: 0, y: 3, z: 3, type: "mountain", passable: false },
|
|
3402
|
+
{ id: "t13", x: 1, y: 3, z: 3, type: "grass", passable: true },
|
|
3403
|
+
{ id: "t23", x: 2, y: 3, z: 3, type: "grass", passable: true },
|
|
3404
|
+
{ id: "t33", x: 3, y: 3, z: 3, type: "road", passable: true },
|
|
3405
|
+
{ id: "t43", x: 4, y: 3, z: 3, type: "mountain", passable: false },
|
|
3406
|
+
{ id: "t04", x: 0, y: 4, z: 4, type: "mountain", passable: false },
|
|
3407
|
+
{ id: "t14", x: 1, y: 4, z: 4, type: "water", passable: false },
|
|
3408
|
+
{ id: "t24", x: 2, y: 4, z: 4, type: "grass", passable: true },
|
|
3409
|
+
{ id: "t34", x: 3, y: 4, z: 4, type: "mountain", passable: false },
|
|
3410
|
+
{ id: "t44", x: 4, y: 4, z: 4, type: "mountain", passable: false }
|
|
3411
|
+
];
|
|
3412
|
+
var DEFAULT_3D_WORLDMAP_UNITS = [
|
|
3413
|
+
{ id: "h1", x: 1, y: 1, z: 1, unitType: "hero", name: "Amir", faction: "player", health: 10, maxHealth: 10 },
|
|
3414
|
+
{ id: "h2", x: 3, y: 3, z: 3, unitType: "scout", name: "Archivist", faction: "player", health: 10, maxHealth: 10 }
|
|
3415
|
+
];
|
|
3416
|
+
var DEFAULT_3D_WORLDMAP_FEATURES = [
|
|
3417
|
+
{ id: "f1", x: 2, y: 2, z: 2, type: "capital", color: "#f4c542" },
|
|
3418
|
+
{ id: "f2", x: 4, y: 2, z: 2, type: "power_node", color: "#8b5cf6" }
|
|
3419
|
+
];
|
|
3311
3420
|
function GameCanvas3DWorldMapTemplate({
|
|
3312
3421
|
entity,
|
|
3422
|
+
tiles: propTiles = DEFAULT_3D_WORLDMAP_TILES,
|
|
3423
|
+
units: propUnits = DEFAULT_3D_WORLDMAP_UNITS,
|
|
3424
|
+
features: propFeatures = DEFAULT_3D_WORLDMAP_FEATURES,
|
|
3313
3425
|
cameraMode = "isometric",
|
|
3314
3426
|
showGrid = true,
|
|
3315
3427
|
showCoordinates = true,
|
|
@@ -3328,10 +3440,9 @@ function GameCanvas3DWorldMapTemplate({
|
|
|
3328
3440
|
className
|
|
3329
3441
|
}) {
|
|
3330
3442
|
const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
|
|
3331
|
-
|
|
3332
|
-
const
|
|
3333
|
-
const
|
|
3334
|
-
const features = Array.isArray(resolved.features) ? resolved.features : [];
|
|
3443
|
+
const tiles = resolved ? Array.isArray(resolved.tiles) ? resolved.tiles : [] : propTiles;
|
|
3444
|
+
const units = resolved ? Array.isArray(resolved.units) ? resolved.units : [] : propUnits;
|
|
3445
|
+
const features = resolved ? Array.isArray(resolved.features) ? resolved.features : [] : propFeatures;
|
|
3335
3446
|
return /* @__PURE__ */ jsx(
|
|
3336
3447
|
GameCanvas3D,
|
|
3337
3448
|
{
|
|
@@ -19,8 +19,15 @@
|
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
|
+
import type { IsometricTile, IsometricUnit, IsometricFeature } from '../organisms/types/isometric';
|
|
22
23
|
import type { TemplateProps } from '../../core/templates/types';
|
|
23
24
|
export interface GameCanvas3DBattleTemplateProps extends TemplateProps {
|
|
25
|
+
/** Fallback tile data when no entity is present */
|
|
26
|
+
tiles?: IsometricTile[];
|
|
27
|
+
/** Fallback unit data when no entity is present */
|
|
28
|
+
units?: IsometricUnit[];
|
|
29
|
+
/** Fallback feature data when no entity is present */
|
|
30
|
+
features?: IsometricFeature[];
|
|
24
31
|
/** 3D camera mode - defaults to perspective for dramatic effect */
|
|
25
32
|
cameraMode?: 'isometric' | 'perspective' | 'top-down';
|
|
26
33
|
/** Show grid helper */
|
|
@@ -74,7 +81,7 @@ export interface GameCanvas3DBattleTemplateProps extends TemplateProps {
|
|
|
74
81
|
* />
|
|
75
82
|
* ```
|
|
76
83
|
*/
|
|
77
|
-
export declare function GameCanvas3DBattleTemplate({ entity, cameraMode, showGrid, shadows, backgroundColor, tileClickEvent, unitClickEvent, unitAttackEvent, unitMoveEvent, endTurnEvent, exitEvent, selectedUnitId, validMoves, attackTargets, className, }: GameCanvas3DBattleTemplateProps): React.JSX.Element | null;
|
|
84
|
+
export declare function GameCanvas3DBattleTemplate({ entity, tiles: propTiles, units: propUnits, features: propFeatures, cameraMode, showGrid, shadows, backgroundColor, tileClickEvent, unitClickEvent, unitAttackEvent, unitMoveEvent, endTurnEvent, exitEvent, selectedUnitId, validMoves, attackTargets, className, }: GameCanvas3DBattleTemplateProps): React.JSX.Element | null;
|
|
78
85
|
export declare namespace GameCanvas3DBattleTemplate {
|
|
79
86
|
var displayName: string;
|
|
80
87
|
}
|
|
@@ -18,8 +18,15 @@
|
|
|
18
18
|
* @packageDocumentation
|
|
19
19
|
*/
|
|
20
20
|
import React from 'react';
|
|
21
|
+
import type { IsometricTile, IsometricUnit, IsometricFeature } from '../organisms/types/isometric';
|
|
21
22
|
import type { TemplateProps } from '../../core/templates/types';
|
|
22
23
|
export interface GameCanvas3DCastleTemplateProps extends TemplateProps {
|
|
24
|
+
/** Fallback tile data when no entity is present */
|
|
25
|
+
tiles?: IsometricTile[];
|
|
26
|
+
/** Fallback unit data when no entity is present */
|
|
27
|
+
units?: IsometricUnit[];
|
|
28
|
+
/** Fallback feature data when no entity is present */
|
|
29
|
+
features?: IsometricFeature[];
|
|
23
30
|
/** 3D camera mode */
|
|
24
31
|
cameraMode?: 'isometric' | 'perspective' | 'top-down';
|
|
25
32
|
/** Show grid helper */
|
|
@@ -66,7 +73,7 @@ export interface GameCanvas3DCastleTemplateProps extends TemplateProps {
|
|
|
66
73
|
* />
|
|
67
74
|
* ```
|
|
68
75
|
*/
|
|
69
|
-
export declare function GameCanvas3DCastleTemplate({ entity, cameraMode, showGrid, shadows, backgroundColor, buildingClickEvent, unitClickEvent, buildEvent, recruitEvent, exitEvent, selectedBuildingId, selectedTileIds, availableBuildSites, showHeader, className, }: GameCanvas3DCastleTemplateProps): React.JSX.Element | null;
|
|
76
|
+
export declare function GameCanvas3DCastleTemplate({ entity, tiles: propTiles, units: propUnits, features: propFeatures, cameraMode, showGrid, shadows, backgroundColor, buildingClickEvent, unitClickEvent, buildEvent, recruitEvent, exitEvent, selectedBuildingId, selectedTileIds, availableBuildSites, showHeader, className, }: GameCanvas3DCastleTemplateProps): React.JSX.Element | null;
|
|
70
77
|
export declare namespace GameCanvas3DCastleTemplate {
|
|
71
78
|
var displayName: string;
|
|
72
79
|
}
|
|
@@ -19,8 +19,15 @@
|
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
|
+
import type { IsometricTile, IsometricUnit, IsometricFeature } from '../organisms/types/isometric';
|
|
22
23
|
import type { TemplateProps } from '../../core/templates/types';
|
|
23
24
|
export interface GameCanvas3DWorldMapTemplateProps extends TemplateProps {
|
|
25
|
+
/** Fallback tile data when no entity is present */
|
|
26
|
+
tiles?: IsometricTile[];
|
|
27
|
+
/** Fallback unit data when no entity is present */
|
|
28
|
+
units?: IsometricUnit[];
|
|
29
|
+
/** Fallback feature data when no entity is present */
|
|
30
|
+
features?: IsometricFeature[];
|
|
24
31
|
/** 3D camera mode */
|
|
25
32
|
cameraMode?: 'isometric' | 'perspective' | 'top-down';
|
|
26
33
|
/** Show grid helper */
|
|
@@ -76,7 +83,7 @@ export interface GameCanvas3DWorldMapTemplateProps extends TemplateProps {
|
|
|
76
83
|
* />
|
|
77
84
|
* ```
|
|
78
85
|
*/
|
|
79
|
-
export declare function GameCanvas3DWorldMapTemplate({ entity, cameraMode, showGrid, showCoordinates, showTileInfo, shadows, backgroundColor, tileClickEvent, unitClickEvent, featureClickEvent, tileHoverEvent, tileLeaveEvent, cameraChangeEvent, selectedUnitId, validMoves, attackTargets, className, }: GameCanvas3DWorldMapTemplateProps): React.JSX.Element | null;
|
|
86
|
+
export declare function GameCanvas3DWorldMapTemplate({ entity, tiles: propTiles, units: propUnits, features: propFeatures, cameraMode, showGrid, showCoordinates, showTileInfo, shadows, backgroundColor, tileClickEvent, unitClickEvent, featureClickEvent, tileHoverEvent, tileLeaveEvent, cameraChangeEvent, selectedUnitId, validMoves, attackTargets, className, }: GameCanvas3DWorldMapTemplateProps): React.JSX.Element | null;
|
|
80
87
|
export declare namespace GameCanvas3DWorldMapTemplate {
|
|
81
88
|
var displayName: string;
|
|
82
89
|
}
|