@crowdedkingdoms/crowdyjs 18.11.0-dev.1 → 18.12.0-dev.1
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/MIGRATION.md +26 -0
- package/README.md +12 -0
- package/dist/generated/graphql-schema.d.ts +2 -2
- package/dist/generated/graphql-schema.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/index.d.ts +9 -0
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +9 -0
- package/dist/kit/kit.d.ts +60 -2
- package/dist/kit/kit.d.ts.map +1 -1
- package/dist/kit/kit.js +58 -2
- package/dist/kit/modules/arenas.d.ts +87 -0
- package/dist/kit/modules/arenas.d.ts.map +1 -0
- package/dist/kit/modules/arenas.js +66 -0
- package/dist/kit/modules/encounters.d.ts +75 -0
- package/dist/kit/modules/encounters.d.ts.map +1 -0
- package/dist/kit/modules/encounters.js +57 -0
- package/dist/kit/modules/instances.d.ts +78 -0
- package/dist/kit/modules/instances.d.ts.map +1 -0
- package/dist/kit/modules/instances.js +72 -0
- package/dist/kit/modules/leaderboards.d.ts +79 -0
- package/dist/kit/modules/leaderboards.d.ts.map +1 -0
- package/dist/kit/modules/leaderboards.js +69 -0
- package/dist/kit/modules/minigames.d.ts +59 -0
- package/dist/kit/modules/minigames.d.ts.map +1 -0
- package/dist/kit/modules/minigames.js +55 -0
- package/dist/kit/modules/racing.d.ts +131 -0
- package/dist/kit/modules/racing.d.ts.map +1 -0
- package/dist/kit/modules/racing.js +113 -0
- package/dist/kit/modules/tables.d.ts +76 -0
- package/dist/kit/modules/tables.d.ts.map +1 -0
- package/dist/kit/modules/tables.js +73 -0
- package/dist/kit/modules/tactics.d.ts +79 -0
- package/dist/kit/modules/tactics.d.ts.map +1 -0
- package/dist/kit/modules/tactics.js +67 -0
- package/dist/kit/modules/territory.d.ts +92 -0
- package/dist/kit/modules/territory.d.ts.map +1 -0
- package/dist/kit/modules/territory.js +84 -0
- package/dist/live-coding/assets/browser-authoring-index.json +1 -1
- package/dist/live-coding/assets/manifest.json +1 -1
- package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
- package/dist/live-coding/browser-authoring-index.generated.js +3302 -145
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
|
|
|
4
4
|
"rustVersion": "1.97.1",
|
|
5
5
|
"sdkVersion": "0.1.0",
|
|
6
6
|
"abiVersion": 0,
|
|
7
|
-
"contentHash": "
|
|
7
|
+
"contentHash": "58bdbf80b074a29748452ec5b5e26eb290f1cae7140f4ad4994c47c76a82a64d",
|
|
8
8
|
"crates": [
|
|
9
9
|
{
|
|
10
10
|
"name": "alloc",
|
|
@@ -13,8 +13,8 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
|
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"name": "ckx-sdk",
|
|
16
|
-
"version": "0.
|
|
17
|
-
"sourceHash": "
|
|
16
|
+
"version": "0.11.0",
|
|
17
|
+
"sourceHash": "eedafccbba1298498d7b2d827e91eeeb219001ef8d4a17cd490c80b2df416022"
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
20
|
"name": "core",
|
|
@@ -1337,6 +1337,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
|
|
|
1337
1337
|
"signature": "pub const RECEIPT_TTL_MS: u64 = 10 * 60 * 1000;",
|
|
1338
1338
|
"docs": "How long a receipt is kept."
|
|
1339
1339
|
},
|
|
1340
|
+
{
|
|
1341
|
+
"module": "ckx_sdk::kit",
|
|
1342
|
+
"name": "RESERVED_FIELDS",
|
|
1343
|
+
"kind": "const",
|
|
1344
|
+
"signature": "pub const RESERVED_FIELDS: [&str; 4] = [\"v\", \"epoch\", \"seq\", \"kind\"];",
|
|
1345
|
+
"docs": "The fields a kit message's header owns; a body may not use them (they sit side by side)."
|
|
1346
|
+
},
|
|
1340
1347
|
{
|
|
1341
1348
|
"module": "ckx_sdk::kit",
|
|
1342
1349
|
"name": "Receipts",
|
|
@@ -1407,6 +1414,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
|
|
|
1407
1414
|
"signature": "pub const SNAPSHOT_METHOD: &str = \"snapshot\";",
|
|
1408
1415
|
"docs": "The method every kit hub answers with a topic's snapshot."
|
|
1409
1416
|
},
|
|
1417
|
+
{
|
|
1418
|
+
"module": "ckx_sdk::kit",
|
|
1419
|
+
"name": "ai",
|
|
1420
|
+
"kind": "module",
|
|
1421
|
+
"signature": "pub mod ai;",
|
|
1422
|
+
"docs": ""
|
|
1423
|
+
},
|
|
1410
1424
|
{
|
|
1411
1425
|
"module": "ckx_sdk::kit",
|
|
1412
1426
|
"name": "args",
|
|
@@ -1414,6 +1428,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
|
|
|
1414
1428
|
"signature": "pub fn args<T: DeserializeOwned>(call: &Call<'_>) -> Result<T>",
|
|
1415
1429
|
"docs": "A call's arguments, refused with [`codes::BAD_REQUEST`] when they do not decode."
|
|
1416
1430
|
},
|
|
1431
|
+
{
|
|
1432
|
+
"module": "ckx_sdk::kit",
|
|
1433
|
+
"name": "args_or_default",
|
|
1434
|
+
"kind": "function",
|
|
1435
|
+
"signature": "pub fn args_or_default<T: DeserializeOwned + Default>(call: &Call<'_>) -> Result<T>",
|
|
1436
|
+
"docs": "A call's arguments when it may send none: an empty payload or a nil (what a client sends for no arguments) is `T::default()`."
|
|
1437
|
+
},
|
|
1417
1438
|
{
|
|
1418
1439
|
"module": "ckx_sdk::kit",
|
|
1419
1440
|
"name": "codes",
|
|
@@ -1440,7 +1461,21 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
|
|
|
1440
1461
|
"name": "message",
|
|
1441
1462
|
"kind": "function",
|
|
1442
1463
|
"signature": "pub fn message<T: Serialize + ?Sized>(ctx: &Ctx, kind: MessageKind, seq: u64, body: &T) -> Result<Vec<u8>>",
|
|
1443
|
-
"docs": "Encodes one kit message from this instance. `body` must serialize as a struct or a map."
|
|
1464
|
+
"docs": "Encodes one kit message from this instance. `body` must serialize as a struct or a map, and none of its fields may be one of [`RESERVED_FIELDS`]: a debug build (`cargo test`) refuses a body that uses one, which would leave a client two `kind`s to choose from."
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
"module": "ckx_sdk::kit",
|
|
1468
|
+
"name": "play",
|
|
1469
|
+
"kind": "module",
|
|
1470
|
+
"signature": "pub mod play;",
|
|
1471
|
+
"docs": ""
|
|
1472
|
+
},
|
|
1473
|
+
{
|
|
1474
|
+
"module": "ckx_sdk::kit",
|
|
1475
|
+
"name": "presence",
|
|
1476
|
+
"kind": "module",
|
|
1477
|
+
"signature": "pub mod presence;",
|
|
1478
|
+
"docs": ""
|
|
1444
1479
|
},
|
|
1445
1480
|
{
|
|
1446
1481
|
"module": "ckx_sdk::kit",
|
|
@@ -1463,6 +1498,13 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
|
|
|
1463
1498
|
"signature": "pub mod shard;",
|
|
1464
1499
|
"docs": ""
|
|
1465
1500
|
},
|
|
1501
|
+
{
|
|
1502
|
+
"module": "ckx_sdk::kit",
|
|
1503
|
+
"name": "sim",
|
|
1504
|
+
"kind": "module",
|
|
1505
|
+
"signature": "pub mod sim;",
|
|
1506
|
+
"docs": ""
|
|
1507
|
+
},
|
|
1466
1508
|
{
|
|
1467
1509
|
"module": "ckx_sdk::kit",
|
|
1468
1510
|
"name": "snapshot_topic",
|
|
@@ -1478,242 +1520,3357 @@ export const GENERATED_BROWSER_AUTHORING_INDEX = {
|
|
|
1478
1520
|
"docs": ""
|
|
1479
1521
|
},
|
|
1480
1522
|
{
|
|
1481
|
-
"module": "ckx_sdk::kit::
|
|
1482
|
-
"name": "
|
|
1483
|
-
"kind": "
|
|
1484
|
-
"signature": "pub
|
|
1485
|
-
"docs": "
|
|
1523
|
+
"module": "ckx_sdk::kit::ai",
|
|
1524
|
+
"name": "brain",
|
|
1525
|
+
"kind": "module",
|
|
1526
|
+
"signature": "pub mod brain;",
|
|
1527
|
+
"docs": ""
|
|
1486
1528
|
},
|
|
1487
1529
|
{
|
|
1488
|
-
"module": "ckx_sdk::kit::
|
|
1489
|
-
"name": "
|
|
1490
|
-
"kind": "
|
|
1491
|
-
"signature": "pub
|
|
1530
|
+
"module": "ckx_sdk::kit::ai",
|
|
1531
|
+
"name": "flow",
|
|
1532
|
+
"kind": "module",
|
|
1533
|
+
"signature": "pub mod flow;",
|
|
1492
1534
|
"docs": ""
|
|
1493
1535
|
},
|
|
1494
1536
|
{
|
|
1495
|
-
"module": "ckx_sdk::kit::
|
|
1496
|
-
"name": "
|
|
1497
|
-
"kind": "
|
|
1498
|
-
"signature": "pub
|
|
1499
|
-
"docs": "
|
|
1537
|
+
"module": "ckx_sdk::kit::ai",
|
|
1538
|
+
"name": "path",
|
|
1539
|
+
"kind": "module",
|
|
1540
|
+
"signature": "pub mod path;",
|
|
1541
|
+
"docs": ""
|
|
1500
1542
|
},
|
|
1501
1543
|
{
|
|
1502
|
-
"module": "ckx_sdk::kit::
|
|
1503
|
-
"name": "
|
|
1504
|
-
"kind": "
|
|
1505
|
-
"signature": "pub
|
|
1506
|
-
"docs": "
|
|
1544
|
+
"module": "ckx_sdk::kit::ai",
|
|
1545
|
+
"name": "steering",
|
|
1546
|
+
"kind": "module",
|
|
1547
|
+
"signature": "pub mod steering;",
|
|
1548
|
+
"docs": ""
|
|
1507
1549
|
},
|
|
1508
1550
|
{
|
|
1509
|
-
"module": "ckx_sdk::kit::
|
|
1510
|
-
"name": "
|
|
1511
|
-
"kind": "
|
|
1512
|
-
"signature": "pub
|
|
1551
|
+
"module": "ckx_sdk::kit::ai",
|
|
1552
|
+
"name": "turn",
|
|
1553
|
+
"kind": "module",
|
|
1554
|
+
"signature": "pub mod turn;",
|
|
1513
1555
|
"docs": ""
|
|
1514
1556
|
},
|
|
1515
1557
|
{
|
|
1516
|
-
"module": "ckx_sdk::kit::
|
|
1517
|
-
"name": "
|
|
1518
|
-
"kind": "
|
|
1519
|
-
"signature": "pub
|
|
1558
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1559
|
+
"name": "AgentMemory",
|
|
1560
|
+
"kind": "struct",
|
|
1561
|
+
"signature": "pub struct AgentMemory { pub target: Option<(f32, f32)>, pub retarget_at_ms: u64, pub patrol_index: usize, pub pause_until_ms: u64, }",
|
|
1562
|
+
"docs": "Per-agent mutable memory the tree reads/writes across ticks (serde-able into the hub's state)."
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1566
|
+
"name": "AgentMemory::patrol_index",
|
|
1567
|
+
"kind": "field",
|
|
1568
|
+
"signature": "pub patrol_index: usize",
|
|
1520
1569
|
"docs": ""
|
|
1521
1570
|
},
|
|
1522
1571
|
{
|
|
1523
|
-
"module": "ckx_sdk::kit::
|
|
1524
|
-
"name": "
|
|
1525
|
-
"kind": "
|
|
1526
|
-
"signature": "pub
|
|
1572
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1573
|
+
"name": "AgentMemory::pause_until_ms",
|
|
1574
|
+
"kind": "field",
|
|
1575
|
+
"signature": "pub pause_until_ms: u64",
|
|
1527
1576
|
"docs": ""
|
|
1528
1577
|
},
|
|
1529
1578
|
{
|
|
1530
|
-
"module": "ckx_sdk::kit::
|
|
1531
|
-
"name": "
|
|
1532
|
-
"kind": "
|
|
1533
|
-
"signature": "pub
|
|
1534
|
-
"docs": "
|
|
1579
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1580
|
+
"name": "AgentMemory::retarget_at_ms",
|
|
1581
|
+
"kind": "field",
|
|
1582
|
+
"signature": "pub retarget_at_ms: u64",
|
|
1583
|
+
"docs": ""
|
|
1535
1584
|
},
|
|
1536
1585
|
{
|
|
1537
|
-
"module": "ckx_sdk::kit::
|
|
1538
|
-
"name": "
|
|
1539
|
-
"kind": "
|
|
1540
|
-
"signature": "pub
|
|
1586
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1587
|
+
"name": "AgentMemory::target",
|
|
1588
|
+
"kind": "field",
|
|
1589
|
+
"signature": "pub target: Option<(f32, f32)>",
|
|
1541
1590
|
"docs": ""
|
|
1542
1591
|
},
|
|
1543
1592
|
{
|
|
1544
|
-
"module": "ckx_sdk::kit::
|
|
1545
|
-
"name": "
|
|
1546
|
-
"kind": "
|
|
1547
|
-
"signature": "pub
|
|
1548
|
-
"docs": "
|
|
1593
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1594
|
+
"name": "Decision",
|
|
1595
|
+
"kind": "enum",
|
|
1596
|
+
"signature": "pub enum Decision { Idle, /// Move by this bounded step. Step(Vec2), /// Nothing matched / tree invalid — caller may fall back. None, }",
|
|
1597
|
+
"docs": "What the agent decided to do this tick."
|
|
1549
1598
|
},
|
|
1550
1599
|
{
|
|
1551
|
-
"module": "ckx_sdk::kit::
|
|
1552
|
-
"name": "
|
|
1553
|
-
"kind": "
|
|
1554
|
-
"signature": "
|
|
1555
|
-
"docs": "
|
|
1600
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1601
|
+
"name": "Decision::Idle",
|
|
1602
|
+
"kind": "variant",
|
|
1603
|
+
"signature": "Idle",
|
|
1604
|
+
"docs": ""
|
|
1556
1605
|
},
|
|
1557
1606
|
{
|
|
1558
|
-
"module": "ckx_sdk::kit::
|
|
1559
|
-
"name": "
|
|
1560
|
-
"kind": "
|
|
1561
|
-
"signature": "
|
|
1607
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1608
|
+
"name": "Decision::None",
|
|
1609
|
+
"kind": "variant",
|
|
1610
|
+
"signature": "None",
|
|
1611
|
+
"docs": "Nothing matched / tree invalid — caller may fall back."
|
|
1612
|
+
},
|
|
1613
|
+
{
|
|
1614
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1615
|
+
"name": "Decision::Step",
|
|
1616
|
+
"kind": "variant",
|
|
1617
|
+
"signature": "Step(Vec2)",
|
|
1618
|
+
"docs": "Move by this bounded step."
|
|
1619
|
+
},
|
|
1620
|
+
{
|
|
1621
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1622
|
+
"name": "Perception",
|
|
1623
|
+
"kind": "struct",
|
|
1624
|
+
"signature": "pub struct Perception { pub pos: Vec2, pub home: Vec2, /// Nearest player position, when one is visible. pub nearest_player: Option<Vec2>, /// Owner position (pets), when known. pub owner: Option<Vec2>, pub is_night: bool, pub speed: f32, pub dt: f32, pub now_ms: u64, /// Two uniform rolls in [0,1) for this tick (from the hub's seeded RNG). pub roll: (f32, f32), /// World half-extent for wander clamping. pub bounds: f32, }",
|
|
1625
|
+
"docs": "Everything a tree evaluation may look at (the hub fills this in)."
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1629
|
+
"name": "Perception::bounds",
|
|
1630
|
+
"kind": "field",
|
|
1631
|
+
"signature": "pub bounds: f32",
|
|
1632
|
+
"docs": "World half-extent for wander clamping."
|
|
1633
|
+
},
|
|
1634
|
+
{
|
|
1635
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1636
|
+
"name": "Perception::dt",
|
|
1637
|
+
"kind": "field",
|
|
1638
|
+
"signature": "pub dt: f32",
|
|
1562
1639
|
"docs": ""
|
|
1563
1640
|
},
|
|
1564
1641
|
{
|
|
1565
|
-
"module": "ckx_sdk::kit::
|
|
1566
|
-
"name": "
|
|
1567
|
-
"kind": "
|
|
1568
|
-
"signature": "pub
|
|
1569
|
-
"docs": "
|
|
1642
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1643
|
+
"name": "Perception::home",
|
|
1644
|
+
"kind": "field",
|
|
1645
|
+
"signature": "pub home: Vec2",
|
|
1646
|
+
"docs": ""
|
|
1570
1647
|
},
|
|
1571
1648
|
{
|
|
1572
|
-
"module": "ckx_sdk::kit::
|
|
1573
|
-
"name": "
|
|
1574
|
-
"kind": "
|
|
1575
|
-
"signature": "pub
|
|
1649
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1650
|
+
"name": "Perception::is_night",
|
|
1651
|
+
"kind": "field",
|
|
1652
|
+
"signature": "pub is_night: bool",
|
|
1576
1653
|
"docs": ""
|
|
1577
1654
|
},
|
|
1578
1655
|
{
|
|
1579
|
-
"module": "ckx_sdk::kit::
|
|
1580
|
-
"name": "
|
|
1581
|
-
"kind": "
|
|
1582
|
-
"signature": "pub
|
|
1656
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1657
|
+
"name": "Perception::nearest_player",
|
|
1658
|
+
"kind": "field",
|
|
1659
|
+
"signature": "pub nearest_player: Option<Vec2>",
|
|
1660
|
+
"docs": "Nearest player position, when one is visible."
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1664
|
+
"name": "Perception::now_ms",
|
|
1665
|
+
"kind": "field",
|
|
1666
|
+
"signature": "pub now_ms: u64",
|
|
1583
1667
|
"docs": ""
|
|
1584
1668
|
},
|
|
1585
1669
|
{
|
|
1586
|
-
"module": "ckx_sdk::kit::
|
|
1587
|
-
"name": "
|
|
1588
|
-
"kind": "
|
|
1589
|
-
"signature": "pub
|
|
1670
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1671
|
+
"name": "Perception::owner",
|
|
1672
|
+
"kind": "field",
|
|
1673
|
+
"signature": "pub owner: Option<Vec2>",
|
|
1674
|
+
"docs": "Owner position (pets), when known."
|
|
1675
|
+
},
|
|
1676
|
+
{
|
|
1677
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1678
|
+
"name": "Perception::pos",
|
|
1679
|
+
"kind": "field",
|
|
1680
|
+
"signature": "pub pos: Vec2",
|
|
1590
1681
|
"docs": ""
|
|
1591
1682
|
},
|
|
1592
1683
|
{
|
|
1593
|
-
"module": "ckx_sdk::kit::
|
|
1594
|
-
"name": "
|
|
1595
|
-
"kind": "
|
|
1596
|
-
"signature": "pub
|
|
1684
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1685
|
+
"name": "Perception::roll",
|
|
1686
|
+
"kind": "field",
|
|
1687
|
+
"signature": "pub roll: (f32, f32)",
|
|
1688
|
+
"docs": "Two uniform rolls in [0,1) for this tick (from the hub's seeded RNG)."
|
|
1689
|
+
},
|
|
1690
|
+
{
|
|
1691
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1692
|
+
"name": "Perception::speed",
|
|
1693
|
+
"kind": "field",
|
|
1694
|
+
"signature": "pub speed: f32",
|
|
1597
1695
|
"docs": ""
|
|
1598
1696
|
},
|
|
1599
1697
|
{
|
|
1600
|
-
"module": "ckx_sdk::kit::
|
|
1601
|
-
"name": "
|
|
1602
|
-
"kind": "
|
|
1603
|
-
"signature": "pub
|
|
1698
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1699
|
+
"name": "builtin_tree",
|
|
1700
|
+
"kind": "function",
|
|
1701
|
+
"signature": "pub fn builtin_tree(name: &str) -> Option<Value>",
|
|
1702
|
+
"docs": "Canonical trees for the built-in behavior names a game's agent definitions use (`wander_passive`, `wander_hostile`, `chase_hostile`)."
|
|
1703
|
+
},
|
|
1704
|
+
{
|
|
1705
|
+
"module": "ckx_sdk::kit::ai::brain",
|
|
1706
|
+
"name": "evaluate",
|
|
1707
|
+
"kind": "function",
|
|
1708
|
+
"signature": "pub fn evaluate(tree: &Value, p: &Perception, memory: &mut AgentMemory) -> Decision",
|
|
1604
1709
|
"docs": ""
|
|
1605
1710
|
},
|
|
1606
1711
|
{
|
|
1607
|
-
"module": "ckx_sdk::kit::
|
|
1608
|
-
"name": "
|
|
1712
|
+
"module": "ckx_sdk::kit::ai::flow",
|
|
1713
|
+
"name": "FlowField",
|
|
1609
1714
|
"kind": "struct",
|
|
1610
|
-
"signature": "pub struct
|
|
1611
|
-
"docs": ""
|
|
1715
|
+
"signature": "pub struct FlowField { pub min_x: i32, pub min_z: i32, pub width: i32, pub height: i32, /// Distance to the nearest goal per cell; u32::MAX = unreachable/blocked. distances: Vec<u32>, }",
|
|
1716
|
+
"docs": "A baked distance field over a bounded grid window. Serde-able so hubs can persist it, but rebuilding from the provider is usually cheaper than storing it durably."
|
|
1612
1717
|
},
|
|
1613
1718
|
{
|
|
1614
|
-
"module": "ckx_sdk::kit::
|
|
1615
|
-
"name": "
|
|
1719
|
+
"module": "ckx_sdk::kit::ai::flow",
|
|
1720
|
+
"name": "FlowField::build",
|
|
1616
1721
|
"kind": "method",
|
|
1617
|
-
"signature": "pub fn
|
|
1618
|
-
"docs": "
|
|
1722
|
+
"signature": "pub fn build( provider: &impl CostProvider, window: (i32, i32, i32, i32), // min_x, min_z, width, height goals: &[(i32, i32)], max_cells: usize, ) -> Self",
|
|
1723
|
+
"docs": "Build the field inside the window from the goal cells outward, respecting the provider's blocked cells. Cost = uniform 1 per step (weighted providers still gate walkability; weighting the descent is deliberately v2). `max_cells` caps the BFS for fuel safety."
|
|
1619
1724
|
},
|
|
1620
1725
|
{
|
|
1621
|
-
"module": "ckx_sdk::kit::
|
|
1622
|
-
"name": "
|
|
1726
|
+
"module": "ckx_sdk::kit::ai::flow",
|
|
1727
|
+
"name": "FlowField::distance",
|
|
1623
1728
|
"kind": "method",
|
|
1624
|
-
"signature": "pub fn
|
|
1625
|
-
"docs": "
|
|
1729
|
+
"signature": "pub fn distance(&self, x: i32, z: i32) -> Option<u32>",
|
|
1730
|
+
"docs": "Distance to the nearest goal (None outside the window or unreachable)."
|
|
1626
1731
|
},
|
|
1627
1732
|
{
|
|
1628
|
-
"module": "ckx_sdk::kit::
|
|
1629
|
-
"name": "
|
|
1630
|
-
"kind": "
|
|
1631
|
-
"signature": "
|
|
1733
|
+
"module": "ckx_sdk::kit::ai::flow",
|
|
1734
|
+
"name": "FlowField::height",
|
|
1735
|
+
"kind": "field",
|
|
1736
|
+
"signature": "pub height: i32",
|
|
1632
1737
|
"docs": ""
|
|
1633
1738
|
},
|
|
1634
1739
|
{
|
|
1635
|
-
"module": "ckx_sdk::kit::
|
|
1636
|
-
"name": "
|
|
1740
|
+
"module": "ckx_sdk::kit::ai::flow",
|
|
1741
|
+
"name": "FlowField::min_x",
|
|
1742
|
+
"kind": "field",
|
|
1743
|
+
"signature": "pub min_x: i32",
|
|
1744
|
+
"docs": ""
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
"module": "ckx_sdk::kit::ai::flow",
|
|
1748
|
+
"name": "FlowField::min_z",
|
|
1749
|
+
"kind": "field",
|
|
1750
|
+
"signature": "pub min_z: i32",
|
|
1751
|
+
"docs": ""
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
"module": "ckx_sdk::kit::ai::flow",
|
|
1755
|
+
"name": "FlowField::step",
|
|
1637
1756
|
"kind": "method",
|
|
1638
|
-
"signature": "pub fn
|
|
1639
|
-
"docs": "
|
|
1757
|
+
"signature": "pub fn step(&self, x: i32, z: i32) -> Option<(i32, i32)>",
|
|
1758
|
+
"docs": "The descending step from (x, z): the 4-neighbor with the smallest distance, when strictly smaller than here. None at goals/unreachable."
|
|
1640
1759
|
},
|
|
1641
1760
|
{
|
|
1642
|
-
"module": "ckx_sdk::kit::
|
|
1643
|
-
"name": "
|
|
1761
|
+
"module": "ckx_sdk::kit::ai::flow",
|
|
1762
|
+
"name": "FlowField::walk",
|
|
1644
1763
|
"kind": "method",
|
|
1645
|
-
"signature": "pub fn
|
|
1764
|
+
"signature": "pub fn walk(&self, mut x: i32, mut z: i32, max_steps: usize) -> Vec<(i32, i32)>",
|
|
1765
|
+
"docs": "Follow the field from (x, z) for up to `max_steps`, returning the walked cells (excluding the start). Agents usually take 1 per tick; this helper powers tests and catch-up moves."
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
"module": "ckx_sdk::kit::ai::flow",
|
|
1769
|
+
"name": "FlowField::width",
|
|
1770
|
+
"kind": "field",
|
|
1771
|
+
"signature": "pub width: i32",
|
|
1646
1772
|
"docs": ""
|
|
1647
1773
|
},
|
|
1648
1774
|
{
|
|
1649
|
-
"module": "ckx_sdk::kit::
|
|
1650
|
-
"name": "
|
|
1775
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1776
|
+
"name": "CostProvider",
|
|
1777
|
+
"kind": "trait",
|
|
1778
|
+
"signature": "pub trait CostProvider",
|
|
1779
|
+
"docs": "Walkability/cost source. Implement over your world representation (obstacle grids, voxel columns, nav data in a hub's state)."
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1783
|
+
"name": "CostProvider::cost",
|
|
1651
1784
|
"kind": "method",
|
|
1652
|
-
"signature": "
|
|
1785
|
+
"signature": "fn cost(&self, x: i32, z: i32) -> Option<u32>;",
|
|
1786
|
+
"docs": "Cost to ENTER (x, z); `None` = blocked. Uniform worlds return Some(1)."
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1790
|
+
"name": "GridProvider",
|
|
1791
|
+
"kind": "struct",
|
|
1792
|
+
"signature": "pub struct GridProvider<'a> { pub width: i32, pub height: i32, pub blocked: &'a dyn Fn(i32, i32) -> bool, }",
|
|
1793
|
+
"docs": "A grid of booleans (true = blocked) — the simplest provider, also the test fixture."
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1797
|
+
"name": "GridProvider::blocked",
|
|
1798
|
+
"kind": "field",
|
|
1799
|
+
"signature": "pub blocked: &'a dyn Fn(i32, i32) -> bool",
|
|
1653
1800
|
"docs": ""
|
|
1654
1801
|
},
|
|
1655
1802
|
{
|
|
1656
|
-
"module": "ckx_sdk::kit::
|
|
1657
|
-
"name": "
|
|
1803
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1804
|
+
"name": "GridProvider::cost",
|
|
1658
1805
|
"kind": "method",
|
|
1659
|
-
"signature": "
|
|
1660
|
-
"docs": "
|
|
1806
|
+
"signature": "fn cost(&self, x: i32, z: i32) -> Option<u32>",
|
|
1807
|
+
"docs": ""
|
|
1661
1808
|
},
|
|
1662
1809
|
{
|
|
1663
|
-
"module": "ckx_sdk::kit::
|
|
1664
|
-
"name": "
|
|
1810
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1811
|
+
"name": "GridProvider::height",
|
|
1812
|
+
"kind": "field",
|
|
1813
|
+
"signature": "pub height: i32",
|
|
1814
|
+
"docs": ""
|
|
1815
|
+
},
|
|
1816
|
+
{
|
|
1817
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1818
|
+
"name": "GridProvider::width",
|
|
1819
|
+
"kind": "field",
|
|
1820
|
+
"signature": "pub width: i32",
|
|
1821
|
+
"docs": ""
|
|
1822
|
+
},
|
|
1823
|
+
{
|
|
1824
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1825
|
+
"name": "PathCache",
|
|
1826
|
+
"kind": "struct",
|
|
1827
|
+
"signature": "pub struct PathCache { generation: u64, entries: std::collections::BTreeMap<Route, (u64, Vec<(i32, i32)>)>, }",
|
|
1828
|
+
"docs": "A generation-keyed path cache: repeated queries between the same cells reuse the stored path until the world changes (`invalidate()` on any voxel/tower edit bumps the generation and lazily discards entries)."
|
|
1829
|
+
},
|
|
1830
|
+
{
|
|
1831
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1832
|
+
"name": "PathCache::get",
|
|
1665
1833
|
"kind": "method",
|
|
1666
|
-
"signature": "pub fn
|
|
1667
|
-
"docs": "
|
|
1834
|
+
"signature": "pub fn get(&mut self, provider: &impl CostProvider, from: (i32, i32), to: (i32, i32), config: &PathConfig) -> Vec<(i32, i32)>",
|
|
1835
|
+
"docs": "Cached path or compute-and-store via [`a_star`]."
|
|
1668
1836
|
},
|
|
1669
1837
|
{
|
|
1670
|
-
"module": "ckx_sdk::kit::
|
|
1671
|
-
"name": "
|
|
1838
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1839
|
+
"name": "PathCache::invalidate",
|
|
1672
1840
|
"kind": "method",
|
|
1673
|
-
"signature": "pub fn
|
|
1674
|
-
"docs": "
|
|
1841
|
+
"signature": "pub fn invalidate(&mut self)",
|
|
1842
|
+
"docs": "Drop every cached path (world changed)."
|
|
1675
1843
|
},
|
|
1676
1844
|
{
|
|
1677
|
-
"module": "ckx_sdk::kit::
|
|
1678
|
-
"name": "
|
|
1845
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1846
|
+
"name": "PathCache::new",
|
|
1679
1847
|
"kind": "method",
|
|
1680
|
-
"signature": "pub fn
|
|
1681
|
-
"docs": "
|
|
1848
|
+
"signature": "pub fn new() -> Self",
|
|
1849
|
+
"docs": ""
|
|
1682
1850
|
},
|
|
1683
1851
|
{
|
|
1684
|
-
"module": "ckx_sdk::kit::
|
|
1685
|
-
"name": "
|
|
1852
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1853
|
+
"name": "PathConfig",
|
|
1854
|
+
"kind": "struct",
|
|
1855
|
+
"signature": "pub struct PathConfig { /// Max nodes expanded before giving up (the fuel guard). ~4x the /// manhattan distance is plenty for sane worlds. pub max_expanded: usize, }",
|
|
1856
|
+
"docs": ""
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1860
|
+
"name": "PathConfig::default",
|
|
1686
1861
|
"kind": "method",
|
|
1687
|
-
"signature": "
|
|
1688
|
-
"docs": "
|
|
1862
|
+
"signature": "fn default() -> Self",
|
|
1863
|
+
"docs": ""
|
|
1689
1864
|
},
|
|
1690
1865
|
{
|
|
1691
|
-
"module": "ckx_sdk::kit::
|
|
1692
|
-
"name": "
|
|
1693
|
-
"kind": "
|
|
1694
|
-
"signature": "pub
|
|
1695
|
-
"docs": "
|
|
1866
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1867
|
+
"name": "PathConfig::max_expanded",
|
|
1868
|
+
"kind": "field",
|
|
1869
|
+
"signature": "pub max_expanded: usize",
|
|
1870
|
+
"docs": "Max nodes expanded before giving up (the fuel guard). ~4x the manhattan distance is plenty for sane worlds."
|
|
1696
1871
|
},
|
|
1697
1872
|
{
|
|
1698
|
-
"module": "ckx_sdk::kit::
|
|
1699
|
-
"name": "
|
|
1873
|
+
"module": "ckx_sdk::kit::ai::path",
|
|
1874
|
+
"name": "a_star",
|
|
1700
1875
|
"kind": "function",
|
|
1701
|
-
"signature": "pub fn
|
|
1702
|
-
"docs": "
|
|
1876
|
+
"signature": "pub fn a_star(provider: &impl CostProvider, from: (i32, i32), to: (i32, i32), config: &PathConfig) -> Vec<(i32, i32)>",
|
|
1877
|
+
"docs": "4-connected A*. Returns the path INCLUDING both endpoints, or empty when unreachable / budget-exhausted / endpoints blocked."
|
|
1703
1878
|
},
|
|
1704
1879
|
{
|
|
1705
|
-
"module": "ckx_sdk::kit::
|
|
1880
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1881
|
+
"name": "Vec2",
|
|
1882
|
+
"kind": "struct",
|
|
1883
|
+
"signature": "pub struct Vec2 { pub x: f32, pub z: f32, }",
|
|
1884
|
+
"docs": ""
|
|
1885
|
+
},
|
|
1886
|
+
{
|
|
1887
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1888
|
+
"name": "Vec2::clamped",
|
|
1889
|
+
"kind": "method",
|
|
1890
|
+
"signature": "pub fn clamped(self, max: f32) -> Vec2",
|
|
1891
|
+
"docs": "Clamp this displacement to at most `max` length."
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1895
|
+
"name": "Vec2::dist",
|
|
1896
|
+
"kind": "method",
|
|
1897
|
+
"signature": "pub fn dist(&self, other: Vec2) -> f32",
|
|
1898
|
+
"docs": ""
|
|
1899
|
+
},
|
|
1900
|
+
{
|
|
1901
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1902
|
+
"name": "Vec2::len",
|
|
1903
|
+
"kind": "method",
|
|
1904
|
+
"signature": "pub fn len(&self) -> f32",
|
|
1905
|
+
"docs": ""
|
|
1906
|
+
},
|
|
1907
|
+
{
|
|
1908
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1909
|
+
"name": "Vec2::new",
|
|
1910
|
+
"kind": "method",
|
|
1911
|
+
"signature": "pub fn new(x: f32, z: f32) -> Self",
|
|
1912
|
+
"docs": ""
|
|
1913
|
+
},
|
|
1914
|
+
{
|
|
1915
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1916
|
+
"name": "Vec2::to",
|
|
1917
|
+
"kind": "method",
|
|
1918
|
+
"signature": "pub fn to(self, other: Vec2) -> Vec2",
|
|
1919
|
+
"docs": ""
|
|
1920
|
+
},
|
|
1921
|
+
{
|
|
1922
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1923
|
+
"name": "Vec2::x",
|
|
1924
|
+
"kind": "field",
|
|
1925
|
+
"signature": "pub x: f32",
|
|
1926
|
+
"docs": ""
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1930
|
+
"name": "Vec2::yaw",
|
|
1931
|
+
"kind": "method",
|
|
1932
|
+
"signature": "pub fn yaw(&self) -> f32",
|
|
1933
|
+
"docs": ""
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1937
|
+
"name": "Vec2::z",
|
|
1938
|
+
"kind": "field",
|
|
1939
|
+
"signature": "pub z: f32",
|
|
1940
|
+
"docs": ""
|
|
1941
|
+
},
|
|
1942
|
+
{
|
|
1943
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1944
|
+
"name": "arrive",
|
|
1945
|
+
"kind": "function",
|
|
1946
|
+
"signature": "pub fn arrive(pos: Vec2, target: Vec2, speed: f32, dt: f32, slow_radius: f32) -> Vec2",
|
|
1947
|
+
"docs": "Seek that decelerates inside `slow_radius` (smooth stops)."
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1951
|
+
"name": "flee",
|
|
1952
|
+
"kind": "function",
|
|
1953
|
+
"signature": "pub fn flee(pos: Vec2, threat: Vec2, speed: f32, dt: f32) -> Vec2",
|
|
1954
|
+
"docs": "Step directly away from `threat`."
|
|
1955
|
+
},
|
|
1956
|
+
{
|
|
1957
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1958
|
+
"name": "leash",
|
|
1959
|
+
"kind": "function",
|
|
1960
|
+
"signature": "pub fn leash(pos: Vec2, home: Vec2, leash_radius: f32, speed: f32, dt: f32) -> Option<Vec2>",
|
|
1961
|
+
"docs": "Return-home pull when beyond `leash_radius`; `None` inside the leash."
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1965
|
+
"name": "seek",
|
|
1966
|
+
"kind": "function",
|
|
1967
|
+
"signature": "pub fn seek(pos: Vec2, target: Vec2, speed: f32, dt: f32, stop_at: f32) -> Vec2",
|
|
1968
|
+
"docs": "Step toward `target` at up to `speed*dt`, stopping within `stop_at`."
|
|
1969
|
+
},
|
|
1970
|
+
{
|
|
1971
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1972
|
+
"name": "separate",
|
|
1973
|
+
"kind": "function",
|
|
1974
|
+
"signature": "pub fn separate(pos: Vec2, neighbors: &[Vec2], min_dist: f32, speed: f32, dt: f32) -> Vec2",
|
|
1975
|
+
"docs": "Push away from any neighbor closer than `min_dist` (crowd separation)."
|
|
1976
|
+
},
|
|
1977
|
+
{
|
|
1978
|
+
"module": "ckx_sdk::kit::ai::steering",
|
|
1979
|
+
"name": "wander_target",
|
|
1980
|
+
"kind": "function",
|
|
1981
|
+
"signature": "pub fn wander_target(anchor: Vec2, range: f32, roll_x: f32, roll_z: f32, bounds: f32) -> Vec2",
|
|
1982
|
+
"docs": "A wander target picker: a point within `range` of `anchor`, clamped to `bounds` (half-extent box around origin). Pure — feed it your RNG rolls."
|
|
1983
|
+
},
|
|
1984
|
+
{
|
|
1985
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
1986
|
+
"name": "Candidate",
|
|
1987
|
+
"kind": "struct",
|
|
1988
|
+
"signature": "pub struct Candidate { pub x: i32, pub z: i32, /// Movement cost spent to reach it. pub cost: u32, }",
|
|
1989
|
+
"docs": "One candidate destination for a turn move."
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
1993
|
+
"name": "Candidate::cost",
|
|
1994
|
+
"kind": "field",
|
|
1995
|
+
"signature": "pub cost: u32",
|
|
1996
|
+
"docs": "Movement cost spent to reach it."
|
|
1997
|
+
},
|
|
1998
|
+
{
|
|
1999
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
2000
|
+
"name": "Candidate::x",
|
|
2001
|
+
"kind": "field",
|
|
2002
|
+
"signature": "pub x: i32",
|
|
2003
|
+
"docs": ""
|
|
2004
|
+
},
|
|
2005
|
+
{
|
|
2006
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
2007
|
+
"name": "Candidate::z",
|
|
2008
|
+
"kind": "field",
|
|
2009
|
+
"signature": "pub z: i32",
|
|
2010
|
+
"docs": ""
|
|
2011
|
+
},
|
|
2012
|
+
{
|
|
2013
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
2014
|
+
"name": "TurnMove",
|
|
2015
|
+
"kind": "struct",
|
|
2016
|
+
"signature": "pub struct TurnMove { pub to: (i32, i32), pub score: f32, }",
|
|
2017
|
+
"docs": "The chosen move for a turn."
|
|
2018
|
+
},
|
|
2019
|
+
{
|
|
2020
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
2021
|
+
"name": "TurnMove::score",
|
|
2022
|
+
"kind": "field",
|
|
2023
|
+
"signature": "pub score: f32",
|
|
2024
|
+
"docs": ""
|
|
2025
|
+
},
|
|
2026
|
+
{
|
|
2027
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
2028
|
+
"name": "TurnMove::to",
|
|
2029
|
+
"kind": "field",
|
|
2030
|
+
"signature": "pub to: (i32, i32)",
|
|
2031
|
+
"docs": ""
|
|
2032
|
+
},
|
|
2033
|
+
{
|
|
2034
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
2035
|
+
"name": "approach_scorer",
|
|
2036
|
+
"kind": "function",
|
|
2037
|
+
"signature": "pub fn approach_scorer(targets: Vec<(i32, i32)>) -> impl FnMut(&Candidate) -> f32",
|
|
2038
|
+
"docs": "The classic melee-enemy heuristic: get adjacent to the closest target, preferring cells that minimize distance to ANY target. Returns a score function for [`best_move`]."
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
2042
|
+
"name": "best_move",
|
|
2043
|
+
"kind": "function",
|
|
2044
|
+
"signature": "pub fn best_move( provider: &impl CostProvider, from: (i32, i32), move_points: u32, max_expanded: usize, mut score: impl FnMut(&Candidate) -> f32, ) -> Option<TurnMove>",
|
|
2045
|
+
"docs": "Pick the best reachable cell under `move_points` by `score` (higher wins; ties prefer cheaper movement, then stable coordinate order). Returns None only when even standing still is impossible (blocked origin)."
|
|
2046
|
+
},
|
|
2047
|
+
{
|
|
2048
|
+
"module": "ckx_sdk::kit::ai::turn",
|
|
2049
|
+
"name": "reachable",
|
|
2050
|
+
"kind": "function",
|
|
2051
|
+
"signature": "pub fn reachable(provider: &impl CostProvider, from: (i32, i32), move_points: u32, max_expanded: usize) -> Vec<Candidate>",
|
|
2052
|
+
"docs": "Enumerate the cells reachable from `from` with at most `move_points` total entry cost (BFS/Dijkstra-lite over the provider, 4-connected), including standing still. Expansion stops at `max_expanded` cells."
|
|
2053
|
+
},
|
|
2054
|
+
{
|
|
2055
|
+
"module": "ckx_sdk::kit::codes",
|
|
2056
|
+
"name": "ALREADY_DONE",
|
|
2057
|
+
"kind": "const",
|
|
2058
|
+
"signature": "pub const ALREADY_DONE: &str = \"already_done\";",
|
|
2059
|
+
"docs": "The action already ran; its reply was too large to keep ([`super::RECEIPT_REPLY_MAX`])."
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
"module": "ckx_sdk::kit::codes",
|
|
2063
|
+
"name": "BAD_REQUEST",
|
|
2064
|
+
"kind": "const",
|
|
2065
|
+
"signature": "pub const BAD_REQUEST: &str = \"bad_request\";",
|
|
2066
|
+
"docs": ""
|
|
2067
|
+
},
|
|
2068
|
+
{
|
|
2069
|
+
"module": "ckx_sdk::kit::codes",
|
|
2070
|
+
"name": "CONFLICT",
|
|
2071
|
+
"kind": "const",
|
|
2072
|
+
"signature": "pub const CONFLICT: &str = \"conflict\";",
|
|
2073
|
+
"docs": "The state does not allow it now."
|
|
2074
|
+
},
|
|
2075
|
+
{
|
|
2076
|
+
"module": "ckx_sdk::kit::codes",
|
|
2077
|
+
"name": "COOLDOWN",
|
|
2078
|
+
"kind": "const",
|
|
2079
|
+
"signature": "pub const COOLDOWN: &str = \"cooldown\";",
|
|
2080
|
+
"docs": "Too soon after the last time."
|
|
2081
|
+
},
|
|
2082
|
+
{
|
|
2083
|
+
"module": "ckx_sdk::kit::codes",
|
|
2084
|
+
"name": "EMPTY",
|
|
2085
|
+
"kind": "const",
|
|
2086
|
+
"signature": "pub const EMPTY: &str = \"empty\";",
|
|
2087
|
+
"docs": ""
|
|
2088
|
+
},
|
|
2089
|
+
{
|
|
2090
|
+
"module": "ckx_sdk::kit::codes",
|
|
2091
|
+
"name": "EXPIRED",
|
|
2092
|
+
"kind": "const",
|
|
2093
|
+
"signature": "pub const EXPIRED: &str = \"expired\";",
|
|
2094
|
+
"docs": ""
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
"module": "ckx_sdk::kit::codes",
|
|
2098
|
+
"name": "FINISHED",
|
|
2099
|
+
"kind": "const",
|
|
2100
|
+
"signature": "pub const FINISHED: &str = \"finished\";",
|
|
2101
|
+
"docs": ""
|
|
2102
|
+
},
|
|
2103
|
+
{
|
|
2104
|
+
"module": "ckx_sdk::kit::codes",
|
|
2105
|
+
"name": "FORBIDDEN",
|
|
2106
|
+
"kind": "const",
|
|
2107
|
+
"signature": "pub const FORBIDDEN: &str = \"forbidden\";",
|
|
2108
|
+
"docs": "The caller may not do this."
|
|
2109
|
+
},
|
|
2110
|
+
{
|
|
2111
|
+
"module": "ckx_sdk::kit::codes",
|
|
2112
|
+
"name": "FULL",
|
|
2113
|
+
"kind": "const",
|
|
2114
|
+
"signature": "pub const FULL: &str = \"full\";",
|
|
2115
|
+
"docs": ""
|
|
2116
|
+
},
|
|
2117
|
+
{
|
|
2118
|
+
"module": "ckx_sdk::kit::codes",
|
|
2119
|
+
"name": "INSUFFICIENT",
|
|
2120
|
+
"kind": "const",
|
|
2121
|
+
"signature": "pub const INSUFFICIENT: &str = \"insufficient\";",
|
|
2122
|
+
"docs": "Not enough of something the caller spends."
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
"module": "ckx_sdk::kit::codes",
|
|
2126
|
+
"name": "LIMIT",
|
|
2127
|
+
"kind": "const",
|
|
2128
|
+
"signature": "pub const LIMIT: &str = \"limit\";",
|
|
2129
|
+
"docs": "A bound the hub keeps (how many, how large)."
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
"module": "ckx_sdk::kit::codes",
|
|
2133
|
+
"name": "NOT_FOUND",
|
|
2134
|
+
"kind": "const",
|
|
2135
|
+
"signature": "pub const NOT_FOUND: &str = \"not_found\";",
|
|
2136
|
+
"docs": ""
|
|
2137
|
+
},
|
|
2138
|
+
{
|
|
2139
|
+
"module": "ckx_sdk::kit::codes",
|
|
2140
|
+
"name": "NOT_MEMBER",
|
|
2141
|
+
"kind": "const",
|
|
2142
|
+
"signature": "pub const NOT_MEMBER: &str = \"not_member\";",
|
|
2143
|
+
"docs": "The caller has not joined."
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
"module": "ckx_sdk::kit::codes",
|
|
2147
|
+
"name": "NOT_READY",
|
|
2148
|
+
"kind": "const",
|
|
2149
|
+
"signature": "pub const NOT_READY: &str = \"not_ready\";",
|
|
2150
|
+
"docs": ""
|
|
2151
|
+
},
|
|
2152
|
+
{
|
|
2153
|
+
"module": "ckx_sdk::kit::codes",
|
|
2154
|
+
"name": "NOT_YOUR_TURN",
|
|
2155
|
+
"kind": "const",
|
|
2156
|
+
"signature": "pub const NOT_YOUR_TURN: &str = \"not_your_turn\";",
|
|
2157
|
+
"docs": ""
|
|
2158
|
+
},
|
|
2159
|
+
{
|
|
2160
|
+
"module": "ckx_sdk::kit::codes",
|
|
2161
|
+
"name": "OUT_OF_REACH",
|
|
2162
|
+
"kind": "const",
|
|
2163
|
+
"signature": "pub const OUT_OF_REACH: &str = \"out_of_reach\";",
|
|
2164
|
+
"docs": ""
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
"module": "ckx_sdk::kit::codes",
|
|
2168
|
+
"name": "RESERVED",
|
|
2169
|
+
"kind": "const",
|
|
2170
|
+
"signature": "pub const RESERVED: &str = \"reserved\";",
|
|
2171
|
+
"docs": ""
|
|
2172
|
+
},
|
|
2173
|
+
{
|
|
2174
|
+
"module": "ckx_sdk::kit::codes",
|
|
2175
|
+
"name": "STARTED",
|
|
2176
|
+
"kind": "const",
|
|
2177
|
+
"signature": "pub const STARTED: &str = \"started\";",
|
|
2178
|
+
"docs": ""
|
|
2179
|
+
},
|
|
2180
|
+
{
|
|
2181
|
+
"module": "ckx_sdk::kit::play",
|
|
2182
|
+
"name": "abilities",
|
|
2183
|
+
"kind": "module",
|
|
2184
|
+
"signature": "pub mod abilities;",
|
|
2185
|
+
"docs": ""
|
|
2186
|
+
},
|
|
2187
|
+
{
|
|
2188
|
+
"module": "ckx_sdk::kit::play",
|
|
2189
|
+
"name": "cards",
|
|
2190
|
+
"kind": "module",
|
|
2191
|
+
"signature": "pub mod cards;",
|
|
2192
|
+
"docs": ""
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
"module": "ckx_sdk::kit::play",
|
|
2196
|
+
"name": "combat",
|
|
2197
|
+
"kind": "module",
|
|
2198
|
+
"signature": "pub mod combat;",
|
|
2199
|
+
"docs": ""
|
|
2200
|
+
},
|
|
2201
|
+
{
|
|
2202
|
+
"module": "ckx_sdk::kit::play",
|
|
2203
|
+
"name": "movement",
|
|
2204
|
+
"kind": "module",
|
|
2205
|
+
"signature": "pub mod movement;",
|
|
2206
|
+
"docs": ""
|
|
2207
|
+
},
|
|
2208
|
+
{
|
|
2209
|
+
"module": "ckx_sdk::kit::play",
|
|
2210
|
+
"name": "score",
|
|
2211
|
+
"kind": "module",
|
|
2212
|
+
"signature": "pub mod score;",
|
|
2213
|
+
"docs": ""
|
|
2214
|
+
},
|
|
2215
|
+
{
|
|
2216
|
+
"module": "ckx_sdk::kit::play",
|
|
2217
|
+
"name": "timing",
|
|
2218
|
+
"kind": "module",
|
|
2219
|
+
"signature": "pub mod timing;",
|
|
2220
|
+
"docs": ""
|
|
2221
|
+
},
|
|
2222
|
+
{
|
|
2223
|
+
"module": "ckx_sdk::kit::play",
|
|
2224
|
+
"name": "turns",
|
|
2225
|
+
"kind": "module",
|
|
2226
|
+
"signature": "pub mod turns;",
|
|
2227
|
+
"docs": ""
|
|
2228
|
+
},
|
|
2229
|
+
{
|
|
2230
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2231
|
+
"name": "AbilityKind",
|
|
2232
|
+
"kind": "enum",
|
|
2233
|
+
"signature": "pub enum AbilityKind { /// Immediate hit on a target in range (hitscan). Instant { damage: i64 }, /// A stepped projectile along a direction; first actor within /// `hit_radius` takes the damage. Projectile { speed: f32, damage: i64, max_range: f32, hit_radius: f32 }, /// A delayed explosion at a target point; damage within `radius`, /// optionally scaled down linearly with distance. Aoe { radius: f32, damage: i64, delay_ms: u64, falloff: bool }, }",
|
|
2234
|
+
"docs": "What a cast does once validated."
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2238
|
+
"name": "AbilityKind::Aoe",
|
|
2239
|
+
"kind": "variant",
|
|
2240
|
+
"signature": "Aoe { radius: f32, damage: i64, delay_ms: u64, falloff: bool }",
|
|
2241
|
+
"docs": "A delayed explosion at a target point; damage within `radius`, optionally scaled down linearly with distance."
|
|
2242
|
+
},
|
|
2243
|
+
{
|
|
2244
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2245
|
+
"name": "AbilityKind::Instant",
|
|
2246
|
+
"kind": "variant",
|
|
2247
|
+
"signature": "Instant { damage: i64 }",
|
|
2248
|
+
"docs": "Immediate hit on a target in range (hitscan)."
|
|
2249
|
+
},
|
|
2250
|
+
{
|
|
2251
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2252
|
+
"name": "AbilityKind::Projectile",
|
|
2253
|
+
"kind": "variant",
|
|
2254
|
+
"signature": "Projectile { speed: f32, damage: i64, max_range: f32, hit_radius: f32 }",
|
|
2255
|
+
"docs": "A stepped projectile along a direction; first actor within `hit_radius` takes the damage."
|
|
2256
|
+
},
|
|
2257
|
+
{
|
|
2258
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2259
|
+
"name": "AbilitySpec",
|
|
2260
|
+
"kind": "struct",
|
|
2261
|
+
"signature": "pub struct AbilitySpec { pub ability_id: String, pub cooldown_ms: u64, pub resource_cost: i64, /// Max cast distance (target point / initial direction anchor). pub range: f32, pub kind: AbilityKind, }",
|
|
2262
|
+
"docs": "One ability's rules (usually from the hub's config)."
|
|
2263
|
+
},
|
|
2264
|
+
{
|
|
2265
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2266
|
+
"name": "AbilitySpec::ability_id",
|
|
2267
|
+
"kind": "field",
|
|
2268
|
+
"signature": "pub ability_id: String",
|
|
2269
|
+
"docs": ""
|
|
2270
|
+
},
|
|
2271
|
+
{
|
|
2272
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2273
|
+
"name": "AbilitySpec::cooldown_ms",
|
|
2274
|
+
"kind": "field",
|
|
2275
|
+
"signature": "pub cooldown_ms: u64",
|
|
2276
|
+
"docs": ""
|
|
2277
|
+
},
|
|
2278
|
+
{
|
|
2279
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2280
|
+
"name": "AbilitySpec::kind",
|
|
2281
|
+
"kind": "field",
|
|
2282
|
+
"signature": "pub kind: AbilityKind",
|
|
2283
|
+
"docs": ""
|
|
2284
|
+
},
|
|
2285
|
+
{
|
|
2286
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2287
|
+
"name": "AbilitySpec::range",
|
|
2288
|
+
"kind": "field",
|
|
2289
|
+
"signature": "pub range: f32",
|
|
2290
|
+
"docs": "Max cast distance (target point / initial direction anchor)."
|
|
2291
|
+
},
|
|
2292
|
+
{
|
|
2293
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2294
|
+
"name": "AbilitySpec::resource_cost",
|
|
2295
|
+
"kind": "field",
|
|
2296
|
+
"signature": "pub resource_cost: i64",
|
|
2297
|
+
"docs": ""
|
|
2298
|
+
},
|
|
2299
|
+
{
|
|
2300
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2301
|
+
"name": "CasterBook",
|
|
2302
|
+
"kind": "struct",
|
|
2303
|
+
"signature": "pub struct CasterBook { /// ability id -> earliest next cast (ms). pub ready_at: BTreeMap<String, u64>, pub resource: i64, pub resource_max: i64, /// Resource points regenerated per second. pub regen_per_sec: i64, pub last_regen_ms: u64, }",
|
|
2304
|
+
"docs": "Per-caster server-held book: cooldown stamps + a regenerating resource pool. One book per user, kept in the hub's state."
|
|
2305
|
+
},
|
|
2306
|
+
{
|
|
2307
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2308
|
+
"name": "CasterBook::default",
|
|
2309
|
+
"kind": "method",
|
|
2310
|
+
"signature": "fn default() -> Self",
|
|
2311
|
+
"docs": ""
|
|
2312
|
+
},
|
|
2313
|
+
{
|
|
2314
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2315
|
+
"name": "CasterBook::last_regen_ms",
|
|
2316
|
+
"kind": "field",
|
|
2317
|
+
"signature": "pub last_regen_ms: u64",
|
|
2318
|
+
"docs": ""
|
|
2319
|
+
},
|
|
2320
|
+
{
|
|
2321
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2322
|
+
"name": "CasterBook::ready_at",
|
|
2323
|
+
"kind": "field",
|
|
2324
|
+
"signature": "pub ready_at: BTreeMap<String, u64>",
|
|
2325
|
+
"docs": "ability id -> earliest next cast (ms)."
|
|
2326
|
+
},
|
|
2327
|
+
{
|
|
2328
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2329
|
+
"name": "CasterBook::regen",
|
|
2330
|
+
"kind": "method",
|
|
2331
|
+
"signature": "pub fn regen(&mut self, now_ms: u64)",
|
|
2332
|
+
"docs": "Apply resource regeneration up to `now_ms`."
|
|
2333
|
+
},
|
|
2334
|
+
{
|
|
2335
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2336
|
+
"name": "CasterBook::regen_per_sec",
|
|
2337
|
+
"kind": "field",
|
|
2338
|
+
"signature": "pub regen_per_sec: i64",
|
|
2339
|
+
"docs": "Resource points regenerated per second."
|
|
2340
|
+
},
|
|
2341
|
+
{
|
|
2342
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2343
|
+
"name": "CasterBook::resource",
|
|
2344
|
+
"kind": "field",
|
|
2345
|
+
"signature": "pub resource: i64",
|
|
2346
|
+
"docs": ""
|
|
2347
|
+
},
|
|
2348
|
+
{
|
|
2349
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2350
|
+
"name": "CasterBook::resource_max",
|
|
2351
|
+
"kind": "field",
|
|
2352
|
+
"signature": "pub resource_max: i64",
|
|
2353
|
+
"docs": ""
|
|
2354
|
+
},
|
|
2355
|
+
{
|
|
2356
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2357
|
+
"name": "PendingAoe",
|
|
2358
|
+
"kind": "struct",
|
|
2359
|
+
"signature": "pub struct PendingAoe { pub ability_id: String, pub caster_id: String, pub x: f32, pub z: f32, pub radius: f32, pub damage: i64, pub falloff: bool, pub detonate_at_ms: u64, }",
|
|
2360
|
+
"docs": "A delayed area effect awaiting detonation."
|
|
2361
|
+
},
|
|
2362
|
+
{
|
|
2363
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2364
|
+
"name": "PendingAoe::ability_id",
|
|
2365
|
+
"kind": "field",
|
|
2366
|
+
"signature": "pub ability_id: String",
|
|
2367
|
+
"docs": ""
|
|
2368
|
+
},
|
|
2369
|
+
{
|
|
2370
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2371
|
+
"name": "PendingAoe::caster_id",
|
|
2372
|
+
"kind": "field",
|
|
2373
|
+
"signature": "pub caster_id: String",
|
|
2374
|
+
"docs": ""
|
|
2375
|
+
},
|
|
2376
|
+
{
|
|
2377
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2378
|
+
"name": "PendingAoe::damage",
|
|
2379
|
+
"kind": "field",
|
|
2380
|
+
"signature": "pub damage: i64",
|
|
2381
|
+
"docs": ""
|
|
2382
|
+
},
|
|
2383
|
+
{
|
|
2384
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2385
|
+
"name": "PendingAoe::detonate_at_ms",
|
|
2386
|
+
"kind": "field",
|
|
2387
|
+
"signature": "pub detonate_at_ms: u64",
|
|
2388
|
+
"docs": ""
|
|
2389
|
+
},
|
|
2390
|
+
{
|
|
2391
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2392
|
+
"name": "PendingAoe::falloff",
|
|
2393
|
+
"kind": "field",
|
|
2394
|
+
"signature": "pub falloff: bool",
|
|
2395
|
+
"docs": ""
|
|
2396
|
+
},
|
|
2397
|
+
{
|
|
2398
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2399
|
+
"name": "PendingAoe::from_cast",
|
|
2400
|
+
"kind": "method",
|
|
2401
|
+
"signature": "pub fn from_cast(spec: &AbilitySpec, caster_id: &str, cast: &ValidCast, now_ms: u64) -> Option<Self>",
|
|
2402
|
+
"docs": ""
|
|
2403
|
+
},
|
|
2404
|
+
{
|
|
2405
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2406
|
+
"name": "PendingAoe::radius",
|
|
2407
|
+
"kind": "field",
|
|
2408
|
+
"signature": "pub radius: f32",
|
|
2409
|
+
"docs": ""
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2413
|
+
"name": "PendingAoe::ready",
|
|
2414
|
+
"kind": "method",
|
|
2415
|
+
"signature": "pub fn ready(&self, now_ms: u64) -> bool",
|
|
2416
|
+
"docs": ""
|
|
2417
|
+
},
|
|
2418
|
+
{
|
|
2419
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2420
|
+
"name": "PendingAoe::resolve",
|
|
2421
|
+
"kind": "method",
|
|
2422
|
+
"signature": "pub fn resolve(&self, victims: &[(String, (f32, f32))]) -> Vec<(String, i64)>",
|
|
2423
|
+
"docs": "Damage per victim inside the radius (linear falloff to 25% at the edge when enabled). Victims = (id, position); the caster is exempt."
|
|
2424
|
+
},
|
|
2425
|
+
{
|
|
2426
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2427
|
+
"name": "PendingAoe::x",
|
|
2428
|
+
"kind": "field",
|
|
2429
|
+
"signature": "pub x: f32",
|
|
2430
|
+
"docs": ""
|
|
2431
|
+
},
|
|
2432
|
+
{
|
|
2433
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2434
|
+
"name": "PendingAoe::z",
|
|
2435
|
+
"kind": "field",
|
|
2436
|
+
"signature": "pub z: f32",
|
|
2437
|
+
"docs": ""
|
|
2438
|
+
},
|
|
2439
|
+
{
|
|
2440
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2441
|
+
"name": "Projectile",
|
|
2442
|
+
"kind": "struct",
|
|
2443
|
+
"signature": "pub struct Projectile { pub ability_id: String, pub caster_id: String, pub x: f32, pub z: f32, pub dir: (f32, f32), pub speed: f32, pub damage: i64, pub hit_radius: f32, pub traveled: f32, pub max_range: f32, pub launched_at_ms: u64, }",
|
|
2444
|
+
"docs": "A live projectile the hub steps each tick."
|
|
2445
|
+
},
|
|
2446
|
+
{
|
|
2447
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2448
|
+
"name": "Projectile::ability_id",
|
|
2449
|
+
"kind": "field",
|
|
2450
|
+
"signature": "pub ability_id: String",
|
|
2451
|
+
"docs": ""
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2455
|
+
"name": "Projectile::caster_id",
|
|
2456
|
+
"kind": "field",
|
|
2457
|
+
"signature": "pub caster_id: String",
|
|
2458
|
+
"docs": ""
|
|
2459
|
+
},
|
|
2460
|
+
{
|
|
2461
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2462
|
+
"name": "Projectile::damage",
|
|
2463
|
+
"kind": "field",
|
|
2464
|
+
"signature": "pub damage: i64",
|
|
2465
|
+
"docs": ""
|
|
2466
|
+
},
|
|
2467
|
+
{
|
|
2468
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2469
|
+
"name": "Projectile::dir",
|
|
2470
|
+
"kind": "field",
|
|
2471
|
+
"signature": "pub dir: (f32, f32)",
|
|
2472
|
+
"docs": ""
|
|
2473
|
+
},
|
|
2474
|
+
{
|
|
2475
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2476
|
+
"name": "Projectile::hit_radius",
|
|
2477
|
+
"kind": "field",
|
|
2478
|
+
"signature": "pub hit_radius: f32",
|
|
2479
|
+
"docs": ""
|
|
2480
|
+
},
|
|
2481
|
+
{
|
|
2482
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2483
|
+
"name": "Projectile::launch",
|
|
2484
|
+
"kind": "method",
|
|
2485
|
+
"signature": "pub fn launch(spec: &AbilitySpec, caster_id: &str, from: (f32, f32), cast: &ValidCast, now_ms: u64) -> Option<Self>",
|
|
2486
|
+
"docs": ""
|
|
2487
|
+
},
|
|
2488
|
+
{
|
|
2489
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2490
|
+
"name": "Projectile::launched_at_ms",
|
|
2491
|
+
"kind": "field",
|
|
2492
|
+
"signature": "pub launched_at_ms: u64",
|
|
2493
|
+
"docs": ""
|
|
2494
|
+
},
|
|
2495
|
+
{
|
|
2496
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2497
|
+
"name": "Projectile::max_range",
|
|
2498
|
+
"kind": "field",
|
|
2499
|
+
"signature": "pub max_range: f32",
|
|
2500
|
+
"docs": ""
|
|
2501
|
+
},
|
|
2502
|
+
{
|
|
2503
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2504
|
+
"name": "Projectile::speed",
|
|
2505
|
+
"kind": "field",
|
|
2506
|
+
"signature": "pub speed: f32",
|
|
2507
|
+
"docs": ""
|
|
2508
|
+
},
|
|
2509
|
+
{
|
|
2510
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2511
|
+
"name": "Projectile::step",
|
|
2512
|
+
"kind": "method",
|
|
2513
|
+
"signature": "pub fn step( &mut self, dt_ms: u64, hit_test: &mut impl FnMut(f32, f32, f32) -> Option<String>, blocked: &mut impl FnMut(f32, f32) -> bool, ) -> ProjectileStep",
|
|
2514
|
+
"docs": "Advance `dt_ms`, sub-stepping so tick-rate simulation cannot tunnel through targets (tolerance window = hit_radius per sub-step). `hit_test(x, z, radius)` returns a hit target (never the caster) or None; `blocked(x, z)` marks walls."
|
|
2515
|
+
},
|
|
2516
|
+
{
|
|
2517
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2518
|
+
"name": "Projectile::traveled",
|
|
2519
|
+
"kind": "field",
|
|
2520
|
+
"signature": "pub traveled: f32",
|
|
2521
|
+
"docs": ""
|
|
2522
|
+
},
|
|
2523
|
+
{
|
|
2524
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2525
|
+
"name": "Projectile::x",
|
|
2526
|
+
"kind": "field",
|
|
2527
|
+
"signature": "pub x: f32",
|
|
2528
|
+
"docs": ""
|
|
2529
|
+
},
|
|
2530
|
+
{
|
|
2531
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2532
|
+
"name": "Projectile::z",
|
|
2533
|
+
"kind": "field",
|
|
2534
|
+
"signature": "pub z: f32",
|
|
2535
|
+
"docs": ""
|
|
2536
|
+
},
|
|
2537
|
+
{
|
|
2538
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2539
|
+
"name": "ProjectileStep",
|
|
2540
|
+
"kind": "enum",
|
|
2541
|
+
"signature": "pub enum ProjectileStep { /// Still flying (new position recorded on the projectile). Flying, /// Hit `target_id` at the recorded position; despawn. Hit { target_id: String }, /// Ran out of range or was blocked; despawn. Expired, }",
|
|
2542
|
+
"docs": "The outcome of one projectile step."
|
|
2543
|
+
},
|
|
2544
|
+
{
|
|
2545
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2546
|
+
"name": "ProjectileStep::Expired",
|
|
2547
|
+
"kind": "variant",
|
|
2548
|
+
"signature": "Expired",
|
|
2549
|
+
"docs": "Ran out of range or was blocked; despawn."
|
|
2550
|
+
},
|
|
2551
|
+
{
|
|
2552
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2553
|
+
"name": "ProjectileStep::Flying",
|
|
2554
|
+
"kind": "variant",
|
|
2555
|
+
"signature": "Flying",
|
|
2556
|
+
"docs": "Still flying (new position recorded on the projectile)."
|
|
2557
|
+
},
|
|
2558
|
+
{
|
|
2559
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2560
|
+
"name": "ProjectileStep::Hit",
|
|
2561
|
+
"kind": "variant",
|
|
2562
|
+
"signature": "Hit { target_id: String }",
|
|
2563
|
+
"docs": "Hit `target_id` at the recorded position; despawn."
|
|
2564
|
+
},
|
|
2565
|
+
{
|
|
2566
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2567
|
+
"name": "ValidCast",
|
|
2568
|
+
"kind": "struct",
|
|
2569
|
+
"signature": "pub struct ValidCast { pub ability_id: String, /// Normalized aim direction (projectiles). pub dir: (f32, f32), /// Clamped target point (instant/AoE). pub target: (f32, f32), }",
|
|
2570
|
+
"docs": "A validated cast, ready for the hub to act on."
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2574
|
+
"name": "ValidCast::ability_id",
|
|
2575
|
+
"kind": "field",
|
|
2576
|
+
"signature": "pub ability_id: String",
|
|
2577
|
+
"docs": ""
|
|
2578
|
+
},
|
|
2579
|
+
{
|
|
2580
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2581
|
+
"name": "ValidCast::dir",
|
|
2582
|
+
"kind": "field",
|
|
2583
|
+
"signature": "pub dir: (f32, f32)",
|
|
2584
|
+
"docs": "Normalized aim direction (projectiles)."
|
|
2585
|
+
},
|
|
2586
|
+
{
|
|
2587
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2588
|
+
"name": "ValidCast::target",
|
|
2589
|
+
"kind": "field",
|
|
2590
|
+
"signature": "pub target: (f32, f32)",
|
|
2591
|
+
"docs": "Clamped target point (instant/AoE)."
|
|
2592
|
+
},
|
|
2593
|
+
{
|
|
2594
|
+
"module": "ckx_sdk::kit::play::abilities",
|
|
2595
|
+
"name": "validate_cast",
|
|
2596
|
+
"kind": "function",
|
|
2597
|
+
"signature": "pub fn validate_cast( spec: &AbilitySpec, book: &mut CasterBook, caster_pos: (f32, f32), target: (f32, f32), now_ms: u64, ) -> Result<ValidCast, &'static str>",
|
|
2598
|
+
"docs": "Validate a cast against the book: cooldown, resource, range. On success the cooldown is armed and the resource deducted (the cast is committed)."
|
|
2599
|
+
},
|
|
2600
|
+
{
|
|
2601
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2602
|
+
"name": "CardId",
|
|
2603
|
+
"kind": "type",
|
|
2604
|
+
"signature": "pub type CardId = String;",
|
|
2605
|
+
"docs": ""
|
|
2606
|
+
},
|
|
2607
|
+
{
|
|
2608
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2609
|
+
"name": "CardTable",
|
|
2610
|
+
"kind": "struct",
|
|
2611
|
+
"signature": "pub struct CardTable { pub draw: Pile, pub discard: Pile, pub hands: BTreeMap<String, Vec<CardId>>, /// Named public zones (battlefield, trick, melds, ...), in play order. pub zones: BTreeMap<String, Vec<(String, CardId)>>, pub seed: u64, }",
|
|
2612
|
+
"docs": "The full table: draw pile, discard, per-actor hidden hands, and named public zones. Everything serde — one `CardTable` per match partition."
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2616
|
+
"name": "CardTable::clear_zone",
|
|
2617
|
+
"kind": "method",
|
|
2618
|
+
"signature": "pub fn clear_zone(&mut self, zone: &str) -> Vec<(String, CardId)>",
|
|
2619
|
+
"docs": "Move every card in a zone to the discard (trick taken, turn over)."
|
|
2620
|
+
},
|
|
2621
|
+
{
|
|
2622
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2623
|
+
"name": "CardTable::deal",
|
|
2624
|
+
"kind": "method",
|
|
2625
|
+
"signature": "pub fn deal(&mut self, actors: &[String], count: usize)",
|
|
2626
|
+
"docs": "Deal `count` cards to each actor (round-robin, deterministic order)."
|
|
2627
|
+
},
|
|
2628
|
+
{
|
|
2629
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2630
|
+
"name": "CardTable::discard",
|
|
2631
|
+
"kind": "field",
|
|
2632
|
+
"signature": "pub discard: Pile",
|
|
2633
|
+
"docs": ""
|
|
2634
|
+
},
|
|
2635
|
+
{
|
|
2636
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2637
|
+
"name": "CardTable::draw",
|
|
2638
|
+
"kind": "field",
|
|
2639
|
+
"signature": "pub draw: Pile",
|
|
2640
|
+
"docs": ""
|
|
2641
|
+
},
|
|
2642
|
+
{
|
|
2643
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2644
|
+
"name": "CardTable::draw_to_hand",
|
|
2645
|
+
"kind": "method",
|
|
2646
|
+
"signature": "pub fn draw_to_hand(&mut self, actor_id: &str) -> Option<CardId>",
|
|
2647
|
+
"docs": "Draw one card into an actor's hidden hand. Recycles the discard (reshuffled with the table seed + draw count) when the deck empties."
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2651
|
+
"name": "CardTable::hand",
|
|
2652
|
+
"kind": "method",
|
|
2653
|
+
"signature": "pub fn hand(&self, actor_id: &str) -> &[CardId]",
|
|
2654
|
+
"docs": "The caller's own hand (the ONLY read path for hidden cards)."
|
|
2655
|
+
},
|
|
2656
|
+
{
|
|
2657
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2658
|
+
"name": "CardTable::hand_sizes",
|
|
2659
|
+
"kind": "method",
|
|
2660
|
+
"signature": "pub fn hand_sizes(&self) -> BTreeMap<String, usize>",
|
|
2661
|
+
"docs": ""
|
|
2662
|
+
},
|
|
2663
|
+
{
|
|
2664
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2665
|
+
"name": "CardTable::hands",
|
|
2666
|
+
"kind": "field",
|
|
2667
|
+
"signature": "pub hands: BTreeMap<String, Vec<CardId>>",
|
|
2668
|
+
"docs": ""
|
|
2669
|
+
},
|
|
2670
|
+
{
|
|
2671
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2672
|
+
"name": "CardTable::new",
|
|
2673
|
+
"kind": "method",
|
|
2674
|
+
"signature": "pub fn new(catalog: impl IntoIterator<Item = CardId>, seed: u64) -> Self",
|
|
2675
|
+
"docs": "Build a table from a card catalog and shuffle with the given seed."
|
|
2676
|
+
},
|
|
2677
|
+
{
|
|
2678
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2679
|
+
"name": "CardTable::play",
|
|
2680
|
+
"kind": "method",
|
|
2681
|
+
"signature": "pub fn play(&mut self, actor_id: &str, card: &str, zone: &str) -> Result<(), &'static str>",
|
|
2682
|
+
"docs": "Play (reveal) a card from a hand into a public zone. Fails when the caller does not hold the card — the legality floor every game gets."
|
|
2683
|
+
},
|
|
2684
|
+
{
|
|
2685
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2686
|
+
"name": "CardTable::public_json",
|
|
2687
|
+
"kind": "method",
|
|
2688
|
+
"signature": "pub fn public_json(&self) -> Value",
|
|
2689
|
+
"docs": "The public view (zones + counts, NEVER hidden cards) for model sync and spectator events."
|
|
2690
|
+
},
|
|
2691
|
+
{
|
|
2692
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2693
|
+
"name": "CardTable::seed",
|
|
2694
|
+
"kind": "field",
|
|
2695
|
+
"signature": "pub seed: u64",
|
|
2696
|
+
"docs": ""
|
|
2697
|
+
},
|
|
2698
|
+
{
|
|
2699
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2700
|
+
"name": "CardTable::zones",
|
|
2701
|
+
"kind": "field",
|
|
2702
|
+
"signature": "pub zones: BTreeMap<String, Vec<(String, CardId)>>",
|
|
2703
|
+
"docs": "Named public zones (battlefield, trick, melds, ...), in play order."
|
|
2704
|
+
},
|
|
2705
|
+
{
|
|
2706
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2707
|
+
"name": "Pile",
|
|
2708
|
+
"kind": "struct",
|
|
2709
|
+
"signature": "pub struct Pile { /// Top of the pile is the END of the vec (pop to draw). pub cards: Vec<CardId>, }",
|
|
2710
|
+
"docs": "A pile with hidden order (draw deck / discard)."
|
|
2711
|
+
},
|
|
2712
|
+
{
|
|
2713
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2714
|
+
"name": "Pile::cards",
|
|
2715
|
+
"kind": "field",
|
|
2716
|
+
"signature": "pub cards: Vec<CardId>",
|
|
2717
|
+
"docs": "Top of the pile is the END of the vec (pop to draw)."
|
|
2718
|
+
},
|
|
2719
|
+
{
|
|
2720
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2721
|
+
"name": "Pile::draw",
|
|
2722
|
+
"kind": "method",
|
|
2723
|
+
"signature": "pub fn draw(&mut self) -> Option<CardId>",
|
|
2724
|
+
"docs": ""
|
|
2725
|
+
},
|
|
2726
|
+
{
|
|
2727
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2728
|
+
"name": "Pile::is_empty",
|
|
2729
|
+
"kind": "method",
|
|
2730
|
+
"signature": "pub fn is_empty(&self) -> bool",
|
|
2731
|
+
"docs": ""
|
|
2732
|
+
},
|
|
2733
|
+
{
|
|
2734
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2735
|
+
"name": "Pile::len",
|
|
2736
|
+
"kind": "method",
|
|
2737
|
+
"signature": "pub fn len(&self) -> usize",
|
|
2738
|
+
"docs": ""
|
|
2739
|
+
},
|
|
2740
|
+
{
|
|
2741
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2742
|
+
"name": "Pile::put",
|
|
2743
|
+
"kind": "method",
|
|
2744
|
+
"signature": "pub fn put(&mut self, card: CardId)",
|
|
2745
|
+
"docs": ""
|
|
2746
|
+
},
|
|
2747
|
+
{
|
|
2748
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2749
|
+
"name": "Pile::shuffle",
|
|
2750
|
+
"kind": "method",
|
|
2751
|
+
"signature": "pub fn shuffle(&mut self, rng: &mut Rng)",
|
|
2752
|
+
"docs": "Seeded Fisher-Yates shuffle."
|
|
2753
|
+
},
|
|
2754
|
+
{
|
|
2755
|
+
"module": "ckx_sdk::kit::play::cards",
|
|
2756
|
+
"name": "standard_52",
|
|
2757
|
+
"kind": "function",
|
|
2758
|
+
"signature": "pub fn standard_52() -> Vec<CardId>",
|
|
2759
|
+
"docs": "Build a standard 52-card catalog (\"AS\", \"2S\", ..., \"KC\") — handy for examples and tests; a real game builds its own from its hub's config."
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2763
|
+
"name": "Combatant",
|
|
2764
|
+
"kind": "struct",
|
|
2765
|
+
"signature": "pub struct Combatant { pub health: Health, #[serde(default)] pub statuses: Vec<Status>, #[serde(default)] pub kills: u32, #[serde(default)] pub deaths: u32, }",
|
|
2766
|
+
"docs": "Something that fights: health and the effects on it."
|
|
2767
|
+
},
|
|
2768
|
+
{
|
|
2769
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2770
|
+
"name": "Combatant::afflict",
|
|
2771
|
+
"kind": "method",
|
|
2772
|
+
"signature": "pub fn afflict(&mut self, kind: &str, per_tick: i64, every_ms: u64, duration_ms: u64, source: Option<String>, now: u64)",
|
|
2773
|
+
"docs": "Applies `kind` (replacing one of the same kind), first ticking `every_ms` from `now`."
|
|
2774
|
+
},
|
|
2775
|
+
{
|
|
2776
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2777
|
+
"name": "Combatant::deaths",
|
|
2778
|
+
"kind": "field",
|
|
2779
|
+
"signature": "pub deaths: u32",
|
|
2780
|
+
"docs": ""
|
|
2781
|
+
},
|
|
2782
|
+
{
|
|
2783
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2784
|
+
"name": "Combatant::has",
|
|
2785
|
+
"kind": "method",
|
|
2786
|
+
"signature": "pub fn has(&self, kind: &str) -> bool",
|
|
2787
|
+
"docs": ""
|
|
2788
|
+
},
|
|
2789
|
+
{
|
|
2790
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2791
|
+
"name": "Combatant::health",
|
|
2792
|
+
"kind": "field",
|
|
2793
|
+
"signature": "pub health: Health",
|
|
2794
|
+
"docs": ""
|
|
2795
|
+
},
|
|
2796
|
+
{
|
|
2797
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2798
|
+
"name": "Combatant::hit",
|
|
2799
|
+
"kind": "method",
|
|
2800
|
+
"signature": "pub fn hit(&mut self, amount: i64) -> DamageOutcome",
|
|
2801
|
+
"docs": "Damage from `amount`; counts the death."
|
|
2802
|
+
},
|
|
2803
|
+
{
|
|
2804
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2805
|
+
"name": "Combatant::kills",
|
|
2806
|
+
"kind": "field",
|
|
2807
|
+
"signature": "pub kills: u32",
|
|
2808
|
+
"docs": ""
|
|
2809
|
+
},
|
|
2810
|
+
{
|
|
2811
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2812
|
+
"name": "Combatant::new",
|
|
2813
|
+
"kind": "method",
|
|
2814
|
+
"signature": "pub fn new(max_hp: i64) -> Self",
|
|
2815
|
+
"docs": ""
|
|
2816
|
+
},
|
|
2817
|
+
{
|
|
2818
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2819
|
+
"name": "Combatant::statuses",
|
|
2820
|
+
"kind": "field",
|
|
2821
|
+
"signature": "pub statuses: Vec<Status>",
|
|
2822
|
+
"docs": ""
|
|
2823
|
+
},
|
|
2824
|
+
{
|
|
2825
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2826
|
+
"name": "Combatant::tick",
|
|
2827
|
+
"kind": "method",
|
|
2828
|
+
"signature": "pub fn tick(&mut self, now: u64) -> Vec<TickEffect>",
|
|
2829
|
+
"docs": "Runs every tick due by `now`, drops expired effects, and returns what each did."
|
|
2830
|
+
},
|
|
2831
|
+
{
|
|
2832
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2833
|
+
"name": "ContactBook",
|
|
2834
|
+
"kind": "struct",
|
|
2835
|
+
"signature": "pub struct ContactBook { #[serde(default)] pub at: BTreeMap<String, u64>, }",
|
|
2836
|
+
"docs": "A hostile's touch on a player, at most once per victim per cooldown."
|
|
2837
|
+
},
|
|
2838
|
+
{
|
|
2839
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2840
|
+
"name": "ContactBook::at",
|
|
2841
|
+
"kind": "field",
|
|
2842
|
+
"signature": "pub at: BTreeMap<String, u64>",
|
|
2843
|
+
"docs": ""
|
|
2844
|
+
},
|
|
2845
|
+
{
|
|
2846
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2847
|
+
"name": "ContactBook::touch",
|
|
2848
|
+
"kind": "method",
|
|
2849
|
+
"signature": "pub fn touch(&mut self, victim: &str, victim_at: (f64, f64), attacker: (f64, f64), range: f64, cooldown_ms: u64, now: u64) -> bool",
|
|
2850
|
+
"docs": "Whether the hostile at `attacker` touches the victim at `victim` (within `range`) now; when it does, the victim's cooldown starts."
|
|
2851
|
+
},
|
|
2852
|
+
{
|
|
2853
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2854
|
+
"name": "Cooldowns",
|
|
2855
|
+
"kind": "struct",
|
|
2856
|
+
"signature": "pub struct Cooldowns { #[serde(default)] pub last: BTreeMap<String, u64>, }",
|
|
2857
|
+
"docs": "Per-actor, per-action last-use times."
|
|
2858
|
+
},
|
|
2859
|
+
{
|
|
2860
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2861
|
+
"name": "Cooldowns::last",
|
|
2862
|
+
"kind": "field",
|
|
2863
|
+
"signature": "pub last: BTreeMap<String, u64>",
|
|
2864
|
+
"docs": ""
|
|
2865
|
+
},
|
|
2866
|
+
{
|
|
2867
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2868
|
+
"name": "Cooldowns::prune",
|
|
2869
|
+
"kind": "method",
|
|
2870
|
+
"signature": "pub fn prune(&mut self, now: u64, older_than_ms: u64)",
|
|
2871
|
+
"docs": "Forgets uses older than `older_than_ms`."
|
|
2872
|
+
},
|
|
2873
|
+
{
|
|
2874
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2875
|
+
"name": "Cooldowns::remaining",
|
|
2876
|
+
"kind": "method",
|
|
2877
|
+
"signature": "pub fn remaining(&self, actor: &str, action: &str, cooldown_ms: u64, now: u64) -> u64",
|
|
2878
|
+
"docs": "Milliseconds until `actor` may `action` again; 0 when it may now."
|
|
2879
|
+
},
|
|
2880
|
+
{
|
|
2881
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2882
|
+
"name": "Cooldowns::take",
|
|
2883
|
+
"kind": "method",
|
|
2884
|
+
"signature": "pub fn take(&mut self, actor: &str, action: &str, cooldown_ms: u64, now: u64) -> bool",
|
|
2885
|
+
"docs": "Whether `actor` may `action` at `now` with `cooldown_ms` between uses; when it may, the use is taken."
|
|
2886
|
+
},
|
|
2887
|
+
{
|
|
2888
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2889
|
+
"name": "DamageOutcome",
|
|
2890
|
+
"kind": "struct",
|
|
2891
|
+
"signature": "pub struct DamageOutcome { /// Health after it. pub health: i64, /// Damage actually taken (never more than the health it had). pub dealt: i64, pub killed: bool, }",
|
|
2892
|
+
"docs": "What damage did."
|
|
2893
|
+
},
|
|
2894
|
+
{
|
|
2895
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2896
|
+
"name": "DamageOutcome::dealt",
|
|
2897
|
+
"kind": "field",
|
|
2898
|
+
"signature": "pub dealt: i64",
|
|
2899
|
+
"docs": "Damage actually taken (never more than the health it had)."
|
|
2900
|
+
},
|
|
2901
|
+
{
|
|
2902
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2903
|
+
"name": "DamageOutcome::health",
|
|
2904
|
+
"kind": "field",
|
|
2905
|
+
"signature": "pub health: i64",
|
|
2906
|
+
"docs": "Health after it."
|
|
2907
|
+
},
|
|
2908
|
+
{
|
|
2909
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2910
|
+
"name": "DamageOutcome::killed",
|
|
2911
|
+
"kind": "field",
|
|
2912
|
+
"signature": "pub killed: bool",
|
|
2913
|
+
"docs": ""
|
|
2914
|
+
},
|
|
2915
|
+
{
|
|
2916
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2917
|
+
"name": "Health",
|
|
2918
|
+
"kind": "struct",
|
|
2919
|
+
"signature": "pub struct Health { pub current: i64, pub max: i64, }",
|
|
2920
|
+
"docs": "Hit points with a maximum."
|
|
2921
|
+
},
|
|
2922
|
+
{
|
|
2923
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2924
|
+
"name": "Health::alive",
|
|
2925
|
+
"kind": "method",
|
|
2926
|
+
"signature": "pub fn alive(&self) -> bool",
|
|
2927
|
+
"docs": ""
|
|
2928
|
+
},
|
|
2929
|
+
{
|
|
2930
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2931
|
+
"name": "Health::apply",
|
|
2932
|
+
"kind": "method",
|
|
2933
|
+
"signature": "pub fn apply(&mut self, amount: i64) -> DamageOutcome",
|
|
2934
|
+
"docs": ""
|
|
2935
|
+
},
|
|
2936
|
+
{
|
|
2937
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2938
|
+
"name": "Health::current",
|
|
2939
|
+
"kind": "field",
|
|
2940
|
+
"signature": "pub current: i64",
|
|
2941
|
+
"docs": ""
|
|
2942
|
+
},
|
|
2943
|
+
{
|
|
2944
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2945
|
+
"name": "Health::heal",
|
|
2946
|
+
"kind": "method",
|
|
2947
|
+
"signature": "pub fn heal(&mut self, amount: i64) -> i64",
|
|
2948
|
+
"docs": "Heals up to the maximum; a dead one stays dead. Returns what was healed."
|
|
2949
|
+
},
|
|
2950
|
+
{
|
|
2951
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2952
|
+
"name": "Health::max",
|
|
2953
|
+
"kind": "field",
|
|
2954
|
+
"signature": "pub max: i64",
|
|
2955
|
+
"docs": ""
|
|
2956
|
+
},
|
|
2957
|
+
{
|
|
2958
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2959
|
+
"name": "Health::new",
|
|
2960
|
+
"kind": "method",
|
|
2961
|
+
"signature": "pub fn new(max: i64) -> Self",
|
|
2962
|
+
"docs": ""
|
|
2963
|
+
},
|
|
2964
|
+
{
|
|
2965
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2966
|
+
"name": "Health::revive",
|
|
2967
|
+
"kind": "method",
|
|
2968
|
+
"signature": "pub fn revive(&mut self)",
|
|
2969
|
+
"docs": ""
|
|
2970
|
+
},
|
|
2971
|
+
{
|
|
2972
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2973
|
+
"name": "KillRecord",
|
|
2974
|
+
"kind": "struct",
|
|
2975
|
+
"signature": "pub struct KillRecord { pub killer: String, pub at_ms: u64, pub respawn_at_ms: u64, }",
|
|
2976
|
+
"docs": "A kill: who did it, when, and when the victim comes back."
|
|
2977
|
+
},
|
|
2978
|
+
{
|
|
2979
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2980
|
+
"name": "KillRecord::at_ms",
|
|
2981
|
+
"kind": "field",
|
|
2982
|
+
"signature": "pub at_ms: u64",
|
|
2983
|
+
"docs": ""
|
|
2984
|
+
},
|
|
2985
|
+
{
|
|
2986
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2987
|
+
"name": "KillRecord::killer",
|
|
2988
|
+
"kind": "field",
|
|
2989
|
+
"signature": "pub killer: String",
|
|
2990
|
+
"docs": ""
|
|
2991
|
+
},
|
|
2992
|
+
{
|
|
2993
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
2994
|
+
"name": "KillRecord::respawn_at_ms",
|
|
2995
|
+
"kind": "field",
|
|
2996
|
+
"signature": "pub respawn_at_ms: u64",
|
|
2997
|
+
"docs": ""
|
|
2998
|
+
},
|
|
2999
|
+
{
|
|
3000
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3001
|
+
"name": "RespawnBook",
|
|
3002
|
+
"kind": "struct",
|
|
3003
|
+
"signature": "pub struct RespawnBook { #[serde(default)] pub kills: BTreeMap<String, KillRecord>, }",
|
|
3004
|
+
"docs": "Kill credit and respawn timers, by victim id."
|
|
3005
|
+
},
|
|
3006
|
+
{
|
|
3007
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3008
|
+
"name": "RespawnBook::due",
|
|
3009
|
+
"kind": "method",
|
|
3010
|
+
"signature": "pub fn due(&mut self, now: u64) -> Vec<String>",
|
|
3011
|
+
"docs": "Victims whose respawn came due, taken out of the book."
|
|
3012
|
+
},
|
|
3013
|
+
{
|
|
3014
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3015
|
+
"name": "RespawnBook::is_down",
|
|
3016
|
+
"kind": "method",
|
|
3017
|
+
"signature": "pub fn is_down(&self, victim: &str) -> bool",
|
|
3018
|
+
"docs": ""
|
|
3019
|
+
},
|
|
3020
|
+
{
|
|
3021
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3022
|
+
"name": "RespawnBook::kills",
|
|
3023
|
+
"kind": "field",
|
|
3024
|
+
"signature": "pub kills: BTreeMap<String, KillRecord>",
|
|
3025
|
+
"docs": ""
|
|
3026
|
+
},
|
|
3027
|
+
{
|
|
3028
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3029
|
+
"name": "RespawnBook::record_kill",
|
|
3030
|
+
"kind": "method",
|
|
3031
|
+
"signature": "pub fn record_kill(&mut self, victim: &str, killer: &str, now: u64, respawn_ms: u64)",
|
|
3032
|
+
"docs": ""
|
|
3033
|
+
},
|
|
3034
|
+
{
|
|
3035
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3036
|
+
"name": "Status",
|
|
3037
|
+
"kind": "struct",
|
|
3038
|
+
"signature": "pub struct Status { pub kind: String, pub until_ms: u64, pub per_tick: i64, pub every_ms: u64, pub next_ms: u64, /// Who applied it, for kill credit. #[serde(default)] pub source: Option<String>, }",
|
|
3039
|
+
"docs": "A status effect: `per_tick` damage (negative heals) every `every_ms` until `until_ms`."
|
|
3040
|
+
},
|
|
3041
|
+
{
|
|
3042
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3043
|
+
"name": "Status::every_ms",
|
|
3044
|
+
"kind": "field",
|
|
3045
|
+
"signature": "pub every_ms: u64",
|
|
3046
|
+
"docs": ""
|
|
3047
|
+
},
|
|
3048
|
+
{
|
|
3049
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3050
|
+
"name": "Status::kind",
|
|
3051
|
+
"kind": "field",
|
|
3052
|
+
"signature": "pub kind: String",
|
|
3053
|
+
"docs": ""
|
|
3054
|
+
},
|
|
3055
|
+
{
|
|
3056
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3057
|
+
"name": "Status::next_ms",
|
|
3058
|
+
"kind": "field",
|
|
3059
|
+
"signature": "pub next_ms: u64",
|
|
3060
|
+
"docs": ""
|
|
3061
|
+
},
|
|
3062
|
+
{
|
|
3063
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3064
|
+
"name": "Status::per_tick",
|
|
3065
|
+
"kind": "field",
|
|
3066
|
+
"signature": "pub per_tick: i64",
|
|
3067
|
+
"docs": ""
|
|
3068
|
+
},
|
|
3069
|
+
{
|
|
3070
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3071
|
+
"name": "Status::source",
|
|
3072
|
+
"kind": "field",
|
|
3073
|
+
"signature": "pub source: Option<String>",
|
|
3074
|
+
"docs": "Who applied it, for kill credit."
|
|
3075
|
+
},
|
|
3076
|
+
{
|
|
3077
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3078
|
+
"name": "Status::until_ms",
|
|
3079
|
+
"kind": "field",
|
|
3080
|
+
"signature": "pub until_ms: u64",
|
|
3081
|
+
"docs": ""
|
|
3082
|
+
},
|
|
3083
|
+
{
|
|
3084
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3085
|
+
"name": "TickEffect",
|
|
3086
|
+
"kind": "struct",
|
|
3087
|
+
"signature": "pub struct TickEffect { pub kind: String, pub outcome: DamageOutcome, pub source: Option<String>, }",
|
|
3088
|
+
"docs": "What a status tick did to a combatant."
|
|
3089
|
+
},
|
|
3090
|
+
{
|
|
3091
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3092
|
+
"name": "TickEffect::kind",
|
|
3093
|
+
"kind": "field",
|
|
3094
|
+
"signature": "pub kind: String",
|
|
3095
|
+
"docs": ""
|
|
3096
|
+
},
|
|
3097
|
+
{
|
|
3098
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3099
|
+
"name": "TickEffect::outcome",
|
|
3100
|
+
"kind": "field",
|
|
3101
|
+
"signature": "pub outcome: DamageOutcome",
|
|
3102
|
+
"docs": ""
|
|
3103
|
+
},
|
|
3104
|
+
{
|
|
3105
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3106
|
+
"name": "TickEffect::source",
|
|
3107
|
+
"kind": "field",
|
|
3108
|
+
"signature": "pub source: Option<String>",
|
|
3109
|
+
"docs": ""
|
|
3110
|
+
},
|
|
3111
|
+
{
|
|
3112
|
+
"module": "ckx_sdk::kit::play::combat",
|
|
3113
|
+
"name": "in_reach",
|
|
3114
|
+
"kind": "function",
|
|
3115
|
+
"signature": "pub fn in_reach(attacker: (f64, f64), target: (f64, f64), range: f64) -> bool",
|
|
3116
|
+
"docs": "Whether `target` is within `range` chunks of `attacker` on the ground."
|
|
3117
|
+
},
|
|
3118
|
+
{
|
|
3119
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3120
|
+
"name": "Rules",
|
|
3121
|
+
"kind": "struct",
|
|
3122
|
+
"signature": "pub struct Rules { /// Units a second. pub max_speed: f64, /// A move this far or more at once is refused. pub teleport: f64, /// `(min_x, min_z, max_x, max_z)`, when there are any. pub bounds: Option<(f64, f64, f64, f64)>, /// Slack on `max_speed` for jitter in the reports' timing (1.25 lets a report be 25% fast). pub grace: f64, }",
|
|
3123
|
+
"docs": "What a player's movement may do, in the hub's own units."
|
|
3124
|
+
},
|
|
3125
|
+
{
|
|
3126
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3127
|
+
"name": "Rules::bounds",
|
|
3128
|
+
"kind": "field",
|
|
3129
|
+
"signature": "pub bounds: Option<(f64, f64, f64, f64)>",
|
|
3130
|
+
"docs": "`(min_x, min_z, max_x, max_z)`, when there are any."
|
|
3131
|
+
},
|
|
3132
|
+
{
|
|
3133
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3134
|
+
"name": "Rules::default",
|
|
3135
|
+
"kind": "method",
|
|
3136
|
+
"signature": "fn default() -> Self",
|
|
3137
|
+
"docs": ""
|
|
3138
|
+
},
|
|
3139
|
+
{
|
|
3140
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3141
|
+
"name": "Rules::grace",
|
|
3142
|
+
"kind": "field",
|
|
3143
|
+
"signature": "pub grace: f64",
|
|
3144
|
+
"docs": "Slack on `max_speed` for jitter in the reports' timing (1.25 lets a report be 25% fast)."
|
|
3145
|
+
},
|
|
3146
|
+
{
|
|
3147
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3148
|
+
"name": "Rules::max_speed",
|
|
3149
|
+
"kind": "field",
|
|
3150
|
+
"signature": "pub max_speed: f64",
|
|
3151
|
+
"docs": "Units a second."
|
|
3152
|
+
},
|
|
3153
|
+
{
|
|
3154
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3155
|
+
"name": "Rules::teleport",
|
|
3156
|
+
"kind": "field",
|
|
3157
|
+
"signature": "pub teleport: f64",
|
|
3158
|
+
"docs": "A move this far or more at once is refused."
|
|
3159
|
+
},
|
|
3160
|
+
{
|
|
3161
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3162
|
+
"name": "STRIKE_WINDOW_MS",
|
|
3163
|
+
"kind": "const",
|
|
3164
|
+
"signature": "pub const STRIKE_WINDOW_MS: u64 = 10_000;",
|
|
3165
|
+
"docs": "How long strikes are remembered after the last one."
|
|
3166
|
+
},
|
|
3167
|
+
{
|
|
3168
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3169
|
+
"name": "Verdict",
|
|
3170
|
+
"kind": "struct",
|
|
3171
|
+
"signature": "pub struct Verdict { pub at: (f64, f64), pub violation: Option<Violation>, }",
|
|
3172
|
+
"docs": "The position the hub keeps for a report, and what was wrong with it."
|
|
3173
|
+
},
|
|
3174
|
+
{
|
|
3175
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3176
|
+
"name": "Verdict::at",
|
|
3177
|
+
"kind": "field",
|
|
3178
|
+
"signature": "pub at: (f64, f64)",
|
|
3179
|
+
"docs": ""
|
|
3180
|
+
},
|
|
3181
|
+
{
|
|
3182
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3183
|
+
"name": "Verdict::violation",
|
|
3184
|
+
"kind": "field",
|
|
3185
|
+
"signature": "pub violation: Option<Violation>",
|
|
3186
|
+
"docs": ""
|
|
3187
|
+
},
|
|
3188
|
+
{
|
|
3189
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3190
|
+
"name": "Violation",
|
|
3191
|
+
"kind": "struct",
|
|
3192
|
+
"signature": "pub struct Violation { pub kind: ViolationKind, pub detail: String, }",
|
|
3193
|
+
"docs": ""
|
|
3194
|
+
},
|
|
3195
|
+
{
|
|
3196
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3197
|
+
"name": "Violation::detail",
|
|
3198
|
+
"kind": "field",
|
|
3199
|
+
"signature": "pub detail: String",
|
|
3200
|
+
"docs": ""
|
|
3201
|
+
},
|
|
3202
|
+
{
|
|
3203
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3204
|
+
"name": "Violation::kind",
|
|
3205
|
+
"kind": "field",
|
|
3206
|
+
"signature": "pub kind: ViolationKind",
|
|
3207
|
+
"docs": ""
|
|
3208
|
+
},
|
|
3209
|
+
{
|
|
3210
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3211
|
+
"name": "ViolationKind",
|
|
3212
|
+
"kind": "enum",
|
|
3213
|
+
"signature": "pub enum ViolationKind { Speed, Teleport, Bounds, }",
|
|
3214
|
+
"docs": ""
|
|
3215
|
+
},
|
|
3216
|
+
{
|
|
3217
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3218
|
+
"name": "ViolationKind::Bounds",
|
|
3219
|
+
"kind": "variant",
|
|
3220
|
+
"signature": "Bounds",
|
|
3221
|
+
"docs": ""
|
|
3222
|
+
},
|
|
3223
|
+
{
|
|
3224
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3225
|
+
"name": "ViolationKind::Speed",
|
|
3226
|
+
"kind": "variant",
|
|
3227
|
+
"signature": "Speed",
|
|
3228
|
+
"docs": ""
|
|
3229
|
+
},
|
|
3230
|
+
{
|
|
3231
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3232
|
+
"name": "ViolationKind::Teleport",
|
|
3233
|
+
"kind": "variant",
|
|
3234
|
+
"signature": "Teleport",
|
|
3235
|
+
"docs": ""
|
|
3236
|
+
},
|
|
3237
|
+
{
|
|
3238
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3239
|
+
"name": "ViolationKind::as_str",
|
|
3240
|
+
"kind": "method",
|
|
3241
|
+
"signature": "pub fn as_str(self) -> &'static str",
|
|
3242
|
+
"docs": ""
|
|
3243
|
+
},
|
|
3244
|
+
{
|
|
3245
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3246
|
+
"name": "Warden",
|
|
3247
|
+
"kind": "struct",
|
|
3248
|
+
"signature": "pub struct Warden { /// The position kept, and when. pub last: Option<(f64, f64, u64)>, pub strikes: u32, pub last_strike_ms: u64, }",
|
|
3249
|
+
"docs": "One player's movement as the hub last accepted it."
|
|
3250
|
+
},
|
|
3251
|
+
{
|
|
3252
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3253
|
+
"name": "Warden::at",
|
|
3254
|
+
"kind": "method",
|
|
3255
|
+
"signature": "pub fn at(at: (f64, f64), now: u64) -> Self",
|
|
3256
|
+
"docs": "A warden that starts from `at`: a spawn, a respawn, a place the hub moved the player to."
|
|
3257
|
+
},
|
|
3258
|
+
{
|
|
3259
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3260
|
+
"name": "Warden::check",
|
|
3261
|
+
"kind": "method",
|
|
3262
|
+
"signature": "pub fn check(&mut self, rules: &Rules, claimed: (f64, f64), now: u64) -> Verdict",
|
|
3263
|
+
"docs": "Checks a reported position and keeps the one the rules allow."
|
|
3264
|
+
},
|
|
3265
|
+
{
|
|
3266
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3267
|
+
"name": "Warden::last",
|
|
3268
|
+
"kind": "field",
|
|
3269
|
+
"signature": "pub last: Option<(f64, f64, u64)>",
|
|
3270
|
+
"docs": "The position kept, and when."
|
|
3271
|
+
},
|
|
3272
|
+
{
|
|
3273
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3274
|
+
"name": "Warden::last_strike_ms",
|
|
3275
|
+
"kind": "field",
|
|
3276
|
+
"signature": "pub last_strike_ms: u64",
|
|
3277
|
+
"docs": ""
|
|
3278
|
+
},
|
|
3279
|
+
{
|
|
3280
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3281
|
+
"name": "Warden::place",
|
|
3282
|
+
"kind": "method",
|
|
3283
|
+
"signature": "pub fn place(&mut self, at: (f64, f64), now: u64)",
|
|
3284
|
+
"docs": "Moves the player where the hub says, with no check."
|
|
3285
|
+
},
|
|
3286
|
+
{
|
|
3287
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3288
|
+
"name": "Warden::position",
|
|
3289
|
+
"kind": "method",
|
|
3290
|
+
"signature": "pub fn position(&self) -> Option<(f64, f64)>",
|
|
3291
|
+
"docs": "The position kept."
|
|
3292
|
+
},
|
|
3293
|
+
{
|
|
3294
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3295
|
+
"name": "Warden::strikes",
|
|
3296
|
+
"kind": "field",
|
|
3297
|
+
"signature": "pub strikes: u32",
|
|
3298
|
+
"docs": ""
|
|
3299
|
+
},
|
|
3300
|
+
{
|
|
3301
|
+
"module": "ckx_sdk::kit::play::movement",
|
|
3302
|
+
"name": "Warden::strikes",
|
|
3303
|
+
"kind": "method",
|
|
3304
|
+
"signature": "pub fn strikes(&self, now: u64) -> u32",
|
|
3305
|
+
"docs": "Strikes in the current window."
|
|
3306
|
+
},
|
|
3307
|
+
{
|
|
3308
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3309
|
+
"name": "MatchSummary",
|
|
3310
|
+
"kind": "struct",
|
|
3311
|
+
"signature": "pub struct MatchSummary { pub winner_id: Option<String>, pub standings: Vec<Standing>, pub rounds_played: u32, pub decided_by: String, }",
|
|
3312
|
+
"docs": "The published result of a decided match."
|
|
3313
|
+
},
|
|
3314
|
+
{
|
|
3315
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3316
|
+
"name": "MatchSummary::decided_by",
|
|
3317
|
+
"kind": "field",
|
|
3318
|
+
"signature": "pub decided_by: String",
|
|
3319
|
+
"docs": ""
|
|
3320
|
+
},
|
|
3321
|
+
{
|
|
3322
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3323
|
+
"name": "MatchSummary::rounds_played",
|
|
3324
|
+
"kind": "field",
|
|
3325
|
+
"signature": "pub rounds_played: u32",
|
|
3326
|
+
"docs": ""
|
|
3327
|
+
},
|
|
3328
|
+
{
|
|
3329
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3330
|
+
"name": "MatchSummary::standings",
|
|
3331
|
+
"kind": "field",
|
|
3332
|
+
"signature": "pub standings: Vec<Standing>",
|
|
3333
|
+
"docs": ""
|
|
3334
|
+
},
|
|
3335
|
+
{
|
|
3336
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3337
|
+
"name": "MatchSummary::winner_id",
|
|
3338
|
+
"kind": "field",
|
|
3339
|
+
"signature": "pub winner_id: Option<String>",
|
|
3340
|
+
"docs": ""
|
|
3341
|
+
},
|
|
3342
|
+
{
|
|
3343
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3344
|
+
"name": "ScoreBook",
|
|
3345
|
+
"kind": "struct",
|
|
3346
|
+
"signature": "pub struct ScoreBook { pub scores: BTreeMap<String, i64>, /// Actors still in the running (forfeits/eliminations remove). pub active: Vec<String>, pub decided: Option<MatchSummary>, }",
|
|
3347
|
+
"docs": ""
|
|
3348
|
+
},
|
|
3349
|
+
{
|
|
3350
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3351
|
+
"name": "ScoreBook::active",
|
|
3352
|
+
"kind": "field",
|
|
3353
|
+
"signature": "pub active: Vec<String>",
|
|
3354
|
+
"docs": "Actors still in the running (forfeits/eliminations remove)."
|
|
3355
|
+
},
|
|
3356
|
+
{
|
|
3357
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3358
|
+
"name": "ScoreBook::award",
|
|
3359
|
+
"kind": "method",
|
|
3360
|
+
"signature": "pub fn award(&mut self, actor_id: &str, points: i64) -> i64",
|
|
3361
|
+
"docs": "Add points (the hub calls this from validated moves only)."
|
|
3362
|
+
},
|
|
3363
|
+
{
|
|
3364
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3365
|
+
"name": "ScoreBook::decided",
|
|
3366
|
+
"kind": "field",
|
|
3367
|
+
"signature": "pub decided: Option<MatchSummary>",
|
|
3368
|
+
"docs": ""
|
|
3369
|
+
},
|
|
3370
|
+
{
|
|
3371
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3372
|
+
"name": "ScoreBook::eliminate",
|
|
3373
|
+
"kind": "method",
|
|
3374
|
+
"signature": "pub fn eliminate(&mut self, actor_id: &str)",
|
|
3375
|
+
"docs": "Remove an actor from contention (death/forfeit/disconnect)."
|
|
3376
|
+
},
|
|
3377
|
+
{
|
|
3378
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3379
|
+
"name": "ScoreBook::evaluate",
|
|
3380
|
+
"kind": "method",
|
|
3381
|
+
"signature": "pub fn evaluate(&mut self, condition: &WinCondition, rounds_played: u32, now_ms: u64) -> Option<&MatchSummary>",
|
|
3382
|
+
"docs": "Evaluate the condition; the first decision sticks (idempotent after)."
|
|
3383
|
+
},
|
|
3384
|
+
{
|
|
3385
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3386
|
+
"name": "ScoreBook::new",
|
|
3387
|
+
"kind": "method",
|
|
3388
|
+
"signature": "pub fn new(actors: impl IntoIterator<Item = String>) -> Self",
|
|
3389
|
+
"docs": ""
|
|
3390
|
+
},
|
|
3391
|
+
{
|
|
3392
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3393
|
+
"name": "ScoreBook::score",
|
|
3394
|
+
"kind": "method",
|
|
3395
|
+
"signature": "pub fn score(&self, actor_id: &str) -> i64",
|
|
3396
|
+
"docs": ""
|
|
3397
|
+
},
|
|
3398
|
+
{
|
|
3399
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3400
|
+
"name": "ScoreBook::scores",
|
|
3401
|
+
"kind": "field",
|
|
3402
|
+
"signature": "pub scores: BTreeMap<String, i64>",
|
|
3403
|
+
"docs": ""
|
|
3404
|
+
},
|
|
3405
|
+
{
|
|
3406
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3407
|
+
"name": "ScoreBook::standings",
|
|
3408
|
+
"kind": "method",
|
|
3409
|
+
"signature": "pub fn standings(&self) -> Vec<Standing>",
|
|
3410
|
+
"docs": "Standings ordered by score desc (stable; rank is 1-based, ties share the earlier rank's position order but distinct ranks — simple v1)."
|
|
3411
|
+
},
|
|
3412
|
+
{
|
|
3413
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3414
|
+
"name": "Standing",
|
|
3415
|
+
"kind": "struct",
|
|
3416
|
+
"signature": "pub struct Standing { pub actor_id: String, pub score: i64, pub rank: u32, }",
|
|
3417
|
+
"docs": ""
|
|
3418
|
+
},
|
|
3419
|
+
{
|
|
3420
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3421
|
+
"name": "Standing::actor_id",
|
|
3422
|
+
"kind": "field",
|
|
3423
|
+
"signature": "pub actor_id: String",
|
|
3424
|
+
"docs": ""
|
|
3425
|
+
},
|
|
3426
|
+
{
|
|
3427
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3428
|
+
"name": "Standing::rank",
|
|
3429
|
+
"kind": "field",
|
|
3430
|
+
"signature": "pub rank: u32",
|
|
3431
|
+
"docs": ""
|
|
3432
|
+
},
|
|
3433
|
+
{
|
|
3434
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3435
|
+
"name": "Standing::score",
|
|
3436
|
+
"kind": "field",
|
|
3437
|
+
"signature": "pub score: i64",
|
|
3438
|
+
"docs": ""
|
|
3439
|
+
},
|
|
3440
|
+
{
|
|
3441
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3442
|
+
"name": "WinCondition",
|
|
3443
|
+
"kind": "enum",
|
|
3444
|
+
"signature": "pub enum WinCondition { /// First to reach `target` points. ScoreReached { target: i64 }, /// Highest score when round `final_round` completes. BestOfRounds { final_round: u32 }, /// Last active participant standing (driven by forfeits/eliminations). LastStanding, /// Survive until the timer: highest score at `ends_at_ms`. TimeLimit { ends_at_ms: u64 }, }",
|
|
3445
|
+
"docs": "When is the match decided?"
|
|
3446
|
+
},
|
|
3447
|
+
{
|
|
3448
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3449
|
+
"name": "WinCondition::BestOfRounds",
|
|
3450
|
+
"kind": "variant",
|
|
3451
|
+
"signature": "BestOfRounds { final_round: u32 }",
|
|
3452
|
+
"docs": "Highest score when round `final_round` completes."
|
|
3453
|
+
},
|
|
3454
|
+
{
|
|
3455
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3456
|
+
"name": "WinCondition::LastStanding",
|
|
3457
|
+
"kind": "variant",
|
|
3458
|
+
"signature": "LastStanding",
|
|
3459
|
+
"docs": "Last active participant standing (driven by forfeits/eliminations)."
|
|
3460
|
+
},
|
|
3461
|
+
{
|
|
3462
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3463
|
+
"name": "WinCondition::ScoreReached",
|
|
3464
|
+
"kind": "variant",
|
|
3465
|
+
"signature": "ScoreReached { target: i64 }",
|
|
3466
|
+
"docs": "First to reach `target` points."
|
|
3467
|
+
},
|
|
3468
|
+
{
|
|
3469
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3470
|
+
"name": "WinCondition::TimeLimit",
|
|
3471
|
+
"kind": "variant",
|
|
3472
|
+
"signature": "TimeLimit { ends_at_ms: u64 }",
|
|
3473
|
+
"docs": "Survive until the timer: highest score at `ends_at_ms`."
|
|
3474
|
+
},
|
|
3475
|
+
{
|
|
3476
|
+
"module": "ckx_sdk::kit::play::score",
|
|
3477
|
+
"name": "summary_json",
|
|
3478
|
+
"kind": "function",
|
|
3479
|
+
"signature": "pub fn summary_json(summary: &MatchSummary) -> Value",
|
|
3480
|
+
"docs": "The summary as the JSON shape clients/events consume."
|
|
3481
|
+
},
|
|
3482
|
+
{
|
|
3483
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3484
|
+
"name": "Course",
|
|
3485
|
+
"kind": "struct",
|
|
3486
|
+
"signature": "pub struct Course { pub gates: Vec<Gate>, pub laps: u32, }",
|
|
3487
|
+
"docs": "A course: ordered gates; a lap = passing every gate in order (gate 0 is the start/finish line)."
|
|
3488
|
+
},
|
|
3489
|
+
{
|
|
3490
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3491
|
+
"name": "Course::gates",
|
|
3492
|
+
"kind": "field",
|
|
3493
|
+
"signature": "pub gates: Vec<Gate>",
|
|
3494
|
+
"docs": ""
|
|
3495
|
+
},
|
|
3496
|
+
{
|
|
3497
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3498
|
+
"name": "Course::laps",
|
|
3499
|
+
"kind": "field",
|
|
3500
|
+
"signature": "pub laps: u32",
|
|
3501
|
+
"docs": ""
|
|
3502
|
+
},
|
|
3503
|
+
{
|
|
3504
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3505
|
+
"name": "GHOST_MAX_FRAMES",
|
|
3506
|
+
"kind": "const",
|
|
3507
|
+
"signature": "pub const GHOST_MAX_FRAMES: usize = 600;",
|
|
3508
|
+
"docs": "Ghost tracks are capped so a long run cannot blow the state budget."
|
|
3509
|
+
},
|
|
3510
|
+
{
|
|
3511
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3512
|
+
"name": "Gate",
|
|
3513
|
+
"kind": "struct",
|
|
3514
|
+
"signature": "pub struct Gate { pub x: f32, pub z: f32, pub radius: f32, }",
|
|
3515
|
+
"docs": "One ordered gate on a course."
|
|
3516
|
+
},
|
|
3517
|
+
{
|
|
3518
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3519
|
+
"name": "Gate::radius",
|
|
3520
|
+
"kind": "field",
|
|
3521
|
+
"signature": "pub radius: f32",
|
|
3522
|
+
"docs": ""
|
|
3523
|
+
},
|
|
3524
|
+
{
|
|
3525
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3526
|
+
"name": "Gate::x",
|
|
3527
|
+
"kind": "field",
|
|
3528
|
+
"signature": "pub x: f32",
|
|
3529
|
+
"docs": ""
|
|
3530
|
+
},
|
|
3531
|
+
{
|
|
3532
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3533
|
+
"name": "Gate::z",
|
|
3534
|
+
"kind": "field",
|
|
3535
|
+
"signature": "pub z: f32",
|
|
3536
|
+
"docs": ""
|
|
3537
|
+
},
|
|
3538
|
+
{
|
|
3539
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3540
|
+
"name": "GhostTrack",
|
|
3541
|
+
"kind": "struct",
|
|
3542
|
+
"signature": "pub struct GhostTrack { pub frames: Vec<(u32, f32, f32, f32, f32)>, pub started_at_ms: u64, }",
|
|
3543
|
+
"docs": "A compact recorded pose track: (offset ms, x, y, z, yaw). Sampled at the recorder's cadence, replayed with linear interpolation."
|
|
3544
|
+
},
|
|
3545
|
+
{
|
|
3546
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3547
|
+
"name": "GhostTrack::duration_ms",
|
|
3548
|
+
"kind": "method",
|
|
3549
|
+
"signature": "pub fn duration_ms(&self) -> u32",
|
|
3550
|
+
"docs": ""
|
|
3551
|
+
},
|
|
3552
|
+
{
|
|
3553
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3554
|
+
"name": "GhostTrack::frame_at",
|
|
3555
|
+
"kind": "method",
|
|
3556
|
+
"signature": "pub fn frame_at(&self, offset_ms: u32) -> Option<(f32, f32, f32, f32)>",
|
|
3557
|
+
"docs": "Interpolated pose at `offset_ms` into the replay (clamped to ends)."
|
|
3558
|
+
},
|
|
3559
|
+
{
|
|
3560
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3561
|
+
"name": "GhostTrack::frames",
|
|
3562
|
+
"kind": "field",
|
|
3563
|
+
"signature": "pub frames: Vec<(u32, f32, f32, f32, f32)>",
|
|
3564
|
+
"docs": ""
|
|
3565
|
+
},
|
|
3566
|
+
{
|
|
3567
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3568
|
+
"name": "GhostTrack::record",
|
|
3569
|
+
"kind": "method",
|
|
3570
|
+
"signature": "pub fn record(&mut self, now_ms: u64, x: f32, y: f32, z: f32, yaw: f32)",
|
|
3571
|
+
"docs": "Record one frame (call per sample while the run is live)."
|
|
3572
|
+
},
|
|
3573
|
+
{
|
|
3574
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3575
|
+
"name": "GhostTrack::started_at_ms",
|
|
3576
|
+
"kind": "field",
|
|
3577
|
+
"signature": "pub started_at_ms: u64",
|
|
3578
|
+
"docs": ""
|
|
3579
|
+
},
|
|
3580
|
+
{
|
|
3581
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3582
|
+
"name": "RunTimer",
|
|
3583
|
+
"kind": "struct",
|
|
3584
|
+
"signature": "pub struct RunTimer { pub next_gate: usize, pub lap: u32, pub started_at_ms: u64, pub lap_started_at_ms: u64, pub splits_ms: Vec<u64>, pub best_lap_ms: u64, pub finished: bool, pub total_ms: u64, }",
|
|
3585
|
+
"docs": "One racer's live run state."
|
|
3586
|
+
},
|
|
3587
|
+
{
|
|
3588
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3589
|
+
"name": "RunTimer::best_lap_ms",
|
|
3590
|
+
"kind": "field",
|
|
3591
|
+
"signature": "pub best_lap_ms: u64",
|
|
3592
|
+
"docs": ""
|
|
3593
|
+
},
|
|
3594
|
+
{
|
|
3595
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3596
|
+
"name": "RunTimer::feed",
|
|
3597
|
+
"kind": "method",
|
|
3598
|
+
"signature": "pub fn feed(&mut self, course: &Course, pos: (f32, f32), now_ms: u64) -> Vec<TimingEvent>",
|
|
3599
|
+
"docs": "Feed one pose sample; returns the timing events it produced. The run starts when the racer first touches gate 0."
|
|
3600
|
+
},
|
|
3601
|
+
{
|
|
3602
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3603
|
+
"name": "RunTimer::finished",
|
|
3604
|
+
"kind": "field",
|
|
3605
|
+
"signature": "pub finished: bool",
|
|
3606
|
+
"docs": ""
|
|
3607
|
+
},
|
|
3608
|
+
{
|
|
3609
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3610
|
+
"name": "RunTimer::lap",
|
|
3611
|
+
"kind": "field",
|
|
3612
|
+
"signature": "pub lap: u32",
|
|
3613
|
+
"docs": ""
|
|
3614
|
+
},
|
|
3615
|
+
{
|
|
3616
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3617
|
+
"name": "RunTimer::lap_started_at_ms",
|
|
3618
|
+
"kind": "field",
|
|
3619
|
+
"signature": "pub lap_started_at_ms: u64",
|
|
3620
|
+
"docs": ""
|
|
3621
|
+
},
|
|
3622
|
+
{
|
|
3623
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3624
|
+
"name": "RunTimer::next_gate",
|
|
3625
|
+
"kind": "field",
|
|
3626
|
+
"signature": "pub next_gate: usize",
|
|
3627
|
+
"docs": ""
|
|
3628
|
+
},
|
|
3629
|
+
{
|
|
3630
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3631
|
+
"name": "RunTimer::splits_ms",
|
|
3632
|
+
"kind": "field",
|
|
3633
|
+
"signature": "pub splits_ms: Vec<u64>",
|
|
3634
|
+
"docs": ""
|
|
3635
|
+
},
|
|
3636
|
+
{
|
|
3637
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3638
|
+
"name": "RunTimer::started_at_ms",
|
|
3639
|
+
"kind": "field",
|
|
3640
|
+
"signature": "pub started_at_ms: u64",
|
|
3641
|
+
"docs": ""
|
|
3642
|
+
},
|
|
3643
|
+
{
|
|
3644
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3645
|
+
"name": "RunTimer::total_ms",
|
|
3646
|
+
"kind": "field",
|
|
3647
|
+
"signature": "pub total_ms: u64",
|
|
3648
|
+
"docs": ""
|
|
3649
|
+
},
|
|
3650
|
+
{
|
|
3651
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3652
|
+
"name": "TimingEvent",
|
|
3653
|
+
"kind": "enum",
|
|
3654
|
+
"signature": "pub enum TimingEvent { Started { at_ms: u64 }, Checkpoint { gate: usize, split_ms: u64 }, LapCompleted { lap: u32, lap_ms: u64, best: bool }, Finished { total_ms: u64, best_lap_ms: u64 }, }",
|
|
3655
|
+
"docs": "Events produced by feeding poses through a run timer."
|
|
3656
|
+
},
|
|
3657
|
+
{
|
|
3658
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3659
|
+
"name": "TimingEvent::Checkpoint",
|
|
3660
|
+
"kind": "variant",
|
|
3661
|
+
"signature": "Checkpoint { gate: usize, split_ms: u64 }",
|
|
3662
|
+
"docs": ""
|
|
3663
|
+
},
|
|
3664
|
+
{
|
|
3665
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3666
|
+
"name": "TimingEvent::Finished",
|
|
3667
|
+
"kind": "variant",
|
|
3668
|
+
"signature": "Finished { total_ms: u64, best_lap_ms: u64 }",
|
|
3669
|
+
"docs": ""
|
|
3670
|
+
},
|
|
3671
|
+
{
|
|
3672
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3673
|
+
"name": "TimingEvent::LapCompleted",
|
|
3674
|
+
"kind": "variant",
|
|
3675
|
+
"signature": "LapCompleted { lap: u32, lap_ms: u64, best: bool }",
|
|
3676
|
+
"docs": ""
|
|
3677
|
+
},
|
|
3678
|
+
{
|
|
3679
|
+
"module": "ckx_sdk::kit::play::timing",
|
|
3680
|
+
"name": "TimingEvent::Started",
|
|
3681
|
+
"kind": "variant",
|
|
3682
|
+
"signature": "Started { at_ms: u64 }",
|
|
3683
|
+
"docs": ""
|
|
3684
|
+
},
|
|
3685
|
+
{
|
|
3686
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3687
|
+
"name": "RevealRound",
|
|
3688
|
+
"kind": "struct",
|
|
3689
|
+
"signature": "pub struct RevealRound { pub expected: Vec<String>, pub submissions: Vec<(String, serde_json::Value)>, pub deadline_ms: u64, }",
|
|
3690
|
+
"docs": "Collects one hidden submission per actor, then resolves when everyone (or the deadline) is in. Submissions stay in the hub until the reveal."
|
|
3691
|
+
},
|
|
3692
|
+
{
|
|
3693
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3694
|
+
"name": "RevealRound::complete",
|
|
3695
|
+
"kind": "method",
|
|
3696
|
+
"signature": "pub fn complete(&self) -> bool",
|
|
3697
|
+
"docs": ""
|
|
3698
|
+
},
|
|
3699
|
+
{
|
|
3700
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3701
|
+
"name": "RevealRound::deadline_ms",
|
|
3702
|
+
"kind": "field",
|
|
3703
|
+
"signature": "pub deadline_ms: u64",
|
|
3704
|
+
"docs": ""
|
|
3705
|
+
},
|
|
3706
|
+
{
|
|
3707
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3708
|
+
"name": "RevealRound::expected",
|
|
3709
|
+
"kind": "field",
|
|
3710
|
+
"signature": "pub expected: Vec<String>",
|
|
3711
|
+
"docs": ""
|
|
3712
|
+
},
|
|
3713
|
+
{
|
|
3714
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3715
|
+
"name": "RevealRound::new",
|
|
3716
|
+
"kind": "method",
|
|
3717
|
+
"signature": "pub fn new(expected: Vec<String>, now_ms: u64, window_ms: u64) -> Self",
|
|
3718
|
+
"docs": ""
|
|
3719
|
+
},
|
|
3720
|
+
{
|
|
3721
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3722
|
+
"name": "RevealRound::ready",
|
|
3723
|
+
"kind": "method",
|
|
3724
|
+
"signature": "pub fn ready(&self, now_ms: u64) -> bool",
|
|
3725
|
+
"docs": "Ready to reveal: everyone submitted, or the window closed."
|
|
3726
|
+
},
|
|
3727
|
+
{
|
|
3728
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3729
|
+
"name": "RevealRound::reveal",
|
|
3730
|
+
"kind": "method",
|
|
3731
|
+
"signature": "pub fn reveal(self) -> Vec<(String, serde_json::Value)>",
|
|
3732
|
+
"docs": "Consume and return all submissions (the reveal)."
|
|
3733
|
+
},
|
|
3734
|
+
{
|
|
3735
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3736
|
+
"name": "RevealRound::submissions",
|
|
3737
|
+
"kind": "field",
|
|
3738
|
+
"signature": "pub submissions: Vec<(String, serde_json::Value)>",
|
|
3739
|
+
"docs": ""
|
|
3740
|
+
},
|
|
3741
|
+
{
|
|
3742
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3743
|
+
"name": "RevealRound::submit",
|
|
3744
|
+
"kind": "method",
|
|
3745
|
+
"signature": "pub fn submit(&mut self, actor_id: &str, payload: serde_json::Value) -> Result<(), &'static str>",
|
|
3746
|
+
"docs": "Record a submission. Duplicates and strangers are rejected."
|
|
3747
|
+
},
|
|
3748
|
+
{
|
|
3749
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3750
|
+
"name": "TimeoutPolicy",
|
|
3751
|
+
"kind": "enum",
|
|
3752
|
+
"signature": "pub enum TimeoutPolicy { /// The actor's turn is skipped (turn passes on). #[default] Skip, /// The actor forfeits and is removed from the order. Forfeit, /// Nothing happens automatically (a human host decides). Wait, }",
|
|
3753
|
+
"docs": "What happens when a turn timer expires."
|
|
3754
|
+
},
|
|
3755
|
+
{
|
|
3756
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3757
|
+
"name": "TimeoutPolicy::Forfeit",
|
|
3758
|
+
"kind": "variant",
|
|
3759
|
+
"signature": "Forfeit",
|
|
3760
|
+
"docs": "The actor forfeits and is removed from the order."
|
|
3761
|
+
},
|
|
3762
|
+
{
|
|
3763
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3764
|
+
"name": "TimeoutPolicy::Skip",
|
|
3765
|
+
"kind": "variant",
|
|
3766
|
+
"signature": "Skip",
|
|
3767
|
+
"docs": "The actor's turn is skipped (turn passes on)."
|
|
3768
|
+
},
|
|
3769
|
+
{
|
|
3770
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3771
|
+
"name": "TimeoutPolicy::Wait",
|
|
3772
|
+
"kind": "variant",
|
|
3773
|
+
"signature": "Wait",
|
|
3774
|
+
"docs": "Nothing happens automatically (a human host decides)."
|
|
3775
|
+
},
|
|
3776
|
+
{
|
|
3777
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3778
|
+
"name": "TurnActor",
|
|
3779
|
+
"kind": "struct",
|
|
3780
|
+
"signature": "pub struct TurnActor { /// Stable id (a player id, a unit's id, ...). pub id: String, /// Higher acts first; ties keep insertion order (stable sort). pub initiative: i64, /// Forfeited/dead actors stay recorded but are skipped. pub active: bool, }",
|
|
3781
|
+
"docs": "One participant in the order."
|
|
3782
|
+
},
|
|
3783
|
+
{
|
|
3784
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3785
|
+
"name": "TurnActor::active",
|
|
3786
|
+
"kind": "field",
|
|
3787
|
+
"signature": "pub active: bool",
|
|
3788
|
+
"docs": "Forfeited/dead actors stay recorded but are skipped."
|
|
3789
|
+
},
|
|
3790
|
+
{
|
|
3791
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3792
|
+
"name": "TurnActor::id",
|
|
3793
|
+
"kind": "field",
|
|
3794
|
+
"signature": "pub id: String",
|
|
3795
|
+
"docs": "Stable id (a player id, a unit's id, ...)."
|
|
3796
|
+
},
|
|
3797
|
+
{
|
|
3798
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3799
|
+
"name": "TurnActor::initiative",
|
|
3800
|
+
"kind": "field",
|
|
3801
|
+
"signature": "pub initiative: i64",
|
|
3802
|
+
"docs": "Higher acts first; ties keep insertion order (stable sort)."
|
|
3803
|
+
},
|
|
3804
|
+
{
|
|
3805
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3806
|
+
"name": "TurnEvent",
|
|
3807
|
+
"kind": "enum",
|
|
3808
|
+
"signature": "pub enum TurnEvent { TurnStarted { actor_id: String, round: u32, turn_in_round: u32, }, RoundStarted { round: u32, }, ActorSkipped { actor_id: String, }, ActorForfeited { actor_id: String, }, /// One (or zero) active actors remain. OrderExhausted, }",
|
|
3809
|
+
"docs": "An event the hub should announce (turn changed, round advanced, ...)."
|
|
3810
|
+
},
|
|
3811
|
+
{
|
|
3812
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3813
|
+
"name": "TurnEvent::ActorForfeited",
|
|
3814
|
+
"kind": "variant",
|
|
3815
|
+
"signature": "ActorForfeited { actor_id: String, }",
|
|
3816
|
+
"docs": ""
|
|
3817
|
+
},
|
|
3818
|
+
{
|
|
3819
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3820
|
+
"name": "TurnEvent::ActorSkipped",
|
|
3821
|
+
"kind": "variant",
|
|
3822
|
+
"signature": "ActorSkipped { actor_id: String, }",
|
|
3823
|
+
"docs": ""
|
|
3824
|
+
},
|
|
3825
|
+
{
|
|
3826
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3827
|
+
"name": "TurnEvent::OrderExhausted",
|
|
3828
|
+
"kind": "variant",
|
|
3829
|
+
"signature": "OrderExhausted",
|
|
3830
|
+
"docs": "One (or zero) active actors remain."
|
|
3831
|
+
},
|
|
3832
|
+
{
|
|
3833
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3834
|
+
"name": "TurnEvent::RoundStarted",
|
|
3835
|
+
"kind": "variant",
|
|
3836
|
+
"signature": "RoundStarted { round: u32, }",
|
|
3837
|
+
"docs": ""
|
|
3838
|
+
},
|
|
3839
|
+
{
|
|
3840
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3841
|
+
"name": "TurnEvent::TurnStarted",
|
|
3842
|
+
"kind": "variant",
|
|
3843
|
+
"signature": "TurnStarted { actor_id: String, round: u32, turn_in_round: u32, }",
|
|
3844
|
+
"docs": ""
|
|
3845
|
+
},
|
|
3846
|
+
{
|
|
3847
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3848
|
+
"name": "TurnOrder",
|
|
3849
|
+
"kind": "struct",
|
|
3850
|
+
"signature": "pub struct TurnOrder { pub actors: Vec<TurnActor>, /// Index into `actors` of the current turn holder. pub current: usize, pub round: u32, pub turn_in_round: u32, /// Current turn deadline (0 = no timer). pub deadline_ms: u64, pub turn_duration_ms: u64, pub timeout_policy: TimeoutPolicy, started: bool, }",
|
|
3851
|
+
"docs": ""
|
|
3852
|
+
},
|
|
3853
|
+
{
|
|
3854
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3855
|
+
"name": "TurnOrder::active_count",
|
|
3856
|
+
"kind": "method",
|
|
3857
|
+
"signature": "pub fn active_count(&self) -> usize",
|
|
3858
|
+
"docs": ""
|
|
3859
|
+
},
|
|
3860
|
+
{
|
|
3861
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3862
|
+
"name": "TurnOrder::actors",
|
|
3863
|
+
"kind": "field",
|
|
3864
|
+
"signature": "pub actors: Vec<TurnActor>",
|
|
3865
|
+
"docs": ""
|
|
3866
|
+
},
|
|
3867
|
+
{
|
|
3868
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3869
|
+
"name": "TurnOrder::advance",
|
|
3870
|
+
"kind": "method",
|
|
3871
|
+
"signature": "pub fn advance(&mut self, now_ms: u64) -> Vec<TurnEvent>",
|
|
3872
|
+
"docs": "Advance to the next active actor (call when the current turn ends)."
|
|
3873
|
+
},
|
|
3874
|
+
{
|
|
3875
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3876
|
+
"name": "TurnOrder::current",
|
|
3877
|
+
"kind": "field",
|
|
3878
|
+
"signature": "pub current: usize",
|
|
3879
|
+
"docs": "Index into `actors` of the current turn holder."
|
|
3880
|
+
},
|
|
3881
|
+
{
|
|
3882
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3883
|
+
"name": "TurnOrder::current_actor",
|
|
3884
|
+
"kind": "method",
|
|
3885
|
+
"signature": "pub fn current_actor(&self) -> Option<&TurnActor>",
|
|
3886
|
+
"docs": "The current turn holder (None before start / after exhaustion)."
|
|
3887
|
+
},
|
|
3888
|
+
{
|
|
3889
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3890
|
+
"name": "TurnOrder::deadline_ms",
|
|
3891
|
+
"kind": "field",
|
|
3892
|
+
"signature": "pub deadline_ms: u64",
|
|
3893
|
+
"docs": "Current turn deadline (0 = no timer)."
|
|
3894
|
+
},
|
|
3895
|
+
{
|
|
3896
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3897
|
+
"name": "TurnOrder::forfeit",
|
|
3898
|
+
"kind": "method",
|
|
3899
|
+
"signature": "pub fn forfeit(&mut self, actor_id: &str, now_ms: u64) -> Vec<TurnEvent>",
|
|
3900
|
+
"docs": "Remove an actor from the running order (death, rage-quit). Advances the turn when it was theirs."
|
|
3901
|
+
},
|
|
3902
|
+
{
|
|
3903
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3904
|
+
"name": "TurnOrder::new",
|
|
3905
|
+
"kind": "method",
|
|
3906
|
+
"signature": "pub fn new(actors: impl IntoIterator<Item = (String, i64)>, turn_duration_ms: u64, timeout_policy: TimeoutPolicy) -> Self",
|
|
3907
|
+
"docs": "Build an order from (id, initiative) pairs; sorts by initiative descending (stable — ties keep the given order)."
|
|
3908
|
+
},
|
|
3909
|
+
{
|
|
3910
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3911
|
+
"name": "TurnOrder::remaining_ms",
|
|
3912
|
+
"kind": "method",
|
|
3913
|
+
"signature": "pub fn remaining_ms(&self, now_ms: u64) -> Option<u64>",
|
|
3914
|
+
"docs": "Milliseconds left on the current turn (None = no timer / not started)."
|
|
3915
|
+
},
|
|
3916
|
+
{
|
|
3917
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3918
|
+
"name": "TurnOrder::round",
|
|
3919
|
+
"kind": "field",
|
|
3920
|
+
"signature": "pub round: u32",
|
|
3921
|
+
"docs": ""
|
|
3922
|
+
},
|
|
3923
|
+
{
|
|
3924
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3925
|
+
"name": "TurnOrder::start",
|
|
3926
|
+
"kind": "method",
|
|
3927
|
+
"signature": "pub fn start(&mut self, now_ms: u64) -> Vec<TurnEvent>",
|
|
3928
|
+
"docs": "Begin round 1, turn 1. Returns the announce events."
|
|
3929
|
+
},
|
|
3930
|
+
{
|
|
3931
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3932
|
+
"name": "TurnOrder::tick",
|
|
3933
|
+
"kind": "method",
|
|
3934
|
+
"signature": "pub fn tick(&mut self, now_ms: u64) -> Vec<TurnEvent>",
|
|
3935
|
+
"docs": "Apply the timeout policy if the current turn's deadline passed."
|
|
3936
|
+
},
|
|
3937
|
+
{
|
|
3938
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3939
|
+
"name": "TurnOrder::timeout_policy",
|
|
3940
|
+
"kind": "field",
|
|
3941
|
+
"signature": "pub timeout_policy: TimeoutPolicy",
|
|
3942
|
+
"docs": ""
|
|
3943
|
+
},
|
|
3944
|
+
{
|
|
3945
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3946
|
+
"name": "TurnOrder::turn_duration_ms",
|
|
3947
|
+
"kind": "field",
|
|
3948
|
+
"signature": "pub turn_duration_ms: u64",
|
|
3949
|
+
"docs": ""
|
|
3950
|
+
},
|
|
3951
|
+
{
|
|
3952
|
+
"module": "ckx_sdk::kit::play::turns",
|
|
3953
|
+
"name": "TurnOrder::turn_in_round",
|
|
3954
|
+
"kind": "field",
|
|
3955
|
+
"signature": "pub turn_in_round: u32",
|
|
3956
|
+
"docs": ""
|
|
3957
|
+
},
|
|
3958
|
+
{
|
|
3959
|
+
"module": "ckx_sdk::kit::presence",
|
|
3960
|
+
"name": "CHUNK_BLOCKS",
|
|
3961
|
+
"kind": "const",
|
|
3962
|
+
"signature": "pub const CHUNK_BLOCKS: f64 = 16.0;",
|
|
3963
|
+
"docs": "Blocks in a chunk's edge, for the engine pose's world coordinates."
|
|
3964
|
+
},
|
|
3965
|
+
{
|
|
3966
|
+
"module": "ckx_sdk::kit::presence",
|
|
3967
|
+
"name": "POSE_BYTES",
|
|
3968
|
+
"kind": "const",
|
|
3969
|
+
"signature": "pub const POSE_BYTES: usize = 48;",
|
|
3970
|
+
"docs": "The engine pose's length."
|
|
3971
|
+
},
|
|
3972
|
+
{
|
|
3973
|
+
"module": "ckx_sdk::kit::presence",
|
|
3974
|
+
"name": "Seen",
|
|
3975
|
+
"kind": "struct",
|
|
3976
|
+
"signature": "pub struct Seen { pub player: u64, pub uuid: String, pub x: f64, pub y: f64, pub z: f64, /// Placed from the actor's state, not its chunk's centre. pub precise: bool, }",
|
|
3977
|
+
"docs": "One player near the place, as last seen."
|
|
3978
|
+
},
|
|
3979
|
+
{
|
|
3980
|
+
"module": "ckx_sdk::kit::presence",
|
|
3981
|
+
"name": "Seen::player",
|
|
3982
|
+
"kind": "field",
|
|
3983
|
+
"signature": "pub player: u64",
|
|
3984
|
+
"docs": ""
|
|
3985
|
+
},
|
|
3986
|
+
{
|
|
3987
|
+
"module": "ckx_sdk::kit::presence",
|
|
3988
|
+
"name": "Seen::precise",
|
|
3989
|
+
"kind": "field",
|
|
3990
|
+
"signature": "pub precise: bool",
|
|
3991
|
+
"docs": "Placed from the actor's state, not its chunk's centre."
|
|
3992
|
+
},
|
|
3993
|
+
{
|
|
3994
|
+
"module": "ckx_sdk::kit::presence",
|
|
3995
|
+
"name": "Seen::uuid",
|
|
3996
|
+
"kind": "field",
|
|
3997
|
+
"signature": "pub uuid: String",
|
|
3998
|
+
"docs": ""
|
|
3999
|
+
},
|
|
4000
|
+
{
|
|
4001
|
+
"module": "ckx_sdk::kit::presence",
|
|
4002
|
+
"name": "Seen::x",
|
|
4003
|
+
"kind": "field",
|
|
4004
|
+
"signature": "pub x: f64",
|
|
4005
|
+
"docs": ""
|
|
4006
|
+
},
|
|
4007
|
+
{
|
|
4008
|
+
"module": "ckx_sdk::kit::presence",
|
|
4009
|
+
"name": "Seen::y",
|
|
4010
|
+
"kind": "field",
|
|
4011
|
+
"signature": "pub y: f64",
|
|
4012
|
+
"docs": ""
|
|
4013
|
+
},
|
|
4014
|
+
{
|
|
4015
|
+
"module": "ckx_sdk::kit::presence",
|
|
4016
|
+
"name": "Seen::z",
|
|
4017
|
+
"kind": "field",
|
|
4018
|
+
"signature": "pub z: f64",
|
|
4019
|
+
"docs": ""
|
|
4020
|
+
},
|
|
4021
|
+
{
|
|
4022
|
+
"module": "ckx_sdk::kit::presence",
|
|
4023
|
+
"name": "Track",
|
|
4024
|
+
"kind": "struct",
|
|
4025
|
+
"signature": "pub struct Track { pub x: f64, pub z: f64, pub at: u64, /// Chunks a second between the last two scans; 0 for the first. pub speed: f64, }",
|
|
4026
|
+
"docs": ""
|
|
4027
|
+
},
|
|
4028
|
+
{
|
|
4029
|
+
"module": "ckx_sdk::kit::presence",
|
|
4030
|
+
"name": "Track::at",
|
|
4031
|
+
"kind": "field",
|
|
4032
|
+
"signature": "pub at: u64",
|
|
4033
|
+
"docs": ""
|
|
4034
|
+
},
|
|
4035
|
+
{
|
|
4036
|
+
"module": "ckx_sdk::kit::presence",
|
|
4037
|
+
"name": "Track::speed",
|
|
4038
|
+
"kind": "field",
|
|
4039
|
+
"signature": "pub speed: f64",
|
|
4040
|
+
"docs": "Chunks a second between the last two scans; 0 for the first."
|
|
4041
|
+
},
|
|
4042
|
+
{
|
|
4043
|
+
"module": "ckx_sdk::kit::presence",
|
|
4044
|
+
"name": "Track::x",
|
|
4045
|
+
"kind": "field",
|
|
4046
|
+
"signature": "pub x: f64",
|
|
4047
|
+
"docs": ""
|
|
4048
|
+
},
|
|
4049
|
+
{
|
|
4050
|
+
"module": "ckx_sdk::kit::presence",
|
|
4051
|
+
"name": "Track::z",
|
|
4052
|
+
"kind": "field",
|
|
4053
|
+
"signature": "pub z: f64",
|
|
4054
|
+
"docs": ""
|
|
4055
|
+
},
|
|
4056
|
+
{
|
|
4057
|
+
"module": "ckx_sdk::kit::presence",
|
|
4058
|
+
"name": "Tracker",
|
|
4059
|
+
"kind": "struct",
|
|
4060
|
+
"signature": "pub struct Tracker { #[serde(default)] pub last: BTreeMap<u64, Track>, }",
|
|
4061
|
+
"docs": "Players' recent positions and speeds, from one scan to the next."
|
|
4062
|
+
},
|
|
4063
|
+
{
|
|
4064
|
+
"module": "ckx_sdk::kit::presence",
|
|
4065
|
+
"name": "Tracker::last",
|
|
4066
|
+
"kind": "field",
|
|
4067
|
+
"signature": "pub last: BTreeMap<u64, Track>",
|
|
4068
|
+
"docs": ""
|
|
4069
|
+
},
|
|
4070
|
+
{
|
|
4071
|
+
"module": "ckx_sdk::kit::presence",
|
|
4072
|
+
"name": "Tracker::position",
|
|
4073
|
+
"kind": "method",
|
|
4074
|
+
"signature": "pub fn position(&self, player: u64) -> Option<(f64, f64)>",
|
|
4075
|
+
"docs": ""
|
|
4076
|
+
},
|
|
4077
|
+
{
|
|
4078
|
+
"module": "ckx_sdk::kit::presence",
|
|
4079
|
+
"name": "Tracker::update",
|
|
4080
|
+
"kind": "method",
|
|
4081
|
+
"signature": "pub fn update(&mut self, seen: &[Seen], now: u64) -> BTreeMap<u64, f64>",
|
|
4082
|
+
"docs": "Takes a scan at `now`; players not in it are forgotten. Returns each player's speed."
|
|
4083
|
+
},
|
|
4084
|
+
{
|
|
4085
|
+
"module": "ckx_sdk::kit::presence",
|
|
4086
|
+
"name": "ground_distance",
|
|
4087
|
+
"kind": "function",
|
|
4088
|
+
"signature": "pub fn ground_distance(a: (f64, f64), b: (f64, f64)) -> f64",
|
|
4089
|
+
"docs": "Distance on the ground (x and z), in chunks."
|
|
4090
|
+
},
|
|
4091
|
+
{
|
|
4092
|
+
"module": "ckx_sdk::kit::presence",
|
|
4093
|
+
"name": "nearby",
|
|
4094
|
+
"kind": "function",
|
|
4095
|
+
"signature": "pub fn nearby(ctx: &Ctx, center: ChunkPos, radius: u8) -> Result<Vec<Seen>, CallError>",
|
|
4096
|
+
"docs": "The players within `radius` chunks (at most 3 across, 1 up and down) of `center`."
|
|
4097
|
+
},
|
|
4098
|
+
{
|
|
4099
|
+
"module": "ckx_sdk::kit::presence",
|
|
4100
|
+
"name": "players_among",
|
|
4101
|
+
"kind": "function",
|
|
4102
|
+
"signature": "pub fn players_among(actors: &[Actor]) -> Vec<Seen>",
|
|
4103
|
+
"docs": "Every player among `actors`, once each (the first actor a player has)."
|
|
4104
|
+
},
|
|
4105
|
+
{
|
|
4106
|
+
"module": "ckx_sdk::kit::presence",
|
|
4107
|
+
"name": "position_of",
|
|
4108
|
+
"kind": "function",
|
|
4109
|
+
"signature": "pub fn position_of(actor: &Actor) -> (f64, f64, f64, bool)",
|
|
4110
|
+
"docs": "Where an actor is, in chunks, and whether that came from its state."
|
|
4111
|
+
},
|
|
4112
|
+
{
|
|
4113
|
+
"module": "ckx_sdk::kit::rng",
|
|
4114
|
+
"name": "Rng",
|
|
4115
|
+
"kind": "struct",
|
|
4116
|
+
"signature": "pub struct Rng { state: u64, }",
|
|
4117
|
+
"docs": ""
|
|
4118
|
+
},
|
|
4119
|
+
{
|
|
4120
|
+
"module": "ckx_sdk::kit::rng",
|
|
4121
|
+
"name": "Rng::below",
|
|
4122
|
+
"kind": "method",
|
|
4123
|
+
"signature": "pub fn below(&mut self, n: u64) -> u64",
|
|
4124
|
+
"docs": "Uniform in `[0, n)`; 0 when `n` is 0."
|
|
4125
|
+
},
|
|
4126
|
+
{
|
|
4127
|
+
"module": "ckx_sdk::kit::rng",
|
|
4128
|
+
"name": "Rng::chance",
|
|
4129
|
+
"kind": "method",
|
|
4130
|
+
"signature": "pub fn chance(&mut self, p: f64) -> bool",
|
|
4131
|
+
"docs": "True with probability `p` (clamped to `[0, 1]`)."
|
|
4132
|
+
},
|
|
4133
|
+
{
|
|
4134
|
+
"module": "ckx_sdk::kit::rng",
|
|
4135
|
+
"name": "Rng::default",
|
|
4136
|
+
"kind": "method",
|
|
4137
|
+
"signature": "fn default() -> Self",
|
|
4138
|
+
"docs": ""
|
|
4139
|
+
},
|
|
4140
|
+
{
|
|
4141
|
+
"module": "ckx_sdk::kit::rng",
|
|
4142
|
+
"name": "Rng::f32",
|
|
4143
|
+
"kind": "method",
|
|
4144
|
+
"signature": "pub fn f32(&mut self) -> f32",
|
|
4145
|
+
"docs": "Uniform in `[0, 1)`, single precision."
|
|
4146
|
+
},
|
|
4147
|
+
{
|
|
4148
|
+
"module": "ckx_sdk::kit::rng",
|
|
4149
|
+
"name": "Rng::f64",
|
|
4150
|
+
"kind": "method",
|
|
4151
|
+
"signature": "pub fn f64(&mut self) -> f64",
|
|
4152
|
+
"docs": "Uniform in `[0, 1)`."
|
|
4153
|
+
},
|
|
4154
|
+
{
|
|
4155
|
+
"module": "ckx_sdk::kit::rng",
|
|
4156
|
+
"name": "Rng::next_u64",
|
|
4157
|
+
"kind": "method",
|
|
4158
|
+
"signature": "pub fn next_u64(&mut self) -> u64",
|
|
4159
|
+
"docs": ""
|
|
4160
|
+
},
|
|
4161
|
+
{
|
|
4162
|
+
"module": "ckx_sdk::kit::rng",
|
|
4163
|
+
"name": "Rng::pick",
|
|
4164
|
+
"kind": "method",
|
|
4165
|
+
"signature": "pub fn pick<'a, T>(&mut self, items: &'a [T]) -> Option<&'a T>",
|
|
4166
|
+
"docs": ""
|
|
4167
|
+
},
|
|
4168
|
+
{
|
|
4169
|
+
"module": "ckx_sdk::kit::rng",
|
|
4170
|
+
"name": "Rng::range",
|
|
4171
|
+
"kind": "method",
|
|
4172
|
+
"signature": "pub fn range(&mut self, lo: i64, hi: i64) -> i64",
|
|
4173
|
+
"docs": "Uniform in `[lo, hi]`, both included; `lo` when `hi` is not above it."
|
|
4174
|
+
},
|
|
4175
|
+
{
|
|
4176
|
+
"module": "ckx_sdk::kit::rng",
|
|
4177
|
+
"name": "Rng::range_i64",
|
|
4178
|
+
"kind": "method",
|
|
4179
|
+
"signature": "pub fn range_i64(&mut self, lo: i64, hi: i64) -> i64",
|
|
4180
|
+
"docs": "Uniform in `[lo, hi]`, both included: [`Rng::range`]."
|
|
4181
|
+
},
|
|
4182
|
+
{
|
|
4183
|
+
"module": "ckx_sdk::kit::rng",
|
|
4184
|
+
"name": "Rng::seed_from",
|
|
4185
|
+
"kind": "method",
|
|
4186
|
+
"signature": "pub fn seed_from(text: &str) -> u64",
|
|
4187
|
+
"docs": "A seed from text: a key, a name."
|
|
4188
|
+
},
|
|
4189
|
+
{
|
|
4190
|
+
"module": "ckx_sdk::kit::rng",
|
|
4191
|
+
"name": "Rng::seeded",
|
|
4192
|
+
"kind": "method",
|
|
4193
|
+
"signature": "pub fn seeded(seed: u64) -> Self",
|
|
4194
|
+
"docs": "A generator seeded with `seed`; 0 counts as 1, which xorshift needs."
|
|
4195
|
+
},
|
|
4196
|
+
{
|
|
4197
|
+
"module": "ckx_sdk::kit::rng",
|
|
4198
|
+
"name": "Rng::shuffle",
|
|
4199
|
+
"kind": "method",
|
|
4200
|
+
"signature": "pub fn shuffle<T>(&mut self, items: &mut [T])",
|
|
4201
|
+
"docs": "Shuffles in place (Fisher-Yates)."
|
|
4202
|
+
},
|
|
4203
|
+
{
|
|
4204
|
+
"module": "ckx_sdk::kit::rng",
|
|
4205
|
+
"name": "Rng::weighted",
|
|
4206
|
+
"kind": "method",
|
|
4207
|
+
"signature": "pub fn weighted(&mut self, weights: &[u64]) -> Option<usize>",
|
|
4208
|
+
"docs": "The index of one weight, chosen in proportion to the weights; `None` when they sum to nothing."
|
|
4209
|
+
},
|
|
4210
|
+
{
|
|
4211
|
+
"module": "ckx_sdk::kit::shard",
|
|
4212
|
+
"name": "around",
|
|
4213
|
+
"kind": "function",
|
|
4214
|
+
"signature": "pub fn around(x: i64, z: i64, size: i64, radius: i64) -> Vec<String>",
|
|
4215
|
+
"docs": "The keys of the shards within `radius` shards of the one holding `(x, z)`, its own first, then row by row."
|
|
4216
|
+
},
|
|
4217
|
+
{
|
|
4218
|
+
"module": "ckx_sdk::kit::shard",
|
|
4219
|
+
"name": "centre",
|
|
4220
|
+
"kind": "function",
|
|
4221
|
+
"signature": "pub fn centre(x: i64, z: i64, size: i64) -> (i64, i64)",
|
|
4222
|
+
"docs": "The shard's centre chunk for chunk `(x, z)`. `size` is at least 1."
|
|
4223
|
+
},
|
|
4224
|
+
{
|
|
4225
|
+
"module": "ckx_sdk::kit::shard",
|
|
1706
4226
|
"name": "key",
|
|
1707
4227
|
"kind": "function",
|
|
1708
|
-
"signature": "pub fn key(x: i64, z: i64, size: i64) -> String",
|
|
1709
|
-
"docs": "The key of the shard that holds chunk `(x, z)`."
|
|
4228
|
+
"signature": "pub fn key(x: i64, z: i64, size: i64) -> String",
|
|
4229
|
+
"docs": "The key of the shard that holds chunk `(x, z)`."
|
|
4230
|
+
},
|
|
4231
|
+
{
|
|
4232
|
+
"module": "ckx_sdk::kit::shard",
|
|
4233
|
+
"name": "parse",
|
|
4234
|
+
"kind": "function",
|
|
4235
|
+
"signature": "pub fn parse(key: &str) -> Option<(i64, i64)>",
|
|
4236
|
+
"docs": "The centre chunk a key names, or `None` when it is not `\"<x>,<z>\"`."
|
|
4237
|
+
},
|
|
4238
|
+
{
|
|
4239
|
+
"module": "ckx_sdk::kit::sim",
|
|
4240
|
+
"name": "daycycle",
|
|
4241
|
+
"kind": "module",
|
|
4242
|
+
"signature": "pub mod daycycle;",
|
|
4243
|
+
"docs": ""
|
|
4244
|
+
},
|
|
4245
|
+
{
|
|
4246
|
+
"module": "ckx_sdk::kit::sim",
|
|
4247
|
+
"name": "nodes",
|
|
4248
|
+
"kind": "module",
|
|
4249
|
+
"signature": "pub mod nodes;",
|
|
4250
|
+
"docs": ""
|
|
4251
|
+
},
|
|
4252
|
+
{
|
|
4253
|
+
"module": "ckx_sdk::kit::sim",
|
|
4254
|
+
"name": "waves",
|
|
4255
|
+
"kind": "module",
|
|
4256
|
+
"signature": "pub mod waves;",
|
|
4257
|
+
"docs": ""
|
|
4258
|
+
},
|
|
4259
|
+
{
|
|
4260
|
+
"module": "ckx_sdk::kit::sim",
|
|
4261
|
+
"name": "weather",
|
|
4262
|
+
"kind": "module",
|
|
4263
|
+
"signature": "pub mod weather;",
|
|
4264
|
+
"docs": ""
|
|
4265
|
+
},
|
|
4266
|
+
{
|
|
4267
|
+
"module": "ckx_sdk::kit::sim",
|
|
4268
|
+
"name": "zones",
|
|
4269
|
+
"kind": "module",
|
|
4270
|
+
"signature": "pub mod zones;",
|
|
4271
|
+
"docs": ""
|
|
4272
|
+
},
|
|
4273
|
+
{
|
|
4274
|
+
"module": "ckx_sdk::kit::sim::daycycle",
|
|
4275
|
+
"name": "DEFAULT_DAY_LENGTH_MS",
|
|
4276
|
+
"kind": "const",
|
|
4277
|
+
"signature": "pub const DEFAULT_DAY_LENGTH_MS: u64 = 1_200_000;",
|
|
4278
|
+
"docs": ""
|
|
4279
|
+
},
|
|
4280
|
+
{
|
|
4281
|
+
"module": "ckx_sdk::kit::sim::daycycle",
|
|
4282
|
+
"name": "DayCycle",
|
|
4283
|
+
"kind": "struct",
|
|
4284
|
+
"signature": "pub struct DayCycle { pub day_length_ms: u64, }",
|
|
4285
|
+
"docs": ""
|
|
4286
|
+
},
|
|
4287
|
+
{
|
|
4288
|
+
"module": "ckx_sdk::kit::sim::daycycle",
|
|
4289
|
+
"name": "DayCycle::day_index",
|
|
4290
|
+
"kind": "method",
|
|
4291
|
+
"signature": "pub fn day_index(&self, now_ms: u64) -> u64",
|
|
4292
|
+
"docs": "Day number since epoch (season math, daily resets)."
|
|
4293
|
+
},
|
|
4294
|
+
{
|
|
4295
|
+
"module": "ckx_sdk::kit::sim::daycycle",
|
|
4296
|
+
"name": "DayCycle::day_length_ms",
|
|
4297
|
+
"kind": "field",
|
|
4298
|
+
"signature": "pub day_length_ms: u64",
|
|
4299
|
+
"docs": ""
|
|
4300
|
+
},
|
|
4301
|
+
{
|
|
4302
|
+
"module": "ckx_sdk::kit::sim::daycycle",
|
|
4303
|
+
"name": "DayCycle::default",
|
|
4304
|
+
"kind": "method",
|
|
4305
|
+
"signature": "fn default() -> Self",
|
|
4306
|
+
"docs": ""
|
|
4307
|
+
},
|
|
4308
|
+
{
|
|
4309
|
+
"module": "ckx_sdk::kit::sim::daycycle",
|
|
4310
|
+
"name": "DayCycle::is_night",
|
|
4311
|
+
"kind": "method",
|
|
4312
|
+
"signature": "pub fn is_night(&self, now_ms: u64) -> bool",
|
|
4313
|
+
"docs": "Night when sin(phase*TAU) dips below -0.05."
|
|
4314
|
+
},
|
|
4315
|
+
{
|
|
4316
|
+
"module": "ckx_sdk::kit::sim::daycycle",
|
|
4317
|
+
"name": "DayCycle::new",
|
|
4318
|
+
"kind": "method",
|
|
4319
|
+
"signature": "pub fn new(day_length_ms: u64) -> Self",
|
|
4320
|
+
"docs": ""
|
|
4321
|
+
},
|
|
4322
|
+
{
|
|
4323
|
+
"module": "ckx_sdk::kit::sim::daycycle",
|
|
4324
|
+
"name": "DayCycle::phase",
|
|
4325
|
+
"kind": "method",
|
|
4326
|
+
"signature": "pub fn phase(&self, now_ms: u64) -> f32",
|
|
4327
|
+
"docs": "Phase in [0, 1): 0 = day start, 0.5 = day/night boundary region."
|
|
4328
|
+
},
|
|
4329
|
+
{
|
|
4330
|
+
"module": "ckx_sdk::kit::sim::daycycle",
|
|
4331
|
+
"name": "DayCycle::sun",
|
|
4332
|
+
"kind": "method",
|
|
4333
|
+
"signature": "pub fn sun(&self, now_ms: u64) -> f32",
|
|
4334
|
+
"docs": "Sun height in [-1, 1] (drive lighting / spawn weights)."
|
|
4335
|
+
},
|
|
4336
|
+
{
|
|
4337
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4338
|
+
"name": "HarvestOutcome",
|
|
4339
|
+
"kind": "struct",
|
|
4340
|
+
"signature": "pub struct HarvestOutcome { pub harvested: bool, pub depleted: bool, }",
|
|
4341
|
+
"docs": ""
|
|
4342
|
+
},
|
|
4343
|
+
{
|
|
4344
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4345
|
+
"name": "HarvestOutcome::depleted",
|
|
4346
|
+
"kind": "field",
|
|
4347
|
+
"signature": "pub depleted: bool",
|
|
4348
|
+
"docs": ""
|
|
4349
|
+
},
|
|
4350
|
+
{
|
|
4351
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4352
|
+
"name": "HarvestOutcome::harvested",
|
|
4353
|
+
"kind": "field",
|
|
4354
|
+
"signature": "pub harvested: bool",
|
|
4355
|
+
"docs": ""
|
|
4356
|
+
},
|
|
4357
|
+
{
|
|
4358
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4359
|
+
"name": "Node",
|
|
4360
|
+
"kind": "struct",
|
|
4361
|
+
"signature": "pub struct Node { pub phase: NodePhase, /// Remaining harvests before depletion (0 = infinite until depleted /// explicitly). pub charges: u32, }",
|
|
4362
|
+
"docs": ""
|
|
4363
|
+
},
|
|
4364
|
+
{
|
|
4365
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4366
|
+
"name": "Node::charges",
|
|
4367
|
+
"kind": "field",
|
|
4368
|
+
"signature": "pub charges: u32",
|
|
4369
|
+
"docs": "Remaining harvests before depletion (0 = infinite until depleted explicitly)."
|
|
4370
|
+
},
|
|
4371
|
+
{
|
|
4372
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4373
|
+
"name": "Node::phase",
|
|
4374
|
+
"kind": "field",
|
|
4375
|
+
"signature": "pub phase: NodePhase",
|
|
4376
|
+
"docs": ""
|
|
4377
|
+
},
|
|
4378
|
+
{
|
|
4379
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4380
|
+
"name": "NodePhase",
|
|
4381
|
+
"kind": "enum",
|
|
4382
|
+
"signature": "pub enum NodePhase { #[default] Ready, /// Depleted; respawns at the embedded time. Respawning { at_ms: u64 }, }",
|
|
4383
|
+
"docs": ""
|
|
4384
|
+
},
|
|
4385
|
+
{
|
|
4386
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4387
|
+
"name": "NodePhase::Ready",
|
|
4388
|
+
"kind": "variant",
|
|
4389
|
+
"signature": "Ready",
|
|
4390
|
+
"docs": ""
|
|
4391
|
+
},
|
|
4392
|
+
{
|
|
4393
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4394
|
+
"name": "NodePhase::Respawning",
|
|
4395
|
+
"kind": "variant",
|
|
4396
|
+
"signature": "Respawning { at_ms: u64 }",
|
|
4397
|
+
"docs": "Depleted; respawns at the embedded time."
|
|
4398
|
+
},
|
|
4399
|
+
{
|
|
4400
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4401
|
+
"name": "NodePool",
|
|
4402
|
+
"kind": "struct",
|
|
4403
|
+
"signature": "pub struct NodePool { pub nodes: BTreeMap<String, Node>, }",
|
|
4404
|
+
"docs": ""
|
|
4405
|
+
},
|
|
4406
|
+
{
|
|
4407
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4408
|
+
"name": "NodePool::ensure",
|
|
4409
|
+
"kind": "method",
|
|
4410
|
+
"signature": "pub fn ensure(&mut self, id: &str, charges: u32) -> &mut Node",
|
|
4411
|
+
"docs": "Register a node (idempotent; keeps existing state)."
|
|
4412
|
+
},
|
|
4413
|
+
{
|
|
4414
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4415
|
+
"name": "NodePool::harvest",
|
|
4416
|
+
"kind": "method",
|
|
4417
|
+
"signature": "pub fn harvest(&mut self, id: &str, now_ms: u64, respawn_ms: u64) -> HarvestOutcome",
|
|
4418
|
+
"docs": "Attempt a harvest. Depletes when charges run out."
|
|
4419
|
+
},
|
|
4420
|
+
{
|
|
4421
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4422
|
+
"name": "NodePool::is_ready",
|
|
4423
|
+
"kind": "method",
|
|
4424
|
+
"signature": "pub fn is_ready(&self, id: &str) -> bool",
|
|
4425
|
+
"docs": ""
|
|
4426
|
+
},
|
|
4427
|
+
{
|
|
4428
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4429
|
+
"name": "NodePool::nodes",
|
|
4430
|
+
"kind": "field",
|
|
4431
|
+
"signature": "pub nodes: BTreeMap<String, Node>",
|
|
4432
|
+
"docs": ""
|
|
4433
|
+
},
|
|
4434
|
+
{
|
|
4435
|
+
"module": "ckx_sdk::kit::sim::nodes",
|
|
4436
|
+
"name": "NodePool::tick",
|
|
4437
|
+
"kind": "method",
|
|
4438
|
+
"signature": "pub fn tick(&mut self, now_ms: u64, recharge: u32) -> Vec<String>",
|
|
4439
|
+
"docs": "Tick respawns: returns ids that just came back (re-arm charges)."
|
|
4440
|
+
},
|
|
4441
|
+
{
|
|
4442
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4443
|
+
"name": "WaveDef",
|
|
4444
|
+
"kind": "struct",
|
|
4445
|
+
"signature": "pub struct WaveDef { /// Entries: (unit id, count). pub units: Vec<(String, u32)>, /// Delay after the previous wave clears (or starts, for timed mode). pub delay_ms: u64, }",
|
|
4446
|
+
"docs": ""
|
|
4447
|
+
},
|
|
4448
|
+
{
|
|
4449
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4450
|
+
"name": "WaveDef::delay_ms",
|
|
4451
|
+
"kind": "field",
|
|
4452
|
+
"signature": "pub delay_ms: u64",
|
|
4453
|
+
"docs": "Delay after the previous wave clears (or starts, for timed mode)."
|
|
4454
|
+
},
|
|
4455
|
+
{
|
|
4456
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4457
|
+
"name": "WaveDef::units",
|
|
4458
|
+
"kind": "field",
|
|
4459
|
+
"signature": "pub units: Vec<(String, u32)>",
|
|
4460
|
+
"docs": "Entries: (unit id, count)."
|
|
4461
|
+
},
|
|
4462
|
+
{
|
|
4463
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4464
|
+
"name": "WaveEvent",
|
|
4465
|
+
"kind": "enum",
|
|
4466
|
+
"signature": "pub enum WaveEvent { /// Spawn this wave's units now. Start(usize), Finished, }",
|
|
4467
|
+
"docs": ""
|
|
4468
|
+
},
|
|
4469
|
+
{
|
|
4470
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4471
|
+
"name": "WaveEvent::Finished",
|
|
4472
|
+
"kind": "variant",
|
|
4473
|
+
"signature": "Finished",
|
|
4474
|
+
"docs": ""
|
|
4475
|
+
},
|
|
4476
|
+
{
|
|
4477
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4478
|
+
"name": "WaveEvent::Start",
|
|
4479
|
+
"kind": "variant",
|
|
4480
|
+
"signature": "Start(usize)",
|
|
4481
|
+
"docs": "Spawn this wave's units now."
|
|
4482
|
+
},
|
|
4483
|
+
{
|
|
4484
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4485
|
+
"name": "WavePhase",
|
|
4486
|
+
"kind": "enum",
|
|
4487
|
+
"signature": "pub enum WavePhase { /// Before wave `next` starts; starts at the embedded time. Countdown { next: usize, starts_at_ms: u64 }, /// Wave `index` is live. Active { index: usize }, /// All waves done. Complete, }",
|
|
4488
|
+
"docs": ""
|
|
4489
|
+
},
|
|
4490
|
+
{
|
|
4491
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4492
|
+
"name": "WavePhase::Active",
|
|
4493
|
+
"kind": "variant",
|
|
4494
|
+
"signature": "Active { index: usize }",
|
|
4495
|
+
"docs": "Wave `index` is live."
|
|
4496
|
+
},
|
|
4497
|
+
{
|
|
4498
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4499
|
+
"name": "WavePhase::Complete",
|
|
4500
|
+
"kind": "variant",
|
|
4501
|
+
"signature": "Complete",
|
|
4502
|
+
"docs": "All waves done."
|
|
4503
|
+
},
|
|
4504
|
+
{
|
|
4505
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4506
|
+
"name": "WavePhase::Countdown",
|
|
4507
|
+
"kind": "variant",
|
|
4508
|
+
"signature": "Countdown { next: usize, starts_at_ms: u64 }",
|
|
4509
|
+
"docs": "Before wave `next` starts; starts at the embedded time."
|
|
4510
|
+
},
|
|
4511
|
+
{
|
|
4512
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4513
|
+
"name": "WaveSchedule",
|
|
4514
|
+
"kind": "struct",
|
|
4515
|
+
"signature": "pub struct WaveSchedule { pub phase: WavePhase, }",
|
|
4516
|
+
"docs": ""
|
|
4517
|
+
},
|
|
4518
|
+
{
|
|
4519
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4520
|
+
"name": "WaveSchedule::default",
|
|
4521
|
+
"kind": "method",
|
|
4522
|
+
"signature": "fn default() -> Self",
|
|
4523
|
+
"docs": ""
|
|
4524
|
+
},
|
|
4525
|
+
{
|
|
4526
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4527
|
+
"name": "WaveSchedule::phase",
|
|
4528
|
+
"kind": "field",
|
|
4529
|
+
"signature": "pub phase: WavePhase",
|
|
4530
|
+
"docs": ""
|
|
4531
|
+
},
|
|
4532
|
+
{
|
|
4533
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4534
|
+
"name": "WaveSchedule::start",
|
|
4535
|
+
"kind": "method",
|
|
4536
|
+
"signature": "pub fn start(waves: &[WaveDef], now_ms: u64) -> Self",
|
|
4537
|
+
"docs": "Arm the schedule from wave 0 with the first delay."
|
|
4538
|
+
},
|
|
4539
|
+
{
|
|
4540
|
+
"module": "ckx_sdk::kit::sim::waves",
|
|
4541
|
+
"name": "WaveSchedule::step",
|
|
4542
|
+
"kind": "method",
|
|
4543
|
+
"signature": "pub fn step(&mut self, waves: &[WaveDef], now_ms: u64, active_cleared: bool) -> Option<WaveEvent>",
|
|
4544
|
+
"docs": "Advance. `active_cleared` = the live wave's units are all dead."
|
|
4545
|
+
},
|
|
4546
|
+
{
|
|
4547
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4548
|
+
"name": "EVENT_WEATHER",
|
|
4549
|
+
"kind": "const",
|
|
4550
|
+
"signature": "pub const EVENT_WEATHER: u16 = 90;",
|
|
4551
|
+
"docs": "The platform-reserved server-event type for weather/season transitions."
|
|
4552
|
+
},
|
|
4553
|
+
{
|
|
4554
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4555
|
+
"name": "Transition",
|
|
4556
|
+
"kind": "struct",
|
|
4557
|
+
"signature": "pub struct Transition { pub from: String, pub to: String, pub until_ms: u64, }",
|
|
4558
|
+
"docs": ""
|
|
4559
|
+
},
|
|
4560
|
+
{
|
|
4561
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4562
|
+
"name": "Transition::from",
|
|
4563
|
+
"kind": "field",
|
|
4564
|
+
"signature": "pub from: String",
|
|
4565
|
+
"docs": ""
|
|
4566
|
+
},
|
|
4567
|
+
{
|
|
4568
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4569
|
+
"name": "Transition::to",
|
|
4570
|
+
"kind": "field",
|
|
4571
|
+
"signature": "pub to: String",
|
|
4572
|
+
"docs": ""
|
|
4573
|
+
},
|
|
4574
|
+
{
|
|
4575
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4576
|
+
"name": "Transition::until_ms",
|
|
4577
|
+
"kind": "field",
|
|
4578
|
+
"signature": "pub until_ms: u64",
|
|
4579
|
+
"docs": ""
|
|
4580
|
+
},
|
|
4581
|
+
{
|
|
4582
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4583
|
+
"name": "WeatherKind",
|
|
4584
|
+
"kind": "struct",
|
|
4585
|
+
"signature": "pub struct WeatherKind { pub id: String, /// Relative pick weight (0 disables). pub weight: u32, pub min_ms: u64, pub max_ms: u64, }",
|
|
4586
|
+
"docs": ""
|
|
4587
|
+
},
|
|
4588
|
+
{
|
|
4589
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4590
|
+
"name": "WeatherKind::id",
|
|
4591
|
+
"kind": "field",
|
|
4592
|
+
"signature": "pub id: String",
|
|
4593
|
+
"docs": ""
|
|
4594
|
+
},
|
|
4595
|
+
{
|
|
4596
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4597
|
+
"name": "WeatherKind::max_ms",
|
|
4598
|
+
"kind": "field",
|
|
4599
|
+
"signature": "pub max_ms: u64",
|
|
4600
|
+
"docs": ""
|
|
4601
|
+
},
|
|
4602
|
+
{
|
|
4603
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4604
|
+
"name": "WeatherKind::min_ms",
|
|
4605
|
+
"kind": "field",
|
|
4606
|
+
"signature": "pub min_ms: u64",
|
|
4607
|
+
"docs": ""
|
|
4608
|
+
},
|
|
4609
|
+
{
|
|
4610
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4611
|
+
"name": "WeatherKind::weight",
|
|
4612
|
+
"kind": "field",
|
|
4613
|
+
"signature": "pub weight: u32",
|
|
4614
|
+
"docs": "Relative pick weight (0 disables)."
|
|
4615
|
+
},
|
|
4616
|
+
{
|
|
4617
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4618
|
+
"name": "WeatherState",
|
|
4619
|
+
"kind": "struct",
|
|
4620
|
+
"signature": "pub struct WeatherState { pub current: String, pub since_ms: u64, pub until_ms: u64, }",
|
|
4621
|
+
"docs": ""
|
|
4622
|
+
},
|
|
4623
|
+
{
|
|
4624
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4625
|
+
"name": "WeatherState::current",
|
|
4626
|
+
"kind": "field",
|
|
4627
|
+
"signature": "pub current: String",
|
|
4628
|
+
"docs": ""
|
|
4629
|
+
},
|
|
4630
|
+
{
|
|
4631
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4632
|
+
"name": "WeatherState::since_ms",
|
|
4633
|
+
"kind": "field",
|
|
4634
|
+
"signature": "pub since_ms: u64",
|
|
4635
|
+
"docs": ""
|
|
4636
|
+
},
|
|
4637
|
+
{
|
|
4638
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4639
|
+
"name": "WeatherState::until_ms",
|
|
4640
|
+
"kind": "field",
|
|
4641
|
+
"signature": "pub until_ms: u64",
|
|
4642
|
+
"docs": ""
|
|
4643
|
+
},
|
|
4644
|
+
{
|
|
4645
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4646
|
+
"name": "default_kinds",
|
|
4647
|
+
"kind": "function",
|
|
4648
|
+
"signature": "pub fn default_kinds() -> Vec<WeatherKind>",
|
|
4649
|
+
"docs": ""
|
|
1710
4650
|
},
|
|
1711
4651
|
{
|
|
1712
|
-
"module": "ckx_sdk::kit::
|
|
1713
|
-
"name": "
|
|
4652
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4653
|
+
"name": "emit_transition",
|
|
1714
4654
|
"kind": "function",
|
|
1715
|
-
"signature": "pub fn
|
|
1716
|
-
"docs": "
|
|
4655
|
+
"signature": "pub fn emit_transition(ctx: &Ctx, at: ChunkPos, distance: u8, actor: &[u8; 32], state: &WeatherState, now_ms: u64) -> Result<()>",
|
|
4656
|
+
"docs": "Sends a transition as a type-90 server event to the players within `distance` chunks of `at`, from the hub's `actor`."
|
|
4657
|
+
},
|
|
4658
|
+
{
|
|
4659
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4660
|
+
"name": "front_json",
|
|
4661
|
+
"kind": "function",
|
|
4662
|
+
"signature": "pub fn front_json(state: &WeatherState, now_ms: u64) -> Value",
|
|
4663
|
+
"docs": "The client-facing JSON for a front (both the event body and `forecast`)."
|
|
4664
|
+
},
|
|
4665
|
+
{
|
|
4666
|
+
"module": "ckx_sdk::kit::sim::weather",
|
|
4667
|
+
"name": "step",
|
|
4668
|
+
"kind": "function",
|
|
4669
|
+
"signature": "pub fn step(state: &mut WeatherState, kinds: &[WeatherKind], now_ms: u64, rng: &mut Rng) -> Option<Transition>",
|
|
4670
|
+
"docs": "Advance the front. Returns the transition when the front changed (emit it to clients), `None` while the current front holds."
|
|
4671
|
+
},
|
|
4672
|
+
{
|
|
4673
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4674
|
+
"name": "ShrinkPhase",
|
|
4675
|
+
"kind": "struct",
|
|
4676
|
+
"signature": "pub struct ShrinkPhase { /// The radius this phase shrinks TO. pub radius: f32, /// How long the zone HOLDS before shrinking (the warning window). pub hold_ms: u64, /// How long the shrink itself takes (radius interpolates linearly). pub shrink_ms: u64, }",
|
|
4677
|
+
"docs": "One phase of a shrinking-zone schedule."
|
|
4678
|
+
},
|
|
4679
|
+
{
|
|
4680
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4681
|
+
"name": "ShrinkPhase::hold_ms",
|
|
4682
|
+
"kind": "field",
|
|
4683
|
+
"signature": "pub hold_ms: u64",
|
|
4684
|
+
"docs": "How long the zone HOLDS before shrinking (the warning window)."
|
|
4685
|
+
},
|
|
4686
|
+
{
|
|
4687
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4688
|
+
"name": "ShrinkPhase::radius",
|
|
4689
|
+
"kind": "field",
|
|
4690
|
+
"signature": "pub radius: f32",
|
|
4691
|
+
"docs": "The radius this phase shrinks TO."
|
|
4692
|
+
},
|
|
4693
|
+
{
|
|
4694
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4695
|
+
"name": "ShrinkPhase::shrink_ms",
|
|
4696
|
+
"kind": "field",
|
|
4697
|
+
"signature": "pub shrink_ms: u64",
|
|
4698
|
+
"docs": "How long the shrink itself takes (radius interpolates linearly)."
|
|
4699
|
+
},
|
|
4700
|
+
{
|
|
4701
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4702
|
+
"name": "ShrinkingZone",
|
|
4703
|
+
"kind": "struct",
|
|
4704
|
+
"signature": "pub struct ShrinkingZone { pub center: (f32, f32), pub initial_radius: f32, pub phases: Vec<ShrinkPhase>, pub started_at_ms: u64, /// Last phase-progress marker events were emitted for (phase, stage). announced: Vec<(usize, u8)>, }",
|
|
4705
|
+
"docs": "A battle-royale circle: fixed center, radius stepping down a schedule. Pure clock math — feed it `now_ms`, read `radius()` and drain events."
|
|
4706
|
+
},
|
|
4707
|
+
{
|
|
4708
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4709
|
+
"name": "ShrinkingZone::center",
|
|
4710
|
+
"kind": "field",
|
|
4711
|
+
"signature": "pub center: (f32, f32)",
|
|
4712
|
+
"docs": ""
|
|
4713
|
+
},
|
|
4714
|
+
{
|
|
4715
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4716
|
+
"name": "ShrinkingZone::contains",
|
|
4717
|
+
"kind": "method",
|
|
4718
|
+
"signature": "pub fn contains(&self, pos: (f32, f32), now_ms: u64) -> bool",
|
|
4719
|
+
"docs": "Is a position inside the live circle?"
|
|
4720
|
+
},
|
|
4721
|
+
{
|
|
4722
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4723
|
+
"name": "ShrinkingZone::done",
|
|
4724
|
+
"kind": "method",
|
|
4725
|
+
"signature": "pub fn done(&self, now_ms: u64) -> bool",
|
|
4726
|
+
"docs": "Every phase fully settled?"
|
|
4727
|
+
},
|
|
4728
|
+
{
|
|
4729
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4730
|
+
"name": "ShrinkingZone::initial_radius",
|
|
4731
|
+
"kind": "field",
|
|
4732
|
+
"signature": "pub initial_radius: f32",
|
|
4733
|
+
"docs": ""
|
|
4734
|
+
},
|
|
4735
|
+
{
|
|
4736
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4737
|
+
"name": "ShrinkingZone::phases",
|
|
4738
|
+
"kind": "field",
|
|
4739
|
+
"signature": "pub phases: Vec<ShrinkPhase>",
|
|
4740
|
+
"docs": ""
|
|
4741
|
+
},
|
|
4742
|
+
{
|
|
4743
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4744
|
+
"name": "ShrinkingZone::poll",
|
|
4745
|
+
"kind": "method",
|
|
4746
|
+
"signature": "pub fn poll(&mut self, now_ms: u64) -> Vec<ZoneEvent>",
|
|
4747
|
+
"docs": "Advance the announcer: returns the events newly due at `now_ms` (warning at hold start, shrinking at shrink start, settled at end, final once after the last phase)."
|
|
4748
|
+
},
|
|
4749
|
+
{
|
|
4750
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4751
|
+
"name": "ShrinkingZone::radius",
|
|
4752
|
+
"kind": "method",
|
|
4753
|
+
"signature": "pub fn radius(&self, now_ms: u64) -> f32",
|
|
4754
|
+
"docs": "The circle's radius at `now_ms` (linear interpolation during shrinks)."
|
|
4755
|
+
},
|
|
4756
|
+
{
|
|
4757
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4758
|
+
"name": "ShrinkingZone::start",
|
|
4759
|
+
"kind": "method",
|
|
4760
|
+
"signature": "pub fn start(center: (f32, f32), initial_radius: f32, phases: Vec<ShrinkPhase>, now_ms: u64) -> Self",
|
|
4761
|
+
"docs": ""
|
|
4762
|
+
},
|
|
4763
|
+
{
|
|
4764
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4765
|
+
"name": "ShrinkingZone::started_at_ms",
|
|
4766
|
+
"kind": "field",
|
|
4767
|
+
"signature": "pub started_at_ms: u64",
|
|
4768
|
+
"docs": ""
|
|
4769
|
+
},
|
|
4770
|
+
{
|
|
4771
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4772
|
+
"name": "Zone",
|
|
4773
|
+
"kind": "struct",
|
|
4774
|
+
"signature": "pub struct Zone { pub id: String, pub rule: String, pub min: (f32, f32, f32), pub max: (f32, f32, f32), }",
|
|
4775
|
+
"docs": ""
|
|
4776
|
+
},
|
|
4777
|
+
{
|
|
4778
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4779
|
+
"name": "Zone::contains",
|
|
4780
|
+
"kind": "method",
|
|
4781
|
+
"signature": "pub fn contains(&self, pos: (f32, f32, f32)) -> bool",
|
|
4782
|
+
"docs": ""
|
|
4783
|
+
},
|
|
4784
|
+
{
|
|
4785
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4786
|
+
"name": "Zone::id",
|
|
4787
|
+
"kind": "field",
|
|
4788
|
+
"signature": "pub id: String",
|
|
4789
|
+
"docs": ""
|
|
4790
|
+
},
|
|
4791
|
+
{
|
|
4792
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4793
|
+
"name": "Zone::max",
|
|
4794
|
+
"kind": "field",
|
|
4795
|
+
"signature": "pub max: (f32, f32, f32)",
|
|
4796
|
+
"docs": ""
|
|
4797
|
+
},
|
|
4798
|
+
{
|
|
4799
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4800
|
+
"name": "Zone::min",
|
|
4801
|
+
"kind": "field",
|
|
4802
|
+
"signature": "pub min: (f32, f32, f32)",
|
|
4803
|
+
"docs": ""
|
|
4804
|
+
},
|
|
4805
|
+
{
|
|
4806
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4807
|
+
"name": "Zone::rule",
|
|
4808
|
+
"kind": "field",
|
|
4809
|
+
"signature": "pub rule: String",
|
|
4810
|
+
"docs": ""
|
|
4811
|
+
},
|
|
4812
|
+
{
|
|
4813
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4814
|
+
"name": "ZoneEvent",
|
|
4815
|
+
"kind": "enum",
|
|
4816
|
+
"signature": "pub enum ZoneEvent { /// A hold began: the zone will start shrinking to `to_radius` at `at_ms`. Warning { phase: usize, to_radius: f32, shrink_starts_at_ms: u64 }, /// The shrink began. Shrinking { phase: usize, to_radius: f32 }, /// The phase's target radius was reached. Settled { phase: usize, radius: f32 }, /// Every phase is done (the final circle). Final { radius: f32 }, }",
|
|
4817
|
+
"docs": "Announcements a shrinking zone produces as time advances."
|
|
4818
|
+
},
|
|
4819
|
+
{
|
|
4820
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4821
|
+
"name": "ZoneEvent::Final",
|
|
4822
|
+
"kind": "variant",
|
|
4823
|
+
"signature": "Final { radius: f32 }",
|
|
4824
|
+
"docs": "Every phase is done (the final circle)."
|
|
4825
|
+
},
|
|
4826
|
+
{
|
|
4827
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4828
|
+
"name": "ZoneEvent::Settled",
|
|
4829
|
+
"kind": "variant",
|
|
4830
|
+
"signature": "Settled { phase: usize, radius: f32 }",
|
|
4831
|
+
"docs": "The phase's target radius was reached."
|
|
4832
|
+
},
|
|
4833
|
+
{
|
|
4834
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4835
|
+
"name": "ZoneEvent::Shrinking",
|
|
4836
|
+
"kind": "variant",
|
|
4837
|
+
"signature": "Shrinking { phase: usize, to_radius: f32 }",
|
|
4838
|
+
"docs": "The shrink began."
|
|
4839
|
+
},
|
|
4840
|
+
{
|
|
4841
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4842
|
+
"name": "ZoneEvent::Warning",
|
|
4843
|
+
"kind": "variant",
|
|
4844
|
+
"signature": "Warning { phase: usize, to_radius: f32, shrink_starts_at_ms: u64 }",
|
|
4845
|
+
"docs": "A hold began: the zone will start shrinking to `to_radius` at `at_ms`."
|
|
4846
|
+
},
|
|
4847
|
+
{
|
|
4848
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4849
|
+
"name": "ZoneSet",
|
|
4850
|
+
"kind": "struct",
|
|
4851
|
+
"signature": "pub struct ZoneSet { pub zones: Vec<Zone>, }",
|
|
4852
|
+
"docs": ""
|
|
4853
|
+
},
|
|
4854
|
+
{
|
|
4855
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4856
|
+
"name": "ZoneSet::at",
|
|
4857
|
+
"kind": "method",
|
|
4858
|
+
"signature": "pub fn at(&self, pos: (f32, f32, f32)) -> Vec<&Zone>",
|
|
4859
|
+
"docs": "All zones containing the position."
|
|
4860
|
+
},
|
|
4861
|
+
{
|
|
4862
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4863
|
+
"name": "ZoneSet::has_rule",
|
|
4864
|
+
"kind": "method",
|
|
4865
|
+
"signature": "pub fn has_rule(&self, pos: (f32, f32, f32), rule: &str) -> bool",
|
|
4866
|
+
"docs": "Does any zone with this rule cover the position?"
|
|
4867
|
+
},
|
|
4868
|
+
{
|
|
4869
|
+
"module": "ckx_sdk::kit::sim::zones",
|
|
4870
|
+
"name": "ZoneSet::zones",
|
|
4871
|
+
"kind": "field",
|
|
4872
|
+
"signature": "pub zones: Vec<Zone>",
|
|
4873
|
+
"docs": ""
|
|
1717
4874
|
},
|
|
1718
4875
|
{
|
|
1719
4876
|
"module": "ckx_sdk::kit::wire",
|