@adatechnology/game-contracts 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +10 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1518,6 +1518,11 @@ interface ModuleHost {
|
|
|
1518
1518
|
on(listener: (event: HostEvent) => void): () => void;
|
|
1519
1519
|
/** Run every simulated frame with the frame's seconds. Returns the unsubscribe function. */
|
|
1520
1520
|
onFrame(update: (dt: number) => void): () => void;
|
|
1521
|
+
/**
|
|
1522
|
+
* Follow the host clearing its area (`clear()`, opening an area, running scenarios): everything the module put in the world on its own (not as items) is to be taken away or put back. Returns the
|
|
1523
|
+
* unsubscribe function. A host that never clears leaves it out.
|
|
1524
|
+
*/
|
|
1525
|
+
onClear?(listener: () => void): () => void;
|
|
1521
1526
|
/** Write a line to the host's behaviour log. */
|
|
1522
1527
|
log(text: string, data?: Record<string, unknown>): void;
|
|
1523
1528
|
/**
|
|
@@ -1525,6 +1530,11 @@ interface ModuleHost {
|
|
|
1525
1530
|
* ones taken later start that way. A host applies the ids it knows and ignores the rest. The test room knows `condition` (how worn the tools are) and `ammo_quality` (how good what they load is).
|
|
1526
1531
|
*/
|
|
1527
1532
|
configureTool?(settings: Readonly<Record<string, string>>): void;
|
|
1533
|
+
/**
|
|
1534
|
+
* Adds a place the walking player cannot enter: `blocked(x, z, radius)` answers for a disc of the player's `radius` centred on the world point (x, z). A module with walls of its own (a house) uses it so the
|
|
1535
|
+
* player stops at them; the function is asked on every step, so it may follow a door that opens. Returns the function that takes it away. A host without a walking player leaves it out.
|
|
1536
|
+
*/
|
|
1537
|
+
addBlocker?(blocked: (x: number, z: number, radius: number) => boolean): () => void;
|
|
1528
1538
|
/** Asks the tool in hand to do something (see `ToolCommand`). A host without accessories leaves it out. */
|
|
1529
1539
|
command?(command: ToolCommand): ToolCommandResult;
|
|
1530
1540
|
/** Lent only to a module that declares controls, layers or metrics. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adatechnology/game-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The contracts every game module depends on, and nothing else: destruction (parts, hits, events, DestructibleImpl), weapons (shots), fluids (containers, item uses), item animations and the TestableModule a module hands the test room. Types plus tiny checkers, no runtime dependencies.",
|
|
6
6
|
"keywords": [
|