@gamepark/react-game 6.24.1 → 6.24.3
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/components/Avatar/Avatar.d.ts +4 -6
- package/dist/components/Avatar/Avatar.js +5 -4
- package/dist/components/Avatar/Avatar.js.map +1 -1
- package/dist/components/Avatar/ChatSpeechBubble.js +3 -2
- package/dist/components/Avatar/ChatSpeechBubble.js.map +1 -1
- package/dist/components/Avatar/SpeechBubble.d.ts +1 -0
- package/dist/components/Avatar/SpeechBubble.js +2 -1
- package/dist/components/Avatar/SpeechBubble.js.map +1 -1
- package/dist/components/GamePoints/GamePointIcon.js +1 -0
- package/dist/components/GamePoints/GamePointIcon.js.map +1 -1
- package/dist/components/GamePoints/GamePoints.js +1 -0
- package/dist/components/GamePoints/GamePoints.js.map +1 -1
- package/dist/components/GameProvider/GameContext.js +2 -1
- package/dist/components/GameProvider/GameContext.js.map +1 -1
- package/dist/components/GameProvider/GameProvider.js +3 -0
- package/dist/components/GameProvider/GameProvider.js.map +1 -1
- package/dist/components/Header/Header.d.ts +1 -0
- package/dist/components/Header/Header.js +3 -2
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/MaterialHeader.js +1 -0
- package/dist/components/Header/MaterialHeader.js.map +1 -1
- package/dist/components/ImagesLoader/ImagesLoader.js +1 -0
- package/dist/components/ImagesLoader/ImagesLoader.js.map +1 -1
- package/dist/components/JournalTabs/Chat/Chat.d.ts +1 -0
- package/dist/components/JournalTabs/Chat/ChatMessage.js +1 -0
- package/dist/components/JournalTabs/Chat/ChatMessage.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js +1 -0
- package/dist/components/JournalTabs/Chat/ChatMessageAuthor.js.map +1 -1
- package/dist/components/JournalTabs/Chat/ChatTextInput.js +1 -0
- package/dist/components/JournalTabs/Chat/ChatTextInput.js.map +1 -1
- package/dist/components/JournalTabs/Chat/CommonChat.js +1 -0
- package/dist/components/JournalTabs/Chat/CommonChat.js.map +1 -1
- package/dist/components/JournalTabs/Chat/SignInToChat.js +1 -0
- package/dist/components/JournalTabs/Chat/SignInToChat.js.map +1 -1
- package/dist/components/JournalTabs/History/GameOverHistory.js +1 -0
- package/dist/components/JournalTabs/History/GameOverHistory.js.map +1 -1
- package/dist/components/JournalTabs/History/History.js +2 -0
- package/dist/components/JournalTabs/History/History.js.map +1 -1
- package/dist/components/JournalTabs/History/HistoryEntry.js +1 -0
- package/dist/components/JournalTabs/History/HistoryEntry.js.map +1 -1
- package/dist/components/JournalTabs/History/StartGameHistory.js +1 -0
- package/dist/components/JournalTabs/History/StartGameHistory.js.map +1 -1
- package/dist/components/JournalTabs/JournalTabs.d.ts +1 -0
- package/dist/components/JournalTabs/JournalTabs.js +5 -1
- package/dist/components/JournalTabs/JournalTabs.js.map +1 -1
- package/dist/components/Letterbox/Letterbox.js +1 -0
- package/dist/components/Letterbox/Letterbox.js.map +1 -1
- package/dist/components/LoadingScreen/LoadingScreen.js +1 -0
- package/dist/components/LoadingScreen/LoadingScreen.js.map +1 -1
- package/dist/components/Picture/Picture.d.ts +1 -0
- package/dist/components/Picture/Picture.js +1 -0
- package/dist/components/Picture/Picture.js.map +1 -1
- package/dist/components/PlayerPanel/Counters.d.ts +14 -0
- package/dist/components/PlayerPanel/Counters.js +45 -0
- package/dist/components/PlayerPanel/Counters.js.map +1 -0
- package/dist/components/PlayerPanel/PlayerPanel.js +1 -0
- package/dist/components/PlayerPanel/PlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/StyledPlayerPanel.d.ts +5 -2
- package/dist/components/PlayerPanel/StyledPlayerPanel.js +48 -15
- package/dist/components/PlayerPanel/StyledPlayerPanel.js.map +1 -1
- package/dist/components/PlayerPanel/index.d.ts +1 -0
- package/dist/components/PlayerPanel/index.js +1 -0
- package/dist/components/PlayerPanel/index.js.map +1 -1
- package/dist/components/PlayerTimer/PlayerTimer.d.ts +1 -0
- package/dist/components/PlayerTimer/PlayerTimer.js +1 -0
- package/dist/components/PlayerTimer/PlayerTimer.js.map +1 -1
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js +1 -0
- package/dist/components/buttons/PlayMoveButton/PlayMoveButton.js.map +1 -1
- package/dist/components/buttons/ThemeButton/ThemeButton.d.ts +1 -0
- package/dist/components/buttons/UndoMovesButton/UndoMovesButton.d.ts +1 -0
- package/dist/components/dialogs/Dialog.d.ts +1 -0
- package/dist/components/dialogs/Dialog.js +3 -0
- package/dist/components/dialogs/Dialog.js.map +1 -1
- package/dist/components/dialogs/FailuresDialog.js +1 -0
- package/dist/components/dialogs/FailuresDialog.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js +1 -0
- package/dist/components/dialogs/ResultDialog/RematchDisplay.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/RematchSection.js +1 -0
- package/dist/components/dialogs/ResultDialog/RematchSection.js.map +1 -1
- package/dist/components/dialogs/ResultDialog/ResultDialog.js +1 -0
- package/dist/components/dialogs/ResultDialog/ResultDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js +1 -0
- package/dist/components/dialogs/RulesDialog/LocationRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js +1 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js +1 -0
- package/dist/components/dialogs/RulesDialog/MaterialRulesDialogContent.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesDialog.js +1 -0
- package/dist/components/dialogs/RulesDialog/RulesDialog.js.map +1 -1
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js +1 -0
- package/dist/components/dialogs/RulesDialog/RulesHelpDialogContent.js.map +1 -1
- package/dist/components/material/ComponentDescription.d.ts +32 -0
- package/dist/components/material/ComponentDescription.js +15 -1
- package/dist/components/material/ComponentDescription.js.map +1 -1
- package/dist/components/material/Dices/CubicDiceDescription.d.ts +4 -4
- package/dist/components/material/Dices/CubicDiceDescription.js +6 -7
- package/dist/components/material/Dices/CubicDiceDescription.js.map +1 -1
- package/dist/components/material/DraggableMaterial.js +4 -0
- package/dist/components/material/DraggableMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/BoardDescription.js +1 -1
- package/dist/components/material/FlatMaterial/CardDescription.js +3 -3
- package/dist/components/material/FlatMaterial/CardDescription.js.map +1 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.d.ts +1 -0
- package/dist/components/material/FlatMaterial/FlatMaterial.js +2 -1
- package/dist/components/material/FlatMaterial/FlatMaterial.js.map +1 -1
- package/dist/components/material/FlatMaterial/MoneyDescription.d.ts +7 -0
- package/dist/components/material/FlatMaterial/MoneyDescription.js +39 -0
- package/dist/components/material/FlatMaterial/MoneyDescription.js.map +1 -0
- package/dist/components/material/FlatMaterial/TokenDescription.js +2 -2
- package/dist/components/material/FlatMaterial/index.d.ts +1 -0
- package/dist/components/material/FlatMaterial/index.js +1 -0
- package/dist/components/material/FlatMaterial/index.js.map +1 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.js +2 -1
- package/dist/components/material/GameTable/DynamicItemsDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameMaterialDisplay.js +1 -0
- package/dist/components/material/GameTable/GameMaterialDisplay.js.map +1 -1
- package/dist/components/material/GameTable/GameTable.d.ts +1 -0
- package/dist/components/material/GameTable/GameTable.js +1 -0
- package/dist/components/material/GameTable/GameTable.js.map +1 -1
- package/dist/components/material/GameTable/GameTableNavigation.js +1 -0
- package/dist/components/material/GameTable/GameTableNavigation.js.map +1 -1
- package/dist/components/material/GameTable/ItemDisplay.js +4 -3
- package/dist/components/material/GameTable/ItemDisplay.js.map +1 -1
- package/dist/components/material/GameTable/StaticItemsDisplay.d.ts +1 -0
- package/dist/components/material/GameTable/StaticLocationsDisplay.d.ts +1 -0
- package/dist/components/material/GameTable/focus/FocusProvider.js +1 -0
- package/dist/components/material/GameTable/focus/FocusProvider.js.map +1 -1
- package/dist/components/material/GameTable/focus/LocationsWithFocus.d.ts +3 -2
- package/dist/components/material/GameTable/focus/LocationsWithFocus.js +10 -3
- package/dist/components/material/GameTable/focus/LocationsWithFocus.js.map +1 -1
- package/dist/components/material/MaterialComponent.js +1 -0
- package/dist/components/material/MaterialComponent.js.map +1 -1
- package/dist/components/material/MaterialDescription.d.ts +119 -0
- package/dist/components/material/MaterialDescription.js +107 -1
- package/dist/components/material/MaterialDescription.js.map +1 -1
- package/dist/components/material/MobileMaterialDescription.d.ts +1 -0
- package/dist/components/material/MobileMaterialDescription.js +2 -1
- package/dist/components/material/MobileMaterialDescription.js.map +1 -1
- package/dist/components/material/Writing/WritingDescription.js +2 -1
- package/dist/components/material/Writing/WritingDescription.js.map +1 -1
- package/dist/components/material/animations/CreateItemAnimations.js +6 -4
- package/dist/components/material/animations/CreateItemAnimations.js.map +1 -1
- package/dist/components/material/animations/DeleteItemAnimations.js +12 -8
- package/dist/components/material/animations/DeleteItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ItemAnimations.d.ts +2 -1
- package/dist/components/material/animations/ItemAnimations.js +10 -1
- package/dist/components/material/animations/ItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MaterialAnimations.js +1 -1
- package/dist/components/material/animations/MaterialGameAnimations.js +2 -2
- package/dist/components/material/animations/MoveItemAnimations.d.ts +1 -2
- package/dist/components/material/animations/MoveItemAnimations.js +15 -24
- package/dist/components/material/animations/MoveItemAnimations.js.map +1 -1
- package/dist/components/material/animations/MoveItemAtOnceAnimations.d.ts +1 -2
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js +10 -20
- package/dist/components/material/animations/MoveItemAtOnceAnimations.js.map +1 -1
- package/dist/components/material/animations/RollItemAnimations.d.ts +1 -2
- package/dist/components/material/animations/RollItemAnimations.js +5 -11
- package/dist/components/material/animations/RollItemAnimations.js.map +1 -1
- package/dist/components/material/animations/ShuffleAnimations.js +1 -1
- package/dist/components/material/animations/adjustRotation.d.ts +1 -1
- package/dist/components/material/animations/adjustRotation.js +60 -19
- package/dist/components/material/animations/adjustRotation.js.map +1 -1
- package/dist/components/material/animations/isMovedOrDeletedItem.util.d.ts +1 -1
- package/dist/components/material/animations/isMovedOrDeletedItem.util.js +1 -4
- package/dist/components/material/animations/isMovedOrDeletedItem.util.js.map +1 -1
- package/dist/components/material/animations/rotations.utils.d.ts +2 -0
- package/dist/components/material/animations/rotations.utils.js +110 -0
- package/dist/components/material/animations/rotations.utils.js.map +1 -0
- package/dist/components/material/locations/DropAreaDescription.d.ts +1 -1
- package/dist/components/material/locations/DropAreaDescription.js +9 -2
- package/dist/components/material/locations/DropAreaDescription.js.map +1 -1
- package/dist/components/material/locations/LocationComponent.js +2 -1
- package/dist/components/material/locations/LocationComponent.js.map +1 -1
- package/dist/components/material/locations/LocationDescription.d.ts +7 -0
- package/dist/components/material/locations/LocationDescription.js +8 -1
- package/dist/components/material/locations/LocationDescription.js.map +1 -1
- package/dist/components/material/locations/LocationDisplay.js +1 -0
- package/dist/components/material/locations/LocationDisplay.js.map +1 -1
- package/dist/components/material/locations/LocationsMask.d.ts +2 -1
- package/dist/components/material/locations/LocationsMask.js +2 -2
- package/dist/components/material/locations/LocationsMask.js.map +1 -1
- package/dist/components/material/locations/SimpleDropArea.js +1 -0
- package/dist/components/material/locations/SimpleDropArea.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js +1 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerButton.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js +1 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerDialog.js.map +1 -1
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js +1 -0
- package/dist/components/menus/EjectPlayer/EjectPlayerPopButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenButton.js +1 -0
- package/dist/components/menus/Fullscreen/FullscreenButton.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenDialog.js +1 -0
- package/dist/components/menus/Fullscreen/FullscreenDialog.js.map +1 -1
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js +1 -0
- package/dist/components/menus/Fullscreen/FullscreenPopButton.js.map +1 -1
- package/dist/components/menus/GiveUpButton/GiveUpButton.js +1 -0
- package/dist/components/menus/GiveUpButton/GiveUpButton.js.map +1 -1
- package/dist/components/menus/Menu/Menu.js +1 -0
- package/dist/components/menus/Menu/Menu.js.map +1 -1
- package/dist/components/menus/Menu/MenuPopButton.js +1 -0
- package/dist/components/menus/Menu/MenuPopButton.js.map +1 -1
- package/dist/components/menus/Menu/NavButton.d.ts +1 -0
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js +1 -0
- package/dist/components/menus/PlayerQuit/TrackPlayersQuit.js.map +1 -1
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js +1 -0
- package/dist/components/menus/RestartTutorialButton/RestartTutorialButton.js.map +1 -1
- package/dist/components/menus/Result/ResultButton.js +1 -0
- package/dist/components/menus/Result/ResultButton.js.map +1 -1
- package/dist/components/menus/Result/ResultPopButton.js +1 -0
- package/dist/components/menus/Result/ResultPopButton.js.map +1 -1
- package/dist/components/menus/SoundButton/SoundButton.js +1 -0
- package/dist/components/menus/SoundButton/SoundButton.js.map +1 -1
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js +1 -0
- package/dist/components/menus/TimeStatsButton/TimeStatsButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoButton.js +1 -0
- package/dist/components/menus/UndoButton/UndoButton.js.map +1 -1
- package/dist/components/menus/UndoButton/UndoPopButton.js +1 -0
- package/dist/components/menus/UndoButton/UndoPopButton.js.map +1 -1
- package/dist/components/tutorial/MaterialTutorial.js +1 -1
- package/dist/components/tutorial/MaterialTutorialDisplay.js +1 -0
- package/dist/components/tutorial/MaterialTutorialDisplay.js.map +1 -1
- package/dist/components/tutorial/TutorialRulesWrapper.js +1 -0
- package/dist/components/tutorial/TutorialRulesWrapper.js.map +1 -1
- package/dist/hooks/useFullscreen.js +1 -0
- package/dist/hooks/useFullscreen.js.map +1 -1
- package/dist/hooks/useOpponentWithMaxTime.d.ts +3 -0
- package/dist/hooks/useOpponentWithMaxTime.js +3 -0
- package/dist/hooks/useOpponentWithMaxTime.js.map +1 -1
- package/dist/hooks/usePlayerTime.js +1 -1
- package/dist/hooks/usePlayerTime.js.map +1 -1
- package/dist/hooks/usePlayers.js +14 -1
- package/dist/hooks/usePlayers.js.map +1 -1
- package/dist/hooks/useResultText.js +1 -0
- package/dist/hooks/useResultText.js.map +1 -1
- package/dist/hooks/useSound.js +1 -0
- package/dist/hooks/useSound.js.map +1 -1
- package/dist/hooks/useWebP.js +2 -2
- package/dist/hooks/useWebP.js.map +1 -1
- package/dist/hooks/useZoomToElements.d.ts +3 -0
- package/dist/hooks/useZoomToElements.js +3 -0
- package/dist/hooks/useZoomToElements.js.map +1 -1
- package/dist/locators/DeckLocator.d.ts +3 -0
- package/dist/locators/DeckLocator.js +4 -1
- package/dist/locators/DeckLocator.js.map +1 -1
- package/dist/locators/FlexLocator.d.ts +39 -0
- package/dist/locators/FlexLocator.js +31 -1
- package/dist/locators/FlexLocator.js.map +1 -1
- package/dist/locators/HandLocator.d.ts +72 -0
- package/dist/locators/HandLocator.js +73 -1
- package/dist/locators/HandLocator.js.map +1 -1
- package/dist/locators/LineLocator.d.ts +8 -8
- package/dist/locators/LineLocator.js +30 -22
- package/dist/locators/LineLocator.js.map +1 -1
- package/dist/locators/ListLocator.d.ts +36 -0
- package/dist/locators/ListLocator.js +28 -1
- package/dist/locators/ListLocator.js.map +1 -1
- package/dist/locators/Locator.d.ts +199 -1
- package/dist/locators/Locator.js +192 -3
- package/dist/locators/Locator.js.map +1 -1
- package/dist/locators/PileLocator.d.ts +31 -2
- package/dist/locators/PileLocator.js +50 -19
- package/dist/locators/PileLocator.js.map +1 -1
- package/dist/utilities/DeepPartial.d.ts +3 -0
- package/dist/utilities/combineEventListeners.d.ts +6 -0
- package/dist/utilities/combineEventListeners.js +6 -0
- package/dist/utilities/combineEventListeners.js.map +1 -1
- package/dist/utilities/findIfUnique.util.d.ts +6 -0
- package/dist/utilities/findIfUnique.util.js +6 -0
- package/dist/utilities/findIfUnique.util.js.map +1 -1
- package/dist/utilities/translation.util.d.ts +5 -0
- package/dist/utilities/translation.util.js +5 -0
- package/dist/utilities/translation.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/animations.constants.js +20 -0
- package/dist/utilities/zoom-pan-pinch/animations.constants.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/animations.util.js +7 -0
- package/dist/utilities/zoom-pan-pinch/animations.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/bounds.util.d.ts +10 -0
- package/dist/utilities/zoom-pan-pinch/bounds.util.js +8 -0
- package/dist/utilities/zoom-pan-pinch/bounds.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/calculation.util.d.ts +12 -0
- package/dist/utilities/zoom-pan-pinch/calculation.util.js +12 -0
- package/dist/utilities/zoom-pan-pinch/calculation.util.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/index.d.ts +4 -0
- package/dist/utilities/zoom-pan-pinch/index.js +4 -0
- package/dist/utilities/zoom-pan-pinch/index.js.map +1 -1
- package/dist/utilities/zoom-pan-pinch/zoom.util.d.ts +3 -0
- package/dist/utilities/zoom-pan-pinch/zoom.util.js +3 -0
- package/dist/utilities/zoom-pan-pinch/zoom.util.js.map +1 -1
- package/package.json +3 -3
|
@@ -17,27 +17,57 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.FlexLocator = void 0;
|
|
19
19
|
var ListLocator_1 = require("./ListLocator");
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* This Locator places a list of items as a grid, with break points for the lines. Inspired by the CSS flexbox.
|
|
22
|
+
*/
|
|
23
|
+
var FlexLocator = /** @class */ (function (_super) {
|
|
21
24
|
__extends(FlexLocator, _super);
|
|
22
25
|
function FlexLocator(clone) {
|
|
23
26
|
var _this = _super.call(this) || this;
|
|
27
|
+
/**
|
|
28
|
+
* The number of items per line.
|
|
29
|
+
*/
|
|
24
30
|
_this.lineSize = 2;
|
|
25
31
|
Object.assign(_this, clone);
|
|
26
32
|
return _this;
|
|
27
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Function to override to provide a {@link lineSize} that depends on the context
|
|
36
|
+
* @param _location Location to position
|
|
37
|
+
* @param _context Context of the game
|
|
38
|
+
* @returns The number of items per line.
|
|
39
|
+
*/
|
|
28
40
|
FlexLocator.prototype.getLineSize = function (_location, _context) {
|
|
29
41
|
return this.lineSize;
|
|
30
42
|
};
|
|
31
43
|
FlexLocator.prototype.getMaxCount = function (location, context) {
|
|
32
44
|
return this.getLineSize(location, context);
|
|
33
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Function to override to provide a {@link getLineGap} that depends on the context
|
|
48
|
+
* @param _location Location to position
|
|
49
|
+
* @param _context Context of the game
|
|
50
|
+
* @returns The default gap between 2 consecutive lines
|
|
51
|
+
*/
|
|
34
52
|
FlexLocator.prototype.getLineGap = function (_location, _context) {
|
|
35
53
|
var _a;
|
|
36
54
|
return (_a = this.lineGap) !== null && _a !== void 0 ? _a : {};
|
|
37
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Function to override to provide a {@link maxLines} that depends on the context
|
|
58
|
+
* @param _location Location to position
|
|
59
|
+
* @param _context Context of the game
|
|
60
|
+
* @returns The maximum number of lines displayed before the gap between the lines is reduced to fill in the same space.
|
|
61
|
+
*/
|
|
38
62
|
FlexLocator.prototype.getMaxLines = function (_location, _context) {
|
|
39
63
|
return this.maxLines;
|
|
40
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* Function to override to provide a {@link maxLineGap} that depends on the context. Uses getMaxLines by default.
|
|
67
|
+
* @param location Location to position
|
|
68
|
+
* @param context Context of the game
|
|
69
|
+
* @returns The maximum gap between the first and the last line.
|
|
70
|
+
*/
|
|
41
71
|
FlexLocator.prototype.getMaxLineGap = function (location, context) {
|
|
42
72
|
if (this.maxLineGap)
|
|
43
73
|
return this.maxLineGap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlexLocator.js","sourceRoot":"","sources":["../../src/locators/FlexLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,6CAA2C;
|
|
1
|
+
{"version":3,"file":"FlexLocator.js","sourceRoot":"","sources":["../../src/locators/FlexLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,6CAA2C;AAG3C;;GAEG;AACH;IAAkH,+BAAoB;IAEpI,qBAAY,KAA4B;QAAxC,YACE,iBAAO,SAER;QAED;;WAEG;QACH,cAAQ,GAAW,CAAC,CAAA;QANlB,MAAM,CAAC,MAAM,CAAC,KAAI,EAAE,KAAK,CAAC,CAAA;;IAC5B,CAAC;IAOD;;;;;OAKG;IACH,iCAAW,GAAX,UAAY,SAAyB,EAAE,QAAkC;QACvE,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED,iCAAW,GAAX,UAAY,QAAwB,EAAE,OAAiC;QACrE,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC;IAOD;;;;;OAKG;IACH,gCAAU,GAAV,UAAW,SAAyB,EAAE,QAAkC;;QACtE,OAAO,MAAA,IAAI,CAAC,OAAO,mCAAI,EAAE,CAAA;IAC3B,CAAC;IAOD;;;;;OAKG;IACH,iCAAW,GAAX,UAAY,SAAyB,EAAE,QAAkC;QACvE,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAOD;;;;;OAKG;IACH,mCAAa,GAAb,UAAc,QAAwB,EAAE,OAAiC;QACvE,IAAI,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC,UAAU,CAAA;QAC3C,IAAM,QAAQ,GAAG,IAAI,CAAC,W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H,kBAAC;AAAD,CAAC,AA9GD,CAAkH,yBAAW,GA8G5H;AA9GY,kCAAW"}
|
|
@@ -1,24 +1,96 @@
|
|
|
1
1
|
import { Coordinates, Location, MaterialItem } from '@gamepark/rules-api';
|
|
2
2
|
import { LocationDescription } from '../components';
|
|
3
3
|
import { ItemContext, Locator, MaterialContext } from './Locator';
|
|
4
|
+
/**
|
|
5
|
+
* This Locator places items fan-shaped to mimic the ways we hold cards in our hands.
|
|
6
|
+
*/
|
|
4
7
|
export declare class HandLocator<P extends number = number, M extends number = number, L extends number = number> extends Locator<P, M, L> {
|
|
5
8
|
constructor(clone?: Partial<HandLocator>);
|
|
9
|
+
/**
|
|
10
|
+
* Items are place around the circle of an arc. This is the radius of the arc. Override {@link getRadius} to provide a dynamic radius.
|
|
11
|
+
*/
|
|
6
12
|
radius: number;
|
|
13
|
+
/**
|
|
14
|
+
* Provide the radius of the circle. Defaults to {@link radius} property.
|
|
15
|
+
* @param _location Location to position
|
|
16
|
+
* @param _context Context of the game
|
|
17
|
+
* @returns the radius of the circle in cm
|
|
18
|
+
*/
|
|
7
19
|
getRadius(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number;
|
|
20
|
+
/**
|
|
21
|
+
* The default angle of the hand items. For instance, 180 will display the hand oriented towards the bottom of the screen.
|
|
22
|
+
*/
|
|
8
23
|
baseAngle: number;
|
|
24
|
+
/**
|
|
25
|
+
* Function to override to provide a {@link baseAngle} that depends on the context
|
|
26
|
+
* @param _location Location to position
|
|
27
|
+
* @param _context Context of the game
|
|
28
|
+
* @returns the default angle of the items
|
|
29
|
+
*/
|
|
9
30
|
getBaseAngle(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number;
|
|
31
|
+
/**
|
|
32
|
+
* The maximum angle that is allowed between the first and the last items displayed.
|
|
33
|
+
*/
|
|
10
34
|
maxAngle: number;
|
|
35
|
+
/**
|
|
36
|
+
* Function to override to provide a {@link maxAngle} that depends on the context
|
|
37
|
+
* @param _location Location to position
|
|
38
|
+
* @param _context Context of the game
|
|
39
|
+
* @returns the maximum angle between the first and the last items
|
|
40
|
+
*/
|
|
11
41
|
getMaxAngle(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number;
|
|
42
|
+
/**
|
|
43
|
+
* The maximum angle between two consecutive items in the hand
|
|
44
|
+
*/
|
|
12
45
|
gapMaxAngle: number;
|
|
46
|
+
/**
|
|
47
|
+
* Function to override to provide a {@link gapMaxAngle} that depends on the context
|
|
48
|
+
* @param _location Location to position
|
|
49
|
+
* @param _context Context of the game
|
|
50
|
+
* @returns The maximum angle between two consecutive items in the hand
|
|
51
|
+
*/
|
|
13
52
|
getGapMaxAngle(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number;
|
|
53
|
+
/**
|
|
54
|
+
* The direction of the items displayed, for the first to the last index. Default is true.
|
|
55
|
+
*/
|
|
14
56
|
clockwise: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Function to override to provide a {@link clockwise} info that depends on the context
|
|
59
|
+
* @param _location Location to position
|
|
60
|
+
* @param _context Context of the game
|
|
61
|
+
* @returns true if items should be displayed clockwise around the arc of circle. Default is true.
|
|
62
|
+
*/
|
|
15
63
|
isClockwise(_location: Location<P, L>, _context: MaterialContext<P, M, L>): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* The Z-axis position difference between 2 consecutive items in the hand. Default is 0.05cm.
|
|
66
|
+
*/
|
|
16
67
|
deltaZ: number;
|
|
68
|
+
/**
|
|
69
|
+
* Function to override to provide a {@link deltaZ} that depends on the context
|
|
70
|
+
* @param _location Location to position
|
|
71
|
+
* @param _context Context of the game
|
|
72
|
+
* @returns The Z-axis position difference between 2 consecutive items in the hand. Default is 0.05cm.
|
|
73
|
+
*/
|
|
17
74
|
getDeltaZ(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number;
|
|
75
|
+
/**
|
|
76
|
+
* See {@link Locator.getLocationCoordinates}.
|
|
77
|
+
* @param location Location to position
|
|
78
|
+
* @param context Context of the game
|
|
79
|
+
* @param index Index of the item (or location) to place
|
|
80
|
+
*/
|
|
18
81
|
getLocationCoordinates(location: Location<P, L>, context: MaterialContext<P, M, L>, index?: number | undefined): Coordinates;
|
|
19
82
|
getItemCoordinates(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): Coordinates;
|
|
83
|
+
/**
|
|
84
|
+
* See {@link Locator.getRotateZ}.
|
|
85
|
+
* @param location Location to position
|
|
86
|
+
* @param context Context of the game
|
|
87
|
+
* @param index Index of the item (or location) to place
|
|
88
|
+
*/
|
|
20
89
|
getRotateZ(location: Location<P, L>, context: MaterialContext<P, M, L>, index?: number | undefined): number;
|
|
21
90
|
getItemRotateZ(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): number;
|
|
22
91
|
protected generateLocationDescriptionFromDraggedItem(_location: Location<P, L>, context: ItemContext<P, M, L>): LocationDescription<P, M, L>;
|
|
92
|
+
/**
|
|
93
|
+
* See {@link Locator.getHoverTransform}. By default, display the item on top of others, straight, and twice as big.
|
|
94
|
+
*/
|
|
23
95
|
getHoverTransform(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): string[];
|
|
24
96
|
}
|
|
@@ -18,37 +18,100 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.HandLocator = void 0;
|
|
19
19
|
var components_1 = require("../components");
|
|
20
20
|
var Locator_1 = require("./Locator");
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* This Locator places items fan-shaped to mimic the ways we hold cards in our hands.
|
|
23
|
+
*/
|
|
24
|
+
var HandLocator = /** @class */ (function (_super) {
|
|
22
25
|
__extends(HandLocator, _super);
|
|
23
26
|
function HandLocator(clone) {
|
|
24
27
|
var _this = _super.call(this) || this;
|
|
28
|
+
/**
|
|
29
|
+
* Items are place around the circle of an arc. This is the radius of the arc. Override {@link getRadius} to provide a dynamic radius.
|
|
30
|
+
*/
|
|
25
31
|
_this.radius = 100;
|
|
32
|
+
/**
|
|
33
|
+
* The default angle of the hand items. For instance, 180 will display the hand oriented towards the bottom of the screen.
|
|
34
|
+
*/
|
|
26
35
|
_this.baseAngle = 0;
|
|
36
|
+
/**
|
|
37
|
+
* The maximum angle that is allowed between the first and the last items displayed.
|
|
38
|
+
*/
|
|
27
39
|
_this.maxAngle = 15;
|
|
40
|
+
/**
|
|
41
|
+
* The maximum angle between two consecutive items in the hand
|
|
42
|
+
*/
|
|
28
43
|
_this.gapMaxAngle = 3;
|
|
44
|
+
/**
|
|
45
|
+
* The direction of the items displayed, for the first to the last index. Default is true.
|
|
46
|
+
*/
|
|
29
47
|
_this.clockwise = true;
|
|
48
|
+
/**
|
|
49
|
+
* The Z-axis position difference between 2 consecutive items in the hand. Default is 0.05cm.
|
|
50
|
+
*/
|
|
30
51
|
_this.deltaZ = 0.05;
|
|
31
52
|
Object.assign(_this, clone);
|
|
32
53
|
return _this;
|
|
33
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Provide the radius of the circle. Defaults to {@link radius} property.
|
|
57
|
+
* @param _location Location to position
|
|
58
|
+
* @param _context Context of the game
|
|
59
|
+
* @returns the radius of the circle in cm
|
|
60
|
+
*/
|
|
34
61
|
HandLocator.prototype.getRadius = function (_location, _context) {
|
|
35
62
|
return this.radius;
|
|
36
63
|
};
|
|
64
|
+
/**
|
|
65
|
+
* Function to override to provide a {@link baseAngle} that depends on the context
|
|
66
|
+
* @param _location Location to position
|
|
67
|
+
* @param _context Context of the game
|
|
68
|
+
* @returns the default angle of the items
|
|
69
|
+
*/
|
|
37
70
|
HandLocator.prototype.getBaseAngle = function (_location, _context) {
|
|
38
71
|
return this.baseAngle;
|
|
39
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Function to override to provide a {@link maxAngle} that depends on the context
|
|
75
|
+
* @param _location Location to position
|
|
76
|
+
* @param _context Context of the game
|
|
77
|
+
* @returns the maximum angle between the first and the last items
|
|
78
|
+
*/
|
|
40
79
|
HandLocator.prototype.getMaxAngle = function (_location, _context) {
|
|
41
80
|
return this.maxAngle;
|
|
42
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Function to override to provide a {@link gapMaxAngle} that depends on the context
|
|
84
|
+
* @param _location Location to position
|
|
85
|
+
* @param _context Context of the game
|
|
86
|
+
* @returns The maximum angle between two consecutive items in the hand
|
|
87
|
+
*/
|
|
43
88
|
HandLocator.prototype.getGapMaxAngle = function (_location, _context) {
|
|
44
89
|
return this.gapMaxAngle;
|
|
45
90
|
};
|
|
91
|
+
/**
|
|
92
|
+
* Function to override to provide a {@link clockwise} info that depends on the context
|
|
93
|
+
* @param _location Location to position
|
|
94
|
+
* @param _context Context of the game
|
|
95
|
+
* @returns true if items should be displayed clockwise around the arc of circle. Default is true.
|
|
96
|
+
*/
|
|
46
97
|
HandLocator.prototype.isClockwise = function (_location, _context) {
|
|
47
98
|
return this.clockwise;
|
|
48
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Function to override to provide a {@link deltaZ} that depends on the context
|
|
102
|
+
* @param _location Location to position
|
|
103
|
+
* @param _context Context of the game
|
|
104
|
+
* @returns The Z-axis position difference between 2 consecutive items in the hand. Default is 0.05cm.
|
|
105
|
+
*/
|
|
49
106
|
HandLocator.prototype.getDeltaZ = function (_location, _context) {
|
|
50
107
|
return this.deltaZ;
|
|
51
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* See {@link Locator.getLocationCoordinates}.
|
|
111
|
+
* @param location Location to position
|
|
112
|
+
* @param context Context of the game
|
|
113
|
+
* @param index Index of the item (or location) to place
|
|
114
|
+
*/
|
|
52
115
|
HandLocator.prototype.getLocationCoordinates = function (location, context, index) {
|
|
53
116
|
if (index === void 0) { index = this.getLocationIndex(location, context); }
|
|
54
117
|
var _a = this.getCoordinates(location, context), _b = _a.x, x = _b === void 0 ? 0 : _b, _c = _a.y, y = _c === void 0 ? 0 : _c, _d = _a.z, z = _d === void 0 ? 0 : _d;
|
|
@@ -67,6 +130,12 @@ var HandLocator = (function (_super) {
|
|
|
67
130
|
HandLocator.prototype.getItemCoordinates = function (item, context) {
|
|
68
131
|
return this.getLocationCoordinates(item.location, context, this.getItemIndex(item, context));
|
|
69
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* See {@link Locator.getRotateZ}.
|
|
135
|
+
* @param location Location to position
|
|
136
|
+
* @param context Context of the game
|
|
137
|
+
* @param index Index of the item (or location) to place
|
|
138
|
+
*/
|
|
70
139
|
HandLocator.prototype.getRotateZ = function (location, context, index) {
|
|
71
140
|
if (index === void 0) { index = this.getLocationIndex(location, context); }
|
|
72
141
|
var baseAngle = this.getBaseAngle(location, context);
|
|
@@ -96,6 +165,9 @@ var HandLocator = (function (_super) {
|
|
|
96
165
|
borderRadius: borderRadius
|
|
97
166
|
});
|
|
98
167
|
};
|
|
168
|
+
/**
|
|
169
|
+
* See {@link Locator.getHoverTransform}. By default, display the item on top of others, straight, and twice as big.
|
|
170
|
+
*/
|
|
99
171
|
HandLocator.prototype.getHoverTransform = function (item, context) {
|
|
100
172
|
return ['translateZ(10em)', "rotateZ(".concat(-this.getItemRotateZ(item, context)).concat(this.rotationUnit, ")"), 'scale(2)'];
|
|
101
173
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandLocator.js","sourceRoot":"","sources":["../../src/locators/HandLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,4CAAyF;AACzF,qCAAiE;
|
|
1
|
+
{"version":3,"file":"HandLocator.js","sourceRoot":"","sources":["../../src/locators/HandLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,4CAAyF;AACzF,qCAAiE;AAEjE;;GAEG;AACH;IAAkH,+BAAgB;IAEhI,qBAAY,KAA4B;QAAxC,YACE,iBAAO,SAER;QAED;;WAEG;QACH,YAAM,GAAW,GAAG,CAAA;QAYpB;;WAEG;QACH,eAAS,GAAW,CAAC,CAAA;QAYrB;;WAEG;QACH,cAAQ,GAAW,EAAE,CAAA;QAYrB;;WAEG;QACH,iBAAW,GAAW,CAAC,CAAA;QAYvB;;WAE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AAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAClE,IAAA,KAAoB,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAlD,KAAK,WAAA,EAAE,MAAM,YAAqC,CAAA;QAC1D,IAAM,YAAY,GAAG,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAC7D,IAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACnC,OAAO,IAAI,gCAAmB,CAAC;YAC7B,KAAK,EAAE,GAAG,GAAG,CAAC;YACd,MAAM,EAAE,GAAG,GAAG,CAAC;YACf,YAAY,cAAA;SACb,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,uCAAiB,GAAjB,UAAkB,IAAwB,EAAE,OAA6B;QACvE,OAAO,CAAC,kBAAkB,EAAE,kBAAW,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,SAAG,IAAI,CAAC,YAAY,MAAG,EAAE,UAAU,CAAC,CAAA;IAChH,CAAC;IACH,kBAAC;AAAD,CAAC,AAnKD,CAAkH,iBAAO,GAmKxH;AAnKY,kCAAW"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Coordinates,
|
|
2
|
-
import { ItemContext,
|
|
3
|
-
export declare abstract class LineLocator<P extends number = number, M extends number = number, L extends number = number> extends
|
|
4
|
-
|
|
5
|
-
getLocationCoordinates(location: Location<P, L>, context: MaterialContext<P, M, L>, index?: number): Coordinates;
|
|
6
|
-
getItemCoordinates(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): Coordinates;
|
|
1
|
+
import { Coordinates, MaterialItem } from '@gamepark/rules-api';
|
|
2
|
+
import { ItemContext, ItemLocator } from './ItemLocator';
|
|
3
|
+
export declare abstract class LineLocator<P extends number = number, M extends number = number, L extends number = number> extends ItemLocator<P, M, L> {
|
|
4
|
+
getPosition(item: MaterialItem<P, L>, context: ItemContext<P, M, L>): Coordinates;
|
|
7
5
|
getDeltaValue(delta: number | undefined, max: number | undefined, count: number): number;
|
|
6
|
+
coordinates: Coordinates;
|
|
7
|
+
getCoordinates(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): Coordinates;
|
|
8
8
|
delta?: Partial<Coordinates>;
|
|
9
|
-
getDelta(
|
|
9
|
+
getDelta(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): Partial<Coordinates>;
|
|
10
10
|
deltaMax?: Partial<Coordinates>;
|
|
11
|
-
getDeltaMax(
|
|
11
|
+
getDeltaMax(_item: MaterialItem<P, L>, _context: ItemContext<P, M, L>): Partial<Coordinates>;
|
|
12
12
|
}
|
|
@@ -14,38 +14,43 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
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
|
+
};
|
|
17
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
29
|
exports.LineLocator = void 0;
|
|
19
|
-
var
|
|
30
|
+
var ItemLocator_1 = require("./ItemLocator");
|
|
20
31
|
var LineLocator = (function (_super) {
|
|
21
32
|
__extends(LineLocator, _super);
|
|
22
33
|
function LineLocator() {
|
|
23
|
-
|
|
34
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
35
|
+
_this.coordinates = { x: 0, y: 0, z: 0 };
|
|
36
|
+
return _this;
|
|
24
37
|
}
|
|
25
|
-
LineLocator.prototype.
|
|
26
|
-
return this.coordinates;
|
|
27
|
-
};
|
|
28
|
-
LineLocator.prototype.getLocationCoordinates = function (location, context, index) {
|
|
38
|
+
LineLocator.prototype.getPosition = function (item, context) {
|
|
29
39
|
var _a, _b, _c, _d, _e;
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
var delta = this.getDelta(
|
|
40
|
+
var coordinates = this.getCoordinates(item, context);
|
|
41
|
+
var index = this.getItemIndex(item, context);
|
|
42
|
+
var delta = this.getDelta(item, context);
|
|
33
43
|
if (this.getDeltaMax) {
|
|
34
|
-
var count = this.countItems(location, context);
|
|
44
|
+
var count = this.countItems(item.location, context);
|
|
35
45
|
if (count > 1) {
|
|
36
|
-
var deltaMax = this.getDeltaMax(
|
|
46
|
+
var deltaMax = this.getDeltaMax(item, context);
|
|
47
|
+
delta = __assign(__assign({}, delta), { z: delta.z === undefined ? (_b = (_a = context.material[context.type]) === null || _a === void 0 ? void 0 : _a.thickness) !== null && _b !== void 0 ? _b : 0.05 : delta.z });
|
|
37
48
|
delta.x = this.getDeltaValue(delta.x, deltaMax.x, count);
|
|
38
49
|
delta.y = this.getDeltaValue(delta.y, deltaMax.y, count);
|
|
39
|
-
delta.z = this.getDeltaValue(
|
|
50
|
+
delta.z = this.getDeltaValue(delta.z, deltaMax.z, count);
|
|
40
51
|
}
|
|
41
52
|
}
|
|
42
|
-
return { x: x + index * ((_c = delta.x) !== null && _c !== void 0 ? _c : 0), y: y + index * ((_d = delta.y) !== null && _d !== void 0 ? _d : 0), z: z + index * ((_e = delta.z) !== null && _e !== void 0 ? _e : 0) };
|
|
43
|
-
};
|
|
44
|
-
LineLocator.prototype.getItemCoordinates = function (item, context) {
|
|
45
|
-
var _a, _b;
|
|
46
|
-
var _c = this.getLocationCoordinates(item.location, context, this.getItemIndex(item, context)), x = _c.x, y = _c.y, z = _c.z;
|
|
47
|
-
var thickness = (_b = (_a = context.material[context.type]) === null || _a === void 0 ? void 0 : _a.thickness) !== null && _b !== void 0 ? _b : 0;
|
|
48
|
-
return { x: x, y: y, z: z + thickness };
|
|
53
|
+
return { x: coordinates.x + index * ((_c = delta.x) !== null && _c !== void 0 ? _c : 0), y: coordinates.y + index * ((_d = delta.y) !== null && _d !== void 0 ? _d : 0), z: coordinates.z + index * ((_e = delta.z) !== null && _e !== void 0 ? _e : 0) };
|
|
49
54
|
};
|
|
50
55
|
LineLocator.prototype.getDeltaValue = function (delta, max, count) {
|
|
51
56
|
if (delta === void 0) { delta = 0; }
|
|
@@ -55,15 +60,18 @@ var LineLocator = (function (_super) {
|
|
|
55
60
|
return Math.max(delta, max / (count - 1));
|
|
56
61
|
return delta;
|
|
57
62
|
};
|
|
58
|
-
LineLocator.prototype.
|
|
63
|
+
LineLocator.prototype.getCoordinates = function (_item, _context) {
|
|
64
|
+
return this.coordinates;
|
|
65
|
+
};
|
|
66
|
+
LineLocator.prototype.getDelta = function (_item, _context) {
|
|
59
67
|
var _a;
|
|
60
68
|
return (_a = this.delta) !== null && _a !== void 0 ? _a : {};
|
|
61
69
|
};
|
|
62
|
-
LineLocator.prototype.getDeltaMax = function (
|
|
70
|
+
LineLocator.prototype.getDeltaMax = function (_item, _context) {
|
|
63
71
|
var _a;
|
|
64
72
|
return (_a = this.deltaMax) !== null && _a !== void 0 ? _a : {};
|
|
65
73
|
};
|
|
66
74
|
return LineLocator;
|
|
67
|
-
}(
|
|
75
|
+
}(ItemLocator_1.ItemLocator));
|
|
68
76
|
exports.LineLocator = LineLocator;
|
|
69
77
|
//# sourceMappingURL=LineLocator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineLocator.js","sourceRoot":"","sources":["../../src/locators/LineLocator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LineLocator.js","sourceRoot":"","sources":["../../src/locators/LineLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6C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rI;AAzCqB,kCAAW"}
|
|
@@ -1,14 +1,50 @@
|
|
|
1
1
|
import { Coordinates, Location, MaterialItem, XYCoordinates } from '@gamepark/rules-api';
|
|
2
2
|
import { LocationDescription } from '../components';
|
|
3
3
|
import { ItemContext, Locator, MaterialContext } from './Locator';
|
|
4
|
+
/**
|
|
5
|
+
* This Locator places items at regular intervals.
|
|
6
|
+
*/
|
|
4
7
|
export declare class ListLocator<P extends number = number, M extends number = number, L extends number = number> extends Locator<P, M, L> {
|
|
5
8
|
constructor(clone?: Partial<ListLocator>);
|
|
9
|
+
/**
|
|
10
|
+
* The default gap between 2 consecutive items
|
|
11
|
+
*/
|
|
6
12
|
gap?: Partial<Coordinates>;
|
|
13
|
+
/**
|
|
14
|
+
* Function to override to provide a {@link gap} that depends on the context
|
|
15
|
+
* @param _location Location to position
|
|
16
|
+
* @param _context Context of the game
|
|
17
|
+
* @returns The default gap between 2 consecutive items
|
|
18
|
+
*/
|
|
7
19
|
getGap(_location: Location<P, L>, _context: MaterialContext<P, M, L>): Partial<Coordinates>;
|
|
20
|
+
/**
|
|
21
|
+
* The maximum number of items that can be displayed in the list before the gap between items is reduced to fill in the same space.
|
|
22
|
+
*/
|
|
8
23
|
maxCount?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Function to override to provide a {@link maxCount that depends on the context
|
|
26
|
+
* @param _location Location to position
|
|
27
|
+
* @param _context Context of the game
|
|
28
|
+
* @returns The maximum number of items that can be displayed in the list before the gap between items is reduced to fill in the same space.
|
|
29
|
+
*/
|
|
9
30
|
getMaxCount(_location: Location<P, L>, _context: MaterialContext<P, M, L>): number | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The maximum gap between the first and the last items. See {@link maxCount} to get a maxGap based on a max number of items.
|
|
33
|
+
*/
|
|
10
34
|
maxGap?: Partial<Coordinates>;
|
|
35
|
+
/**
|
|
36
|
+
* Function to override to provide a {@link maxGap} that depends on the context
|
|
37
|
+
* @param location Location to position
|
|
38
|
+
* @param context Context of the game
|
|
39
|
+
* @returns The maximum gap between the first and the last items
|
|
40
|
+
*/
|
|
11
41
|
getMaxGap(location: Location<P, L>, context: MaterialContext<P, M, L>): Partial<Coordinates>;
|
|
42
|
+
/**
|
|
43
|
+
* The number of items displayed in the list
|
|
44
|
+
* @param location Location area of the items
|
|
45
|
+
* @param context Context of the game
|
|
46
|
+
* @returns number of items in the location area
|
|
47
|
+
*/
|
|
12
48
|
countListItems(location: Location<P, L>, context: MaterialContext<P, M, L>): number;
|
|
13
49
|
protected getAreaCoordinates(location: Location<P, L>, context: MaterialContext<P, M, L>): Partial<Coordinates>;
|
|
14
50
|
protected getCurrentMaxGap(location: Location<P, L>, context: MaterialContext<P, M, L>): XYCoordinates;
|
|
@@ -18,20 +18,41 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.ListLocator = void 0;
|
|
19
19
|
var components_1 = require("../components");
|
|
20
20
|
var Locator_1 = require("./Locator");
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* This Locator places items at regular intervals.
|
|
23
|
+
*/
|
|
24
|
+
var ListLocator = /** @class */ (function (_super) {
|
|
22
25
|
__extends(ListLocator, _super);
|
|
23
26
|
function ListLocator(clone) {
|
|
24
27
|
var _this = _super.call(this) || this;
|
|
25
28
|
Object.assign(_this, clone);
|
|
26
29
|
return _this;
|
|
27
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Function to override to provide a {@link gap} that depends on the context
|
|
33
|
+
* @param _location Location to position
|
|
34
|
+
* @param _context Context of the game
|
|
35
|
+
* @returns The default gap between 2 consecutive items
|
|
36
|
+
*/
|
|
28
37
|
ListLocator.prototype.getGap = function (_location, _context) {
|
|
29
38
|
var _a;
|
|
30
39
|
return (_a = this.gap) !== null && _a !== void 0 ? _a : {};
|
|
31
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* Function to override to provide a {@link maxCount that depends on the context
|
|
43
|
+
* @param _location Location to position
|
|
44
|
+
* @param _context Context of the game
|
|
45
|
+
* @returns The maximum number of items that can be displayed in the list before the gap between items is reduced to fill in the same space.
|
|
46
|
+
*/
|
|
32
47
|
ListLocator.prototype.getMaxCount = function (_location, _context) {
|
|
33
48
|
return this.maxCount;
|
|
34
49
|
};
|
|
50
|
+
/**
|
|
51
|
+
* Function to override to provide a {@link maxGap} that depends on the context
|
|
52
|
+
* @param location Location to position
|
|
53
|
+
* @param context Context of the game
|
|
54
|
+
* @returns The maximum gap between the first and the last items
|
|
55
|
+
*/
|
|
35
56
|
ListLocator.prototype.getMaxGap = function (location, context) {
|
|
36
57
|
if (this.maxGap)
|
|
37
58
|
return this.maxGap;
|
|
@@ -45,6 +66,12 @@ var ListLocator = (function (_super) {
|
|
|
45
66
|
z: z ? z * (maxCount - 1) : z
|
|
46
67
|
};
|
|
47
68
|
};
|
|
69
|
+
/**
|
|
70
|
+
* The number of items displayed in the list
|
|
71
|
+
* @param location Location area of the items
|
|
72
|
+
* @param context Context of the game
|
|
73
|
+
* @returns number of items in the location area
|
|
74
|
+
*/
|
|
48
75
|
ListLocator.prototype.countListItems = function (location, context) {
|
|
49
76
|
var _a;
|
|
50
77
|
return Math.min((_a = this.limit) !== null && _a !== void 0 ? _a : Infinity, this.countItems(location, context));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListLocator.js","sourceRoot":"","sources":["../../src/locators/ListLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,4CAAwE;AACxE,qCAAiE;
|
|
1
|
+
{"version":3,"file":"ListLocator.js","sourceRoot":"","sources":["../../src/locators/ListLocator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,4CAAwE;AACxE,qCAAiE;AAEjE;;GAEG;AACH;IAAkH,+BAAgB;IAEhI,qBAAY,KAA4B;QAAxC,YACE,iBAAO,SAER;QADC,MAAM,CAAC,MAAM,CAAC,KAAI,EAAE,KAAK,CAAC,CAAA;;IAC5B,CAAC;IAOD;;;;;OAKG;IACH,4BAAM,GAAN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