@gamepark/rules-api 7.0.0-beta.0 → 7.0.0-beta.2
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/Action.js +1 -2
- package/dist/Bot.js +15 -37
- package/dist/Bot.js.map +1 -1
- package/dist/Competitive.js +3 -8
- package/dist/Competitive.js.map +1 -1
- package/dist/Eliminations.js +2 -5
- package/dist/Eliminations.js.map +1 -1
- package/dist/GameSetup.js +1 -2
- package/dist/HiddenInformation.js +2 -5
- package/dist/HiddenInformation.js.map +1 -1
- package/dist/LocalMovePreview.js +1 -4
- package/dist/LocalMovePreview.js.map +1 -1
- package/dist/RandomMove.js +1 -2
- package/dist/Rules.js +49 -56
- package/dist/Rules.js.map +1 -1
- package/dist/SecretInformation.js +2 -5
- package/dist/SecretInformation.js.map +1 -1
- package/dist/TimeLimit.js +1 -4
- package/dist/TimeLimit.js.map +1 -1
- package/dist/Undo.js +2 -5
- package/dist/Undo.js.map +1 -1
- package/dist/UnpredictableMove.js +1 -5
- package/dist/UnpredictableMove.js.map +1 -1
- package/dist/index.js +16 -32
- package/dist/index.js.map +1 -1
- package/dist/material/HiddenMaterialRules.js +125 -180
- package/dist/material/HiddenMaterialRules.js.map +1 -1
- package/dist/material/MaterialGame.js +1 -2
- package/dist/material/MaterialGameSetup.js +52 -70
- package/dist/material/MaterialGameSetup.js.map +1 -1
- package/dist/material/MaterialRules.js +186 -250
- package/dist/material/MaterialRules.js.map +1 -1
- package/dist/material/SecretMaterialRules.js +9 -35
- package/dist/material/SecretMaterialRules.js.map +1 -1
- package/dist/material/index.js +11 -27
- package/dist/material/index.js.map +1 -1
- package/dist/material/items/Material.js +177 -262
- package/dist/material/items/Material.js.map +1 -1
- package/dist/material/items/MaterialDeck.js +10 -36
- package/dist/material/items/MaterialDeck.js.map +1 -1
- package/dist/material/items/MaterialItem.js +1 -2
- package/dist/material/items/MaterialMoney.js +89 -141
- package/dist/material/items/MaterialMoney.js.map +1 -1
- package/dist/material/items/MaterialMutator.js +108 -145
- package/dist/material/items/MaterialMutator.js.map +1 -1
- package/dist/material/items/index.js +5 -21
- package/dist/material/items/index.js.map +1 -1
- package/dist/material/location/Location.js +1 -14
- package/dist/material/location/Location.js.map +1 -1
- package/dist/material/location/LocationBuilder.js +26 -41
- package/dist/material/location/LocationBuilder.js.map +1 -1
- package/dist/material/location/index.js +3 -19
- package/dist/material/location/index.js.map +1 -1
- package/dist/material/location/strategy/FillGapStrategy.js +9 -16
- package/dist/material/location/strategy/FillGapStrategy.js.map +1 -1
- package/dist/material/location/strategy/LocationStrategy.js +1 -2
- package/dist/material/location/strategy/PositiveSequenceStrategy.js +26 -35
- package/dist/material/location/strategy/PositiveSequenceStrategy.js.map +1 -1
- package/dist/material/location/strategy/StackingStrategy.js +15 -22
- package/dist/material/location/strategy/StackingStrategy.js.map +1 -1
- package/dist/material/location/strategy/index.js +5 -23
- package/dist/material/location/strategy/index.js.map +1 -1
- package/dist/material/memory/GameMemory.js +10 -14
- package/dist/material/memory/GameMemory.js.map +1 -1
- package/dist/material/memory/PlayerMemory.js +13 -18
- package/dist/material/memory/PlayerMemory.js.map +1 -1
- package/dist/material/memory/index.js +2 -18
- package/dist/material/memory/index.js.map +1 -1
- package/dist/material/moves/CustomMove.js +4 -9
- package/dist/material/moves/CustomMove.js.map +1 -1
- package/dist/material/moves/MaterialMove.js +1 -2
- package/dist/material/moves/MaterialMoveBuilder.js +16 -32
- package/dist/material/moves/MaterialMoveBuilder.js.map +1 -1
- package/dist/material/moves/MoveKind.js +2 -5
- package/dist/material/moves/MoveKind.js.map +1 -1
- package/dist/material/moves/index.js +7 -23
- package/dist/material/moves/index.js.map +1 -1
- package/dist/material/moves/items/CreateItem.js +6 -12
- package/dist/material/moves/items/CreateItem.js.map +1 -1
- package/dist/material/moves/items/CreateItemsAtOnce.js +6 -12
- package/dist/material/moves/items/CreateItemsAtOnce.js.map +1 -1
- package/dist/material/moves/items/DeleteItem.js +6 -12
- package/dist/material/moves/items/DeleteItem.js.map +1 -1
- package/dist/material/moves/items/DeleteItemsAtOnce.js +6 -12
- package/dist/material/moves/items/DeleteItemsAtOnce.js.map +1 -1
- package/dist/material/moves/items/ItemMove.js +1 -2
- package/dist/material/moves/items/ItemMoveType.js +2 -5
- package/dist/material/moves/items/ItemMoveType.js.map +1 -1
- package/dist/material/moves/items/MoveItem.js +6 -12
- package/dist/material/moves/items/MoveItem.js.map +1 -1
- package/dist/material/moves/items/MoveItemsAtOnce.js +6 -12
- package/dist/material/moves/items/MoveItemsAtOnce.js.map +1 -1
- package/dist/material/moves/items/RollItem.js +6 -12
- package/dist/material/moves/items/RollItem.js.map +1 -1
- package/dist/material/moves/items/SelectItem.js +6 -12
- package/dist/material/moves/items/SelectItem.js.map +1 -1
- package/dist/material/moves/items/Shuffle.js +7 -14
- package/dist/material/moves/items/Shuffle.js.map +1 -1
- package/dist/material/moves/items/index.js +11 -27
- package/dist/material/moves/items/index.js.map +1 -1
- package/dist/material/moves/local/CloseTutorialPopup.js +4 -7
- package/dist/material/moves/local/CloseTutorialPopup.js.map +1 -1
- package/dist/material/moves/local/DisplayHelp.js +2 -5
- package/dist/material/moves/local/DisplayHelp.js.map +1 -1
- package/dist/material/moves/local/DropItem.js +1 -2
- package/dist/material/moves/local/LocalMove.js +2 -5
- package/dist/material/moves/local/LocalMove.js.map +1 -1
- package/dist/material/moves/local/SetTutorialStep.js +4 -7
- package/dist/material/moves/local/SetTutorialStep.js.map +1 -1
- package/dist/material/moves/local/index.js +5 -21
- package/dist/material/moves/local/index.js.map +1 -1
- package/dist/material/moves/rules/EndGame.js +4 -7
- package/dist/material/moves/rules/EndGame.js.map +1 -1
- package/dist/material/moves/rules/EndPlayerTurn.js +4 -7
- package/dist/material/moves/rules/EndPlayerTurn.js.map +1 -1
- package/dist/material/moves/rules/RuleMove.js +3 -7
- package/dist/material/moves/rules/RuleMove.js.map +1 -1
- package/dist/material/moves/rules/StartPlayerTurn.js +4 -7
- package/dist/material/moves/rules/StartPlayerTurn.js.map +1 -1
- package/dist/material/moves/rules/StartRule.js +4 -7
- package/dist/material/moves/rules/StartRule.js.map +1 -1
- package/dist/material/moves/rules/StartSimultaneousRule.js +4 -7
- package/dist/material/moves/rules/StartSimultaneousRule.js.map +1 -1
- package/dist/material/moves/rules/index.js +6 -22
- package/dist/material/moves/rules/index.js.map +1 -1
- package/dist/material/rules/MaterialRulesPart.js +38 -63
- package/dist/material/rules/MaterialRulesPart.js.map +1 -1
- package/dist/material/rules/PlayerTurnRule.js +20 -52
- package/dist/material/rules/PlayerTurnRule.js.map +1 -1
- package/dist/material/rules/RuleStep.js +1 -2
- package/dist/material/rules/SimultaneousRule.js +19 -51
- package/dist/material/rules/SimultaneousRule.js.map +1 -1
- package/dist/material/rules/index.js +4 -20
- package/dist/material/rules/index.js.map +1 -1
- package/dist/material/tutorial/TutorialState.js +1 -2
- package/dist/material/tutorial/index.js +1 -17
- package/dist/material/tutorial/index.js.map +1 -1
- package/dist/options/EnumArrayOption.js +3 -6
- package/dist/options/EnumArrayOption.js.map +1 -1
- package/dist/options/EnumOption.js +1 -4
- package/dist/options/EnumOption.js.map +1 -1
- package/dist/options/Option.js +1 -2
- package/dist/options/OptionSpecOf.js +1 -2
- package/dist/options/OptionsSpec.js +1 -2
- package/dist/options/OptionsValidationError.js +6 -28
- package/dist/options/OptionsValidationError.js.map +1 -1
- package/dist/options/PlayerEnumOption.js +19 -29
- package/dist/options/PlayerEnumOption.js.map +1 -1
- package/dist/options/PlayersOptionsSpec.js +1 -2
- package/dist/options/WithIdOption.js +1 -2
- package/dist/options/WithPlayerOptionsSpec.js +1 -4
- package/dist/options/WithPlayerOptionsSpec.js.map +1 -1
- package/dist/options/WithPlayersOptions.js +1 -2
- package/dist/options/index.js +12 -28
- package/dist/options/index.js.map +1 -1
- package/dist/options/isWithPlayerIdOptions.js +3 -6
- package/dist/options/isWithPlayerIdOptions.js.map +1 -1
- package/dist/utils/action-view.util.js +18 -25
- package/dist/utils/action-view.util.js.map +1 -1
- package/dist/utils/action.util.js +11 -16
- package/dist/utils/action.util.js.map +1 -1
- package/dist/utils/adjacent-groups.util.js +33 -41
- package/dist/utils/adjacent-groups.util.js.map +1 -1
- package/dist/utils/automatic-moves.util.js +10 -15
- package/dist/utils/automatic-moves.util.js.map +1 -1
- package/dist/utils/enum.util.js +7 -13
- package/dist/utils/enum.util.js.map +1 -1
- package/dist/utils/game-view.util.js +5 -8
- package/dist/utils/game-view.util.js.map +1 -1
- package/dist/utils/grid.hex.util.js +36 -88
- package/dist/utils/grid.hex.util.js.map +1 -1
- package/dist/utils/grid.squares.util.js +8 -19
- package/dist/utils/grid.squares.util.js.map +1 -1
- package/dist/utils/grid.util.js +1 -5
- package/dist/utils/grid.util.js.map +1 -1
- package/dist/utils/index.js +16 -32
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/listing.util.js +8 -13
- package/dist/utils/listing.util.js.map +1 -1
- package/dist/utils/loops.util.js +3 -6
- package/dist/utils/loops.util.js.map +1 -1
- package/dist/utils/money.util.js +54 -73
- package/dist/utils/money.util.js.map +1 -1
- package/dist/utils/neighbors.util.js +6 -10
- package/dist/utils/neighbors.util.js.map +1 -1
- package/dist/utils/polyhex.util.js +36 -56
- package/dist/utils/polyhex.util.js.map +1 -1
- package/dist/utils/random.util.js +2 -5
- package/dist/utils/random.util.js.map +1 -1
- package/dist/utils/rank.util.js +9 -13
- package/dist/utils/rank.util.js.map +1 -1
- package/package.json +43 -37
- package/dist/ApplyAutomaticMoves.d.ts +0 -2
- package/dist/ApplyAutomaticMoves.js +0 -25
- package/dist/ApplyAutomaticMoves.js.map +0 -1
- package/dist/DefaultGameSetup.d.ts +0 -7
- package/dist/DefaultGameSetup.js +0 -15
- package/dist/DefaultGameSetup.js.map +0 -1
- package/dist/Dummy.d.ts +0 -7
- package/dist/Dummy.js +0 -27
- package/dist/Dummy.js.map +0 -1
- package/dist/GameSetupCreator.d.ts +0 -4
- package/dist/GameSetupCreator.js +0 -3
- package/dist/GameSetupCreator.js.map +0 -1
- package/dist/IncompleteInformation.d.ts +0 -14
- package/dist/IncompleteInformation.js +0 -38
- package/dist/IncompleteInformation.js.map +0 -1
- package/dist/LoopWithFuse.d.ts +0 -4
- package/dist/LoopWithFuse.js +0 -15
- package/dist/LoopWithFuse.js.map +0 -1
- package/dist/Robot.d.ts +0 -1
- package/dist/Robot.js +0 -3
- package/dist/Robot.js.map +0 -1
- package/dist/RulesCreator.d.ts +0 -7
- package/dist/RulesCreator.js +0 -3
- package/dist/RulesCreator.js.map +0 -1
- package/dist/material/location/strategy/StakingStrategy.d.ts +0 -12
- package/dist/material/location/strategy/StakingStrategy.js +0 -32
- package/dist/material/location/strategy/StakingStrategy.js.map +0 -1
- package/dist/material/moves/items/ItemMovesBuilder.d.ts +0 -8
- package/dist/material/moves/items/ItemMovesBuilder.js +0 -34
- package/dist/material/moves/items/ItemMovesBuilder.js.map +0 -1
- package/dist/material/rules/MaterialMoveBuilder.d.ts +0 -9
- package/dist/material/rules/MaterialMoveBuilder.js +0 -28
- package/dist/material/rules/MaterialMoveBuilder.js.map +0 -1
- package/dist/material/rules/MaterialRulesMovesBuilder.d.ts +0 -12
- package/dist/material/rules/MaterialRulesMovesBuilder.js +0 -36
- package/dist/material/rules/MaterialRulesMovesBuilder.js.map +0 -1
- package/dist/setup/DefaultGameSetup.d.ts +0 -7
- package/dist/setup/DefaultGameSetup.js +0 -15
- package/dist/setup/DefaultGameSetup.js.map +0 -1
- package/dist/setup/GameSetup.d.ts +0 -3
- package/dist/setup/GameSetup.js +0 -3
- package/dist/setup/GameSetup.js.map +0 -1
- package/dist/setup/GameSetupCreator.d.ts +0 -4
- package/dist/setup/GameSetupCreator.js +0 -3
- package/dist/setup/GameSetupCreator.js.map +0 -1
- package/dist/setup/index.d.ts +0 -2
- package/dist/setup/index.js +0 -19
- package/dist/setup/index.js.map +0 -1
- package/dist/utils/EnumUtils.d.ts +0 -1
- package/dist/utils/EnumUtils.js +0 -8
- package/dist/utils/EnumUtils.js.map +0 -1
- package/dist/utils/coordinates.util.d.ts +0 -5
- package/dist/utils/coordinates.util.js +0 -16
- package/dist/utils/coordinates.util.js.map +0 -1
- package/dist/utils/isDeadEndMove.util.d.ts +0 -2
- package/dist/utils/isDeadEndMove.util.js +0 -19
- package/dist/utils/isDeadEndMove.util.js.map +0 -1
|
@@ -1,296 +1,241 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
29
|
-
var t = {};
|
|
30
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
31
|
-
t[p] = s[p];
|
|
32
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
33
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
34
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
35
|
-
t[p[i]] = s[p[i]];
|
|
36
|
-
}
|
|
37
|
-
return t;
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.hideFront = exports.hideItemId = exports.HiddenMaterialRules = void 0;
|
|
41
|
-
var es_toolkit_1 = require("es-toolkit");
|
|
42
|
-
var compat_1 = require("es-toolkit/compat");
|
|
43
|
-
var MaterialRules_1 = require("./MaterialRules");
|
|
44
|
-
var moves_1 = require("./moves");
|
|
1
|
+
import { difference, isEqual, mapValues } from 'es-toolkit';
|
|
2
|
+
import { get, keys, set, unset } from 'es-toolkit/compat';
|
|
3
|
+
import { MaterialRules } from './MaterialRules';
|
|
4
|
+
import { isCreateItem, isCreateItemsAtOnce, isMoveItem, isMoveItemsAtOnce, isShuffle, ItemMoveType, MoveKind } from './moves';
|
|
45
5
|
/**
|
|
46
6
|
* Implement HiddenMaterialRules when you want to use the {@link MaterialRules} approach with {@link HiddenInformation}.
|
|
47
7
|
* Using some {@link HidingStrategy} allows to enforce the security of a game with hidden information easily.
|
|
48
8
|
* If the game has secret information (some players have information not available to others, link cards in their hand), then you
|
|
49
9
|
* must implement {@link SecretMaterialRules} instead.
|
|
50
10
|
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return _this;
|
|
11
|
+
export class HiddenMaterialRules extends MaterialRules {
|
|
12
|
+
client;
|
|
13
|
+
constructor(game, client) {
|
|
14
|
+
super(game);
|
|
15
|
+
this.client = client;
|
|
57
16
|
}
|
|
58
|
-
|
|
17
|
+
randomize(move, player) {
|
|
59
18
|
if (player !== undefined && this.isRevealingItemMove(move, player)) {
|
|
60
19
|
// We need to know if a MoveItem has revealed something to the player to prevent the undo in that case.
|
|
61
20
|
// To know that, we need the position of the item before the move.
|
|
62
21
|
// To prevent having to recalculate the game state before the move, we flag the move in the database with "reveal: {}".
|
|
63
22
|
// This flag indicate that something was revealed to someone.
|
|
64
23
|
// We use the "randomize" function because is the where we can "preprocess" the move and transform it after checking it is legal and before it is saved.
|
|
65
|
-
return
|
|
24
|
+
return { ...move, reveal: {} };
|
|
66
25
|
}
|
|
67
|
-
return
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return (
|
|
71
|
-
|| (
|
|
72
|
-
}
|
|
26
|
+
return super.randomize(move);
|
|
27
|
+
}
|
|
28
|
+
isRevealingItemMove(move, player) {
|
|
29
|
+
return (isMoveItem(move) && this.moveItemWillRevealSomething(move, player))
|
|
30
|
+
|| (isMoveItemsAtOnce(move) && this.moveAtOnceWillRevealSomething(move, player));
|
|
31
|
+
}
|
|
73
32
|
/**
|
|
74
33
|
* Items that can be hidden cannot merge by default, to prevent hidden items to merge only because they have no id.
|
|
75
34
|
*/
|
|
76
|
-
|
|
35
|
+
itemsCanMerge(type) {
|
|
77
36
|
return !this.hidingStrategies[type];
|
|
78
|
-
}
|
|
37
|
+
}
|
|
79
38
|
/**
|
|
80
39
|
* Moves that reveal some information (like drawing a card) cannot be predicted by the player.
|
|
81
40
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if ((0, moves_1.isMoveItem)(move)) {
|
|
41
|
+
isUnpredictableMove(move, player) {
|
|
42
|
+
if (isMoveItem(move)) {
|
|
85
43
|
return this.moveItemWillRevealSomething(move, player);
|
|
86
44
|
}
|
|
87
|
-
else if (
|
|
45
|
+
else if (isMoveItemsAtOnce(move)) {
|
|
88
46
|
return this.moveAtOnceWillRevealSomething(move, player);
|
|
89
47
|
}
|
|
90
|
-
else if (
|
|
48
|
+
else if (isCreateItem(move)) {
|
|
91
49
|
return this.itemHasHiddenInformation(move.itemType, move.item, player);
|
|
92
50
|
}
|
|
93
|
-
else if (
|
|
94
|
-
return move.items.some(
|
|
51
|
+
else if (isCreateItemsAtOnce(move)) {
|
|
52
|
+
return move.items.some(item => this.itemHasHiddenInformation(move.itemType, item, player));
|
|
95
53
|
}
|
|
96
|
-
else if (
|
|
54
|
+
else if (isShuffle(move)) {
|
|
97
55
|
return true;
|
|
98
56
|
}
|
|
99
57
|
else {
|
|
100
|
-
return
|
|
58
|
+
return super.isUnpredictableMove(move, player);
|
|
101
59
|
}
|
|
102
|
-
}
|
|
60
|
+
}
|
|
103
61
|
/**
|
|
104
62
|
* Moves than reveals an information to someone cannot be undone by default
|
|
105
63
|
*/
|
|
106
|
-
|
|
107
|
-
return
|
|
108
|
-
}
|
|
64
|
+
moveBlocksUndo(move, player) {
|
|
65
|
+
return super.moveBlocksUndo(move, player) || this.moveRevealedSomething(move);
|
|
66
|
+
}
|
|
109
67
|
/**
|
|
110
68
|
* @param move A move to test
|
|
111
69
|
* @returns true if the move revealed something to some player
|
|
112
70
|
*/
|
|
113
|
-
|
|
114
|
-
return (
|
|
115
|
-
}
|
|
71
|
+
moveRevealedSomething(move) {
|
|
72
|
+
return (isMoveItem(move) || isMoveItemsAtOnce(move)) && !!move.reveal;
|
|
73
|
+
}
|
|
116
74
|
/**
|
|
117
75
|
* With the material approach, we can offer a default working implementation for {@link HiddenInformation.getView}
|
|
118
76
|
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
77
|
+
getView(player) {
|
|
78
|
+
return {
|
|
79
|
+
...this.game,
|
|
80
|
+
items: mapValues(this.game.items, (items, itemsType) => {
|
|
81
|
+
const hidingStrategies = this.hidingStrategies[itemsType];
|
|
123
82
|
if (!hidingStrategies || !items)
|
|
124
83
|
return items;
|
|
125
|
-
return items.map(
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
84
|
+
return items.map(item => this.hideItem(itemsType, item, player));
|
|
85
|
+
})
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
hideItem(type, item, player) {
|
|
89
|
+
const paths = this.getItemHiddenPaths(type, item, player);
|
|
130
90
|
if (!paths.length)
|
|
131
91
|
return item;
|
|
132
|
-
|
|
133
|
-
for (
|
|
134
|
-
|
|
135
|
-
(0, compat_1.unset)(hiddenItem, path);
|
|
92
|
+
const hiddenItem = JSON.parse(JSON.stringify(item));
|
|
93
|
+
for (const path of paths) {
|
|
94
|
+
unset(hiddenItem, path);
|
|
136
95
|
}
|
|
137
96
|
return hiddenItem;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
return hiddenPaths.flatMap(function (path) {
|
|
97
|
+
}
|
|
98
|
+
getItemHiddenPaths(type, item, player) {
|
|
99
|
+
const hidingStrategy = this.hidingStrategies[type]?.[item.location.type];
|
|
100
|
+
const hiddenPaths = hidingStrategy ? hidingStrategy(item, player) : [];
|
|
101
|
+
return hiddenPaths.flatMap((path) => {
|
|
144
102
|
if (!path)
|
|
145
103
|
console.error('Empty paths are not allowed in hiding strategies');
|
|
146
|
-
|
|
104
|
+
const itemAtPath = get(item, path);
|
|
147
105
|
if (typeof itemAtPath === 'object') {
|
|
148
|
-
return
|
|
106
|
+
return keys(itemAtPath).map((key) => path + '.' + key);
|
|
149
107
|
}
|
|
150
108
|
else {
|
|
151
109
|
return [path];
|
|
152
110
|
}
|
|
153
111
|
});
|
|
154
|
-
}
|
|
155
|
-
|
|
112
|
+
}
|
|
113
|
+
itemHasHiddenInformation(type, item, player) {
|
|
156
114
|
return this.getItemHiddenPaths(type, item, player).length > 0;
|
|
157
|
-
}
|
|
115
|
+
}
|
|
158
116
|
/**
|
|
159
117
|
* To be able to know if a MoveItem cannot be undone, the server flags the moves with a "reveal" property.
|
|
160
118
|
* This difference must be integrated without error during the callback.
|
|
161
119
|
*/
|
|
162
|
-
|
|
163
|
-
if (
|
|
164
|
-
|
|
165
|
-
return
|
|
120
|
+
canIgnoreServerDifference(clientMove, serverMove) {
|
|
121
|
+
if (isMoveItem(clientMove) && isMoveItem(serverMove)) {
|
|
122
|
+
const { reveal, ...serverMoveWithoutReveal } = serverMove;
|
|
123
|
+
return isEqual(clientMove, serverMoveWithoutReveal);
|
|
166
124
|
}
|
|
167
125
|
return false;
|
|
168
|
-
}
|
|
126
|
+
}
|
|
169
127
|
/**
|
|
170
128
|
* With the material approach, we can offer a default working implementation for {@link HiddenInformation.getMoveView}
|
|
171
129
|
*/
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if (move.kind === moves_1.MoveKind.ItemMove && move.itemType in this.hidingStrategies) {
|
|
130
|
+
getMoveView(move, player) {
|
|
131
|
+
if (move.kind === MoveKind.ItemMove && move.itemType in this.hidingStrategies) {
|
|
175
132
|
switch (move.type) {
|
|
176
|
-
case
|
|
133
|
+
case ItemMoveType.Move:
|
|
177
134
|
return this.getMoveItemView(move, player);
|
|
178
|
-
case
|
|
135
|
+
case ItemMoveType.MoveAtOnce:
|
|
179
136
|
return this.getMoveAtOnceView(move, player);
|
|
180
|
-
case
|
|
181
|
-
return
|
|
182
|
-
case
|
|
183
|
-
return
|
|
184
|
-
case
|
|
137
|
+
case ItemMoveType.Create:
|
|
138
|
+
return { ...move, item: this.hideItem(move.itemType, move.item, player) };
|
|
139
|
+
case ItemMoveType.CreateAtOnce:
|
|
140
|
+
return { ...move, items: move.items.map(item => this.hideItem(move.itemType, item, player)) };
|
|
141
|
+
case ItemMoveType.Shuffle:
|
|
185
142
|
return this.getShuffleItemsView(move, player);
|
|
186
143
|
}
|
|
187
144
|
}
|
|
188
145
|
return move;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
146
|
+
}
|
|
147
|
+
getMoveItemView(move, player) {
|
|
148
|
+
const revealedPaths = this.getMoveItemRevealedPath(move, player);
|
|
192
149
|
if (!revealedPaths.length)
|
|
193
150
|
return move;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
for (
|
|
197
|
-
|
|
198
|
-
(0, compat_1.set)(moveView.reveal, path, (0, compat_1.get)(item, path));
|
|
151
|
+
const item = this.material(move.itemType).getItem(move.itemIndex);
|
|
152
|
+
const moveView = { ...move, reveal: {} };
|
|
153
|
+
for (const path of revealedPaths) {
|
|
154
|
+
set(moveView.reveal, path, get(item, path));
|
|
199
155
|
}
|
|
200
156
|
return moveView;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
for (
|
|
205
|
-
|
|
206
|
-
var revealedPaths = this.getMoveAtOnceRevealedPath(move, index, player);
|
|
157
|
+
}
|
|
158
|
+
getMoveAtOnceView(move, player) {
|
|
159
|
+
const moveView = { ...move };
|
|
160
|
+
for (const index of move.indexes) {
|
|
161
|
+
const revealedPaths = this.getMoveAtOnceRevealedPath(move, index, player);
|
|
207
162
|
if (!revealedPaths.length)
|
|
208
163
|
continue;
|
|
209
164
|
if (!moveView.reveal)
|
|
210
165
|
moveView.reveal = {};
|
|
211
166
|
moveView.reveal[index] = {};
|
|
212
|
-
|
|
213
|
-
for (
|
|
214
|
-
|
|
215
|
-
(0, compat_1.set)(moveView.reveal[index], path, (0, compat_1.get)(item, path));
|
|
167
|
+
const item = this.material(move.itemType).getItem(index);
|
|
168
|
+
for (const path of revealedPaths) {
|
|
169
|
+
set(moveView.reveal[index], path, get(item, path));
|
|
216
170
|
}
|
|
217
171
|
}
|
|
218
172
|
return moveView;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return
|
|
231
|
-
}
|
|
232
|
-
|
|
173
|
+
}
|
|
174
|
+
getMoveItemRevealedPath(move, player) {
|
|
175
|
+
const item = this.material(move.itemType).getItem(move.itemIndex);
|
|
176
|
+
const hiddenPathsBefore = this.getItemHiddenPaths(move.itemType, item, player);
|
|
177
|
+
const hiddenPathsAfter = this.getItemHiddenPaths(move.itemType, this.mutator(move.itemType).getItemAfterMove(move), player);
|
|
178
|
+
return difference(hiddenPathsBefore, hiddenPathsAfter);
|
|
179
|
+
}
|
|
180
|
+
getMoveAtOnceRevealedPath(move, itemIndex, player) {
|
|
181
|
+
const item = this.material(move.itemType).getItem(itemIndex);
|
|
182
|
+
const hiddenPathsBefore = this.getItemHiddenPaths(move.itemType, item, player);
|
|
183
|
+
const hiddenPathsAfter = this.getItemHiddenPaths(move.itemType, this.mutator(move.itemType).getItemAfterMoveAtOnce(move, itemIndex), player);
|
|
184
|
+
return difference(hiddenPathsBefore, hiddenPathsAfter);
|
|
185
|
+
}
|
|
186
|
+
moveItemWillRevealSomething(move, player) {
|
|
233
187
|
return this.getMoveItemRevealedPath(move, player).length > 0;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
HiddenMaterialRules.prototype.getShuffleItemsView = function (move, player) {
|
|
188
|
+
}
|
|
189
|
+
moveAtOnceWillRevealSomething(move, player) {
|
|
190
|
+
return move.indexes.some((index) => this.getMoveAtOnceRevealedPath(move, index, player).length);
|
|
191
|
+
}
|
|
192
|
+
getShuffleItemsView(move, player) {
|
|
240
193
|
if (this.canSeeShuffleResult(move, player))
|
|
241
194
|
return move;
|
|
242
|
-
|
|
195
|
+
const { newIndexes, ...moveView } = move;
|
|
243
196
|
return moveView;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
var _this = this;
|
|
197
|
+
}
|
|
198
|
+
canSeeShuffleResult(move, player) {
|
|
247
199
|
if (!this.hidingStrategies[move.itemType])
|
|
248
200
|
return true;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (process.env.NODE_ENV === 'development' && move.indexes.some(
|
|
252
|
-
|
|
253
|
-
})) {
|
|
254
|
-
throw new RangeError("You cannot shuffle items with different hiding strategies: ".concat(JSON.stringify(move.indexes.map(function (index) { return _this.getItemHiddenPaths(move.itemType, material.getItem(index), player); }))));
|
|
201
|
+
const material = this.material(move.itemType);
|
|
202
|
+
const hiddenPaths = this.getItemHiddenPaths(move.itemType, material.getItem(move.indexes[0]), player);
|
|
203
|
+
if (process.env.NODE_ENV === 'development' && move.indexes.some(index => !isEqual(hiddenPaths, this.getItemHiddenPaths(move.itemType, material.getItem(index), player)))) {
|
|
204
|
+
throw new RangeError(`You cannot shuffle items with different hiding strategies: ${JSON.stringify(move.indexes.map(index => this.getItemHiddenPaths(move.itemType, material.getItem(index), player)))}`);
|
|
255
205
|
}
|
|
256
206
|
// TODO: if we shuffle a hand of items partially hidden, we should send the partially visible information to the client.
|
|
257
207
|
// Example: It's a Wonderful World with the Extension: the back face of the player's hand are different
|
|
258
208
|
// => when the hand is shuffled we should see where the expansion cards land.
|
|
259
209
|
return !hiddenPaths.length;
|
|
260
|
-
}
|
|
210
|
+
}
|
|
261
211
|
/**
|
|
262
212
|
* Override of {@link MaterialRules.play} that also removes the hidden information from items, for example when a card is flipped face down
|
|
263
213
|
*/
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if (this.client &&
|
|
267
|
-
|
|
214
|
+
play(move, context) {
|
|
215
|
+
const result = super.play(move, context);
|
|
216
|
+
if (this.client && isMoveItem(move) && this.hidingStrategies[move.itemType]) {
|
|
217
|
+
const item = this.material(move.itemType).getItem(move.itemIndex);
|
|
268
218
|
if (item) {
|
|
269
219
|
this.game.items[move.itemType][move.itemIndex] = this.hideItem(move.itemType, item, this.client.player);
|
|
270
220
|
}
|
|
271
221
|
}
|
|
272
|
-
if (this.client &&
|
|
273
|
-
for (
|
|
274
|
-
|
|
275
|
-
var item = this.material(move.itemType).getItem(index);
|
|
222
|
+
if (this.client && isMoveItemsAtOnce(move) && this.hidingStrategies[move.itemType]) {
|
|
223
|
+
for (const index of move.indexes) {
|
|
224
|
+
const item = this.material(move.itemType).getItem(index);
|
|
276
225
|
if (item) {
|
|
277
226
|
this.game.items[move.itemType][index] = this.hideItem(move.itemType, item, this.client.player);
|
|
278
227
|
}
|
|
279
228
|
}
|
|
280
229
|
}
|
|
281
230
|
return result;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
}(MaterialRules_1.MaterialRules));
|
|
285
|
-
exports.HiddenMaterialRules = HiddenMaterialRules;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
286
233
|
/**
|
|
287
234
|
* Hiding strategy that removes the item id
|
|
288
235
|
*/
|
|
289
|
-
|
|
290
|
-
exports.hideItemId = hideItemId;
|
|
236
|
+
export const hideItemId = () => ['id'];
|
|
291
237
|
/**
|
|
292
238
|
* Hiding strategy that removes "id.front" from the item (when we have cards with composite ids, back & front)
|
|
293
239
|
*/
|
|
294
|
-
|
|
295
|
-
exports.hideFront = hideFront;
|
|
240
|
+
export const hideFront = () => ['id.front'];
|
|
296
241
|
//# sourceMappingURL=HiddenMaterialRules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenMaterialRules.js","sourceRoot":"","sources":["../../src/material/HiddenMaterialRules.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HiddenMaterialRules.js","sourceRoot":"","sources":["../../src/material/HiddenMaterialRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAKzD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,YAAY,EAMZ,QAAQ,EAGT,MAAM,SAAS,CAAA;AAGhB;;;;;GAKG;AACH,MAAM,OAAgB,mBACpB,SAAQ,aAAyB;IAG4B;IAA7D,YAAY,IAA8B,EAAmB,MAAuB;QAClF,KAAK,CAAC,IAAI,CAAC,CAAA;QADgD,WAAM,GAAN,MAAM,CAAiB;IAEpF,CAAC;IAUD,SAAS,CAAC,IAA8B,EAAE,MAAU;QAClD,IAAI,MAAM,KAAK,SAAS,IAAI,IAAI,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