@wonderyard/vivarium 1.5.0 → 2.0.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/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Helpers as t } from "./blueprint/helpers.js";
2
2
  import { ElementBlueprint as i, KindBlueprint as o, RefBlueprint as u } from "./blueprint/ref-blueprint.js";
3
- import { R as m, a as n } from "./rule-blueprint-CIEvYOmb.js";
3
+ import { R as m, a as n } from "./rule-blueprint-C9qa6iP-.js";
4
4
  import { VivariumBlueprint as x } from "./blueprint/vivarium-blueprint.js";
5
5
  import { vivarium as a } from "./vivarium/vivarium.js";
6
6
  import { setup as R } from "./webgpu/setup.js";
@@ -1,6 +1,6 @@
1
1
  import { BaseBlueprint as r } from "./blueprint/base-blueprint.js";
2
2
  import { toRefIdOrPoint as s } from "./blueprint/utils.js";
3
- import { n as c, c as a } from "./constants-BMg7uvpO.js";
3
+ import { n as c, c as a } from "./constants-BT-9-x_4.js";
4
4
  const h = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
5
5
  let o = (i = 21) => {
6
6
  let t = "", e = crypto.getRandomValues(new Uint8Array(i |= 0));
@@ -4,6 +4,9 @@ import { VivariumBlueprint } from '../blueprint/vivarium-blueprint';
4
4
  * Creates a new vivarium builder used to define elements, kinds, and rules.
5
5
  *
6
6
  * @param neighborhoodName - The neighborhood type to use. Defaults to `"square"` (Moore neighborhood, 8 neighbors). Use `"cross"` for a von Neumann neighborhood (4 neighbors).
7
+ * @param options - Optional configuration object. Use `{ wrapping: true }` to enable toroidal grid wrapping. Defaults to non-wrapping.
7
8
  * @returns A {@link VivariumBlueprint} instance.
8
9
  */
9
- export declare function vivarium<N extends Neighborhood = "square">(neighborhoodName?: N): VivariumBlueprint<N>;
10
+ export declare function vivarium<N extends Neighborhood = "square">(neighborhoodName?: N, options?: {
11
+ wrapping?: boolean;
12
+ }): VivariumBlueprint<N>;
@@ -1,7 +1,7 @@
1
- import { VivariumBlueprint as i } from "../blueprint/vivarium-blueprint.js";
2
- function t(r) {
3
- return new i(r);
1
+ import { VivariumBlueprint as n } from "../blueprint/vivarium-blueprint.js";
2
+ function u(r, i) {
3
+ return new n(r, i);
4
4
  }
5
5
  export {
6
- t as vivarium
6
+ u as vivarium
7
7
  };
@@ -1,4 +1,4 @@
1
- import { G as N, a as O, T as u, v as I, b as k, O as m } from "../constants-BMg7uvpO.js";
1
+ import { G as N, a as O, T as u, v as I, b as k, O as m } from "../constants-BT-9-x_4.js";
2
2
  import { colorToABGR as g } from "../common/utils.js";
3
3
  const T = (o) => {
4
4
  if (o.some((t) => t > 31))
@@ -6,6 +6,9 @@ export declare const gridLayout: import('typegpu').TgpuBindGroupLayout<{
6
6
  dimensions: {
7
7
  uniform: d.Vec2u;
8
8
  };
9
+ wrapping: {
10
+ uniform: d.U32;
11
+ };
9
12
  colors: {
10
13
  storage: (elementCount: number) => d.WgslArray<d.U32>;
11
14
  access: "mutable";