@dreamboard-games/sdk 0.5.0-alpha.14 → 0.5.0-alpha.15

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.
@@ -7098,14 +7098,15 @@ export {
7098
7098
  isSparseMapSchema,
7099
7099
  getObjectShape,
7100
7100
  normalizeCommandParams,
7101
+ enumerateZoneHosts,
7102
+ resolveZoneAccess,
7103
+ assertContainmentAcyclic,
7104
+ assertZoneConsistency,
7101
7105
  REDUCER_CONTRACT_VERSION,
7102
7106
  assertReducerBundleContract,
7103
7107
  ZoneVisibilitySchema,
7104
7108
  TileTypeSpecSchema,
7105
7109
  GameTopologyManifestSchema,
7106
- enumerateZoneHosts,
7107
- assertContainmentAcyclic,
7108
- assertZoneConsistency,
7109
7110
  collectReducerDefinitionIndex,
7110
7111
  createIngressRuntimeCodec,
7111
7112
  noopDiagnosticsSink,
@@ -7122,4 +7123,4 @@ export {
7122
7123
  createProjectionBuilder,
7123
7124
  createReducerBundle
7124
7125
  };
7125
- //# sourceMappingURL=chunk-6ZNAIOYG.js.map
7126
+ //# sourceMappingURL=chunk-TJQTLYDI.js.map
package/dist/index.js CHANGED
@@ -71,7 +71,7 @@ import {
71
71
  } from "./chunk-ES74C2IN.js";
72
72
 
73
73
  // src/package-set.ts
74
- var DREAMBOARD_SDK_VERSION = true ? "0.5.0-alpha.14" : "0.0.0-development";
74
+ var DREAMBOARD_SDK_VERSION = true ? "0.5.0-alpha.15" : "0.0.0-development";
75
75
  var DREAMBOARD_SDK_PACKAGES = {
76
76
  "@dreamboard-games/sdk": DREAMBOARD_SDK_VERSION
77
77
  };
package/dist/reducer.js CHANGED
@@ -22,11 +22,12 @@ import {
22
22
  markManifestScopedSchema,
23
23
  noopDiagnosticsSink,
24
24
  normalizeCommandParams,
25
+ resolveZoneAccess,
25
26
  sparseCounts,
26
27
  sparseMap,
27
28
  unwrapWrappers,
28
29
  validatedReducerDefinition
29
- } from "./chunk-6ZNAIOYG.js";
30
+ } from "./chunk-TJQTLYDI.js";
30
31
  import {
31
32
  CARD_REFERENCE_PREFIX,
32
33
  boardSpaceHostId,
@@ -706,15 +707,21 @@ var boardTarget = {
706
707
  };
707
708
 
708
709
  // src/reducer/inputs/cardTarget.ts
709
- function createCardTargetBuilder(zoneIds) {
710
+ function createCardTargetBuilder(zoneIds, definitions) {
710
711
  return createTargetRuleBuilder((predicates) => ({
711
712
  ...createTargetRule(
712
713
  ({ state, playerId, q }) => {
713
714
  const zones = q.zones;
714
715
  return zoneIds.flatMap((zoneId) => {
715
- const hosts = zones(zoneId);
716
- return (hosts[playerId] ?? hosts.table ?? []).filter(
717
- (id) => Object.hasOwn(state.table.cards, id)
716
+ const definition = definitions.zoneDefinitions[zoneId];
717
+ return Object.entries(zones(zoneId)).flatMap(
718
+ ([hostId, cards]) => resolveZoneAccess(
719
+ state.table,
720
+ definitions,
721
+ definition,
722
+ hostId,
723
+ playerId
724
+ ) ? cards.filter((id) => Object.hasOwn(state.table.cards, id)) : []
718
725
  );
719
726
  });
720
727
  },
@@ -732,8 +739,11 @@ function createCardTargetBuilder(zoneIds) {
732
739
  }));
733
740
  }
734
741
  var cardTarget = {
735
- zones(zoneIds) {
736
- return createCardTargetBuilder(zoneIds);
742
+ zones(zoneIds, definitions) {
743
+ return createCardTargetBuilder(
744
+ zoneIds,
745
+ definitions
746
+ );
737
747
  }
738
748
  };
739
749
 
@@ -936,10 +946,10 @@ function applyWhere(builder, where) {
936
946
  builder
937
947
  );
938
948
  }
939
- function createFusedCardInput() {
949
+ function createFusedCardInput(contract) {
940
950
  return (options) => cardInput({
941
951
  target: applyWhere(
942
- cardTarget.zones(options.from),
952
+ cardTarget.zones(options.from, contract.manifest),
943
953
  options.where
944
954
  ).build()
945
955
  });
@@ -985,7 +995,7 @@ function createFusedBoardInputs() {
985
995
  function createBoundInputBuilders(contract) {
986
996
  return {
987
997
  board: createFusedBoardInputs(),
988
- card: createFusedCardInput(),
998
+ card: createFusedCardInput(contract),
989
999
  tile: createFusedTileInput(contract),
990
1000
  form: formInput.forState(),
991
1001
  rng: rngInput