@gamepark/react-client 6.38.5 → 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/Actions/ActionFailed.d.ts +6 -6
- package/dist/Actions/ActionFailed.js +4 -8
- package/dist/Actions/ActionFailed.js.map +1 -1
- package/dist/Actions/AnimationComplete.d.ts +6 -6
- package/dist/Actions/AnimationComplete.js +4 -8
- package/dist/Actions/AnimationComplete.js.map +1 -1
- package/dist/Actions/AnimationPaused.d.ts +6 -6
- package/dist/Actions/AnimationPaused.js +4 -8
- package/dist/Actions/AnimationPaused.js.map +1 -1
- package/dist/Actions/AnimationStart.d.ts +5 -5
- package/dist/Actions/AnimationStart.js +1 -4
- package/dist/Actions/AnimationStart.js.map +1 -1
- package/dist/Actions/ClearFailures.d.ts +1 -5
- package/dist/Actions/ClearFailures.js +3 -9
- package/dist/Actions/ClearFailures.js.map +1 -1
- package/dist/Actions/GameNotificationsReceived.d.ts +8 -10
- package/dist/Actions/GameNotificationsReceived.js +2 -9
- package/dist/Actions/GameNotificationsReceived.js.map +1 -1
- package/dist/Actions/GameOver.d.ts +16 -16
- package/dist/Actions/GameOver.js +4 -8
- package/dist/Actions/GameOver.js.map +1 -1
- package/dist/Actions/GameStateLoaded.d.ts +16 -16
- package/dist/Actions/GameStateLoaded.js +7 -20
- package/dist/Actions/GameStateLoaded.js.map +1 -1
- package/dist/Actions/MovePlayed.d.ts +11 -11
- package/dist/Actions/MovePlayed.js +3 -2
- package/dist/Actions/MovePlayed.js.map +1 -1
- package/dist/Actions/MoveUndone.d.ts +7 -7
- package/dist/Actions/MoveUndone.js +4 -9
- package/dist/Actions/MoveUndone.js.map +1 -1
- package/dist/Actions/PlayerQuit.d.ts +5 -11
- package/dist/Actions/PlayerQuit.js +2 -19
- package/dist/Actions/PlayerQuit.js.map +1 -1
- package/dist/Actions/SetAnimationsSpeed.d.ts +1 -6
- package/dist/Actions/SetAnimationsSpeed.js +3 -9
- package/dist/Actions/SetAnimationsSpeed.js.map +1 -1
- package/dist/Actions/giveUp.d.ts +1 -0
- package/dist/Actions/giveUp.js +3 -0
- package/dist/Actions/giveUp.js.map +1 -0
- package/dist/Actions/index.d.ts +7 -12
- package/dist/Actions/index.js +7 -28
- package/dist/Actions/index.js.map +1 -1
- package/dist/Actions/loadGameState.d.ts +14 -0
- package/dist/Actions/loadGameState.js +3 -0
- package/dist/Actions/loadGameState.js.map +1 -0
- package/dist/Actions/playMove.d.ts +10 -0
- package/dist/Actions/playMove.js +3 -0
- package/dist/Actions/playMove.js.map +1 -0
- package/dist/Actions/receiveNotifications.d.ts +8 -0
- package/dist/Actions/receiveNotifications.js +3 -0
- package/dist/Actions/receiveNotifications.js.map +1 -0
- package/dist/Actions/removePlayer.d.ts +5 -0
- package/dist/Actions/removePlayer.js +3 -0
- package/dist/Actions/removePlayer.js.map +1 -0
- package/dist/Actions/reportFailure.d.ts +1 -0
- package/dist/Actions/reportFailure.js +3 -0
- package/dist/Actions/reportFailure.js.map +1 -0
- package/dist/Actions/setGameOver.d.ts +2 -0
- package/dist/Actions/setGameOver.js +3 -0
- package/dist/Actions/setGameOver.js.map +1 -0
- package/dist/Actions/startAnimation.d.ts +1 -0
- package/dist/Actions/startAnimation.js +3 -0
- package/dist/Actions/startAnimation.js.map +1 -0
- package/dist/Actions/undoMove.d.ts +5 -0
- package/dist/Actions/undoMove.js +4 -0
- package/dist/Actions/undoMove.js.map +1 -0
- package/dist/Chat/ChatChannel.d.ts +5 -5
- package/dist/Chat/ChatChannel.js +1 -2
- package/dist/Chat/Message.d.ts +6 -6
- package/dist/Chat/Message.js +1 -2
- package/dist/Chat/index.d.ts +2 -2
- package/dist/Chat/index.js +2 -18
- package/dist/Chat/index.js.map +1 -1
- package/dist/Deckbuilding/Deck.d.ts +5 -5
- package/dist/Deckbuilding/Deck.js +1 -2
- package/dist/Deckbuilding/index.d.ts +4 -4
- package/dist/Deckbuilding/index.js +4 -24
- package/dist/Deckbuilding/index.js.map +1 -1
- package/dist/Deckbuilding/useDeleteDeck.d.ts +5 -2
- package/dist/Deckbuilding/useDeleteDeck.js +9 -15
- package/dist/Deckbuilding/useDeleteDeck.js.map +1 -1
- package/dist/Deckbuilding/useMyDecks.d.ts +3 -2
- package/dist/Deckbuilding/useMyDecks.js +8 -14
- package/dist/Deckbuilding/useMyDecks.js.map +1 -1
- package/dist/Deckbuilding/useSaveDeck.d.ts +5 -2
- package/dist/Deckbuilding/useSaveDeck.js +9 -15
- package/dist/Deckbuilding/useSaveDeck.js.map +1 -1
- package/dist/EjectPlayer/EjectPlayer.d.ts +1 -6
- package/dist/EjectPlayer/EjectPlayer.js +2 -8
- package/dist/EjectPlayer/EjectPlayer.js.map +1 -1
- package/dist/EjectPlayer/index.d.ts +1 -1
- package/dist/EjectPlayer/index.js +1 -17
- package/dist/EjectPlayer/index.js.map +1 -1
- package/dist/Failure/Failure.d.ts +6 -6
- package/dist/Failure/Failure.js +6 -9
- package/dist/Failure/Failure.js.map +1 -1
- package/dist/Failure/index.d.ts +1 -1
- package/dist/Failure/index.js +1 -17
- package/dist/Failure/index.js.map +1 -1
- package/dist/GiveUp/GiveUp.d.ts +7 -7
- package/dist/GiveUp/GiveUp.js +2 -5
- package/dist/GiveUp/GiveUp.js.map +1 -1
- package/dist/GiveUp/index.d.ts +1 -1
- package/dist/GiveUp/index.js +1 -17
- package/dist/GiveUp/index.js.map +1 -1
- package/dist/Hooks/index.d.ts +5 -5
- package/dist/Hooks/index.js +5 -21
- package/dist/Hooks/index.js.map +1 -1
- package/dist/Hooks/useChatMessages.d.ts +7 -12
- package/dist/Hooks/useChatMessages.js +44 -51
- package/dist/Hooks/useChatMessages.js.map +1 -1
- package/dist/Hooks/useMessageAuthor.d.ts +4 -4
- package/dist/Hooks/useMessageAuthor.js +13 -18
- package/dist/Hooks/useMessageAuthor.js.map +1 -1
- package/dist/Hooks/useOptions.d.ts +2 -2
- package/dist/Hooks/useOptions.js +4 -8
- package/dist/Hooks/useOptions.js.map +1 -1
- package/dist/Hooks/useRematch.d.ts +7 -7
- package/dist/Hooks/useRematch.js +18 -19
- package/dist/Hooks/useRematch.js.map +1 -1
- package/dist/Hooks/useSendMessage.d.ts +4 -1
- package/dist/Hooks/useSendMessage.js +6 -14
- package/dist/Hooks/useSendMessage.js.map +1 -1
- package/dist/Log/StartLiveLog.d.ts +1 -4
- package/dist/Log/StartLiveLog.js +3 -5
- package/dist/Log/StartLiveLog.js.map +1 -1
- package/dist/Log/StopLiveLog.d.ts +2 -5
- package/dist/Log/StopLiveLog.js +6 -9
- package/dist/Log/StopLiveLog.js.map +1 -1
- package/dist/Log/index.d.ts +4 -4
- package/dist/Log/index.js +4 -20
- package/dist/Log/index.js.map +1 -1
- package/dist/Log/useLogControls.d.ts +7 -7
- package/dist/Log/useLogControls.js +18 -22
- package/dist/Log/useLogControls.js.map +1 -1
- package/dist/PlayerTime/PlayerTime.d.ts +11 -11
- package/dist/PlayerTime/PlayerTime.js +1 -2
- package/dist/PlayerTime/index.d.ts +1 -1
- package/dist/PlayerTime/index.js +1 -17
- package/dist/PlayerTime/index.js.map +1 -1
- package/dist/Rematch/RematchQueries.d.ts +19 -19
- package/dist/Rematch/RematchQueries.js +23 -13
- package/dist/Rematch/RematchQueries.js.map +1 -1
- package/dist/Rematch/index.d.ts +1 -1
- package/dist/Rematch/index.js +1 -17
- package/dist/Rematch/index.js.map +1 -1
- package/dist/Sound/MuteSounds.d.ts +2 -5
- package/dist/Sound/MuteSounds.js +7 -10
- package/dist/Sound/MuteSounds.js.map +1 -1
- package/dist/Sound/UnmuteSounds.d.ts +1 -4
- package/dist/Sound/UnmuteSounds.js +3 -5
- package/dist/Sound/UnmuteSounds.js.map +1 -1
- package/dist/Sound/index.d.ts +3 -3
- package/dist/Sound/index.js +3 -19
- package/dist/Sound/index.js.map +1 -1
- package/dist/Sound/useSoundControls.d.ts +7 -7
- package/dist/Sound/useSoundControls.js +18 -22
- package/dist/Sound/useSoundControls.js.map +1 -1
- package/dist/Store/DisplayedAction.d.ts +15 -15
- package/dist/Store/DisplayedAction.js +12 -19
- package/dist/Store/DisplayedAction.js.map +1 -1
- package/dist/Store/GamePageState.d.ts +27 -28
- package/dist/Store/GamePageState.js +1 -2
- package/dist/Store/PlayedMove.d.ts +5 -5
- package/dist/Store/PlayedMove.js +1 -2
- package/dist/Store/endAnimation.d.ts +1 -0
- package/dist/Store/endAnimation.js +3 -0
- package/dist/Store/endAnimation.js.map +1 -0
- package/dist/Store/gameMiddleware.d.ts +4 -4
- package/dist/Store/gameMiddleware.js +34 -41
- package/dist/Store/gameMiddleware.js.map +1 -1
- package/dist/Store/gameReducer.d.ts +14 -20
- package/dist/Store/gameReducer.js +462 -525
- package/dist/Store/gameReducer.js.map +1 -1
- package/dist/Store/index.d.ts +4 -3
- package/dist/Store/index.js +4 -19
- package/dist/Store/index.js.map +1 -1
- package/dist/Store/localMovePreviewMiddleware.d.ts +4 -4
- package/dist/Store/localMovePreviewMiddleware.js +19 -18
- package/dist/Store/localMovePreviewMiddleware.js.map +1 -1
- package/dist/Store/store.d.ts +13 -0
- package/dist/Store/store.js +27 -0
- package/dist/Store/store.js.map +1 -0
- package/dist/Tutorial/PlayTutorialMoves.d.ts +1 -9
- package/dist/Tutorial/PlayTutorialMoves.js +2 -6
- package/dist/Tutorial/PlayTutorialMoves.js.map +1 -1
- package/dist/Tutorial/Tutorial.d.ts +5 -5
- package/dist/Tutorial/Tutorial.js +1 -2
- package/dist/Tutorial/TutorialDescription.d.ts +7 -7
- package/dist/Tutorial/TutorialDescription.js +1 -2
- package/dist/Tutorial/index.d.ts +4 -4
- package/dist/Tutorial/index.js +4 -20
- package/dist/Tutorial/index.js.map +1 -1
- package/dist/Tutorial/useTutorial.d.ts +2 -2
- package/dist/Tutorial/useTutorial.js +12 -22
- package/dist/Tutorial/useTutorial.js.map +1 -1
- package/dist/Types/GameAI.d.ts +1 -1
- package/dist/Types/GameAI.js +1 -2
- package/dist/Types/GameData.d.ts +18 -18
- package/dist/Types/GameData.js +1 -2
- package/dist/Types/GameMessage.d.ts +8 -8
- package/dist/Types/GameMessage.js +1 -2
- package/dist/Types/GameMode.d.ts +6 -6
- package/dist/Types/GameMode.js +7 -10
- package/dist/Types/GameMode.js.map +1 -1
- package/dist/Types/GameNotification.d.ts +6 -6
- package/dist/Types/GameNotification.js +1 -2
- package/dist/Types/GameOptions.d.ts +9 -9
- package/dist/Types/GameOptions.js +5 -8
- package/dist/Types/GameOptions.js.map +1 -1
- package/dist/Types/MovePlayedNotification.d.ts +9 -9
- package/dist/Types/MovePlayedNotification.js +6 -12
- package/dist/Types/MovePlayedNotification.js.map +1 -1
- package/dist/Types/MoveUndoneNotification.d.ts +8 -8
- package/dist/Types/MoveUndoneNotification.js +6 -12
- package/dist/Types/MoveUndoneNotification.js.map +1 -1
- package/dist/Types/Player.d.ts +13 -13
- package/dist/Types/Player.js +1 -2
- package/dist/Types/PlayerQuitReason.d.ts +4 -4
- package/dist/Types/PlayerQuitReason.js +5 -8
- package/dist/Types/PlayerQuitReason.js.map +1 -1
- package/dist/Types/ProxyGameData.d.ts +13 -13
- package/dist/Types/ProxyGameData.js +1 -2
- package/dist/Types/Tournament.d.ts +4 -4
- package/dist/Types/Tournament.js +1 -2
- package/dist/Types/index.d.ts +12 -12
- package/dist/Types/index.js +12 -28
- package/dist/Types/index.js.map +1 -1
- package/dist/User/User.d.ts +6 -6
- package/dist/User/User.js +1 -2
- package/dist/User/index.d.ts +2 -2
- package/dist/User/index.js +2 -18
- package/dist/User/index.js.map +1 -1
- package/dist/User/useMe.d.ts +4 -4
- package/dist/User/useMe.js +10 -21
- package/dist/User/useMe.js.map +1 -1
- package/dist/animations/Animation.d.ts +6 -6
- package/dist/animations/Animation.js +1 -2
- package/dist/animations/AnimationContext.d.ts +8 -8
- package/dist/animations/AnimationContext.js +1 -2
- package/dist/animations/AnimationState.d.ts +6 -6
- package/dist/animations/AnimationState.js +1 -2
- package/dist/animations/AnimationStep.d.ts +6 -6
- package/dist/animations/AnimationStep.js +7 -10
- package/dist/animations/AnimationStep.js.map +1 -1
- package/dist/animations/Animations.d.ts +8 -8
- package/dist/animations/Animations.js +15 -22
- package/dist/animations/Animations.js.map +1 -1
- package/dist/animations/AnimationsListener.d.ts +6 -0
- package/dist/animations/AnimationsListener.js +54 -0
- package/dist/animations/AnimationsListener.js.map +1 -0
- package/dist/animations/AnimationsListenerCreator.d.ts +2 -4
- package/dist/animations/AnimationsListenerCreator.js +40 -50
- package/dist/animations/AnimationsListenerCreator.js.map +1 -1
- package/dist/animations/animationMiddleware.d.ts +4 -0
- package/dist/animations/animationMiddleware.js +50 -0
- package/dist/animations/animationMiddleware.js.map +1 -0
- package/dist/animations/index.d.ts +5 -6
- package/dist/animations/index.js +5 -22
- package/dist/animations/index.js.map +1 -1
- package/dist/api/Client/GameClientAPI.d.ts +24 -24
- package/dist/api/Client/GameClientAPI.js +116 -165
- package/dist/api/Client/GameClientAPI.js.map +1 -1
- package/dist/api/Client/GameNotificationsListener.d.ts +5 -5
- package/dist/api/Client/GameNotificationsListener.js +62 -113
- package/dist/api/Client/GameNotificationsListener.js.map +1 -1
- package/dist/api/Client/RemoteGameLoader.d.ts +4 -5
- package/dist/api/Client/RemoteGameLoader.js +66 -62
- package/dist/api/Client/RemoteGameLoader.js.map +1 -1
- package/dist/api/Client/RemoteGameProvider.d.ts +7 -7
- package/dist/api/Client/RemoteGameProvider.js +19 -70
- package/dist/api/Client/RemoteGameProvider.js.map +1 -1
- package/dist/api/Client/apollo-client.d.ts +2 -2
- package/dist/api/Client/apollo-client.js +40 -58
- package/dist/api/Client/apollo-client.js.map +1 -1
- package/dist/api/Client/index.d.ts +4 -3
- package/dist/api/Client/index.js +4 -19
- package/dist/api/Client/index.js.map +1 -1
- package/dist/api/Client/pusher.d.ts +2 -0
- package/dist/api/Client/pusher.js +9 -0
- package/dist/api/Client/pusher.js.map +1 -0
- package/dist/api/GameAPI.d.ts +10 -10
- package/dist/api/GameAPI.js +1 -2
- package/dist/api/Local/ConsoleTools.d.ts +25 -25
- package/dist/api/Local/ConsoleTools.js +78 -86
- package/dist/api/Local/ConsoleTools.js.map +1 -1
- package/dist/api/Local/GameLocalAPI.d.ts +44 -44
- package/dist/api/Local/GameLocalAPI.js +442 -540
- package/dist/api/Local/GameLocalAPI.js.map +1 -1
- package/dist/api/Local/LocalGameProvider.d.ts +15 -15
- package/dist/api/Local/LocalGameProvider.js +18 -58
- package/dist/api/Local/LocalGameProvider.js.map +1 -1
- package/dist/api/Local/index.d.ts +1 -1
- package/dist/api/Local/index.js +1 -17
- package/dist/api/Local/index.js.map +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +2 -18
- package/dist/api/index.js.map +1 -1
- package/dist/index.d.ts +16 -18
- package/dist/index.js +16 -36
- package/dist/index.js.map +1 -1
- package/dist/util/ArrayUtil.d.ts +2 -2
- package/dist/util/ArrayUtil.js +16 -21
- package/dist/util/ArrayUtil.js.map +1 -1
- package/package.json +66 -65
- package/dist/Actions/ActionType.d.ts +0 -3
- package/dist/Actions/ActionType.js +0 -8
- package/dist/Actions/ActionType.js.map +0 -1
- package/dist/Scoring/ScoringDescription.d.ts +0 -8
- package/dist/Scoring/ScoringDescription.js +0 -3
- package/dist/Scoring/ScoringDescription.js.map +0 -1
- package/dist/Scoring/index.d.ts +0 -1
- package/dist/Scoring/index.js +0 -18
- package/dist/Scoring/index.js.map +0 -1
- package/dist/util/TimeUtil.d.ts +0 -2
- package/dist/util/TimeUtil.js +0 -27
- package/dist/util/TimeUtil.js.map +0 -1
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
export const CAN_REMATCH = gql `
|
|
3
|
+
query Game($id: String!) {
|
|
4
|
+
game(id: $id) {
|
|
5
|
+
id canRematch rematch { id startDate players { name userId ready } }
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
`;
|
|
9
|
+
export const REMATCH = gql `
|
|
10
|
+
mutation Rematch($gameId: String!) {
|
|
11
|
+
rematch(gameId: $gameId) { id canRematch rematch { id startDate myPlayerId players { id name userId ready } } }
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
export const ACCEPT_REMATCH = gql `
|
|
15
|
+
mutation AcceptRematch($gameId: String!) {
|
|
16
|
+
joinGame(gameId: $gameId) { id myPlayerId players { id ready } }
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
export const REFUSE_REMATCH = gql `
|
|
20
|
+
mutation RefuseRematch($gameId: String!) {
|
|
21
|
+
leaveGameSetup(gameId: $gameId) { id myPlayerId players { id ready } }
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
14
24
|
//# sourceMappingURL=RematchQueries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RematchQueries.js","sourceRoot":"","sources":["../../src/Rematch/RematchQueries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RematchQueries.js","sourceRoot":"","sources":["../../src/Rematch/RematchQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,gBAAgB,CAAA;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;CAM7B,CAAA;AAoBD,MAAM,CAAC,MAAM,OAAO,GAAG,GAAG,CAAA;;;;CAIzB,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;CAIhC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;CAIhC,CAAA"}
|
package/dist/Rematch/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './RematchQueries';
|
|
1
|
+
export * from './RematchQueries';
|
package/dist/Rematch/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./RematchQueries"), exports);
|
|
1
|
+
export * from './RematchQueries';
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Rematch/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Rematch/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export
|
|
3
|
-
type: typeof MUTE_SOUNDS;
|
|
4
|
-
}
|
|
5
|
-
export declare function soundsMuted(): boolean;
|
|
1
|
+
export declare function soundsMuted(): boolean;
|
|
2
|
+
export declare const muteSounds: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"muteSounds">;
|
package/dist/Sound/MuteSounds.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
exports.soundsMuted = soundsMuted;
|
|
10
|
-
//# sourceMappingURL=MuteSounds.js.map
|
|
1
|
+
import { createAction } from '@reduxjs/toolkit';
|
|
2
|
+
export function soundsMuted() {
|
|
3
|
+
const query = new URLSearchParams(window.location.search);
|
|
4
|
+
return !!query.get('mute') || !!localStorage.getItem('soundsMuted');
|
|
5
|
+
}
|
|
6
|
+
export const muteSounds = createAction('muteSounds');
|
|
7
|
+
//# sourceMappingURL=muteSounds.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"muteSounds.js","sourceRoot":"","sources":["../../src/Sound/muteSounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,UAAU,WAAW;IACzB,MAAM,KAAK,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzD,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;AACrE,CAAC;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.UNMUTE_SOUNDS = 'UNMUTE_SOUNDS';
|
|
5
|
-
//# sourceMappingURL=UnmuteSounds.js.map
|
|
1
|
+
import { createAction } from '@reduxjs/toolkit';
|
|
2
|
+
export const unmuteSounds = createAction('unmuteSounds');
|
|
3
|
+
//# sourceMappingURL=unmuteSounds.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"unmuteSounds.js","sourceRoot":"","sources":["../../src/Sound/unmuteSounds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA"}
|
package/dist/Sound/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './useSoundControls';
|
|
1
|
+
export * from './muteSounds';
|
|
2
|
+
export * from './unmuteSounds';
|
|
3
|
+
export * from './useSoundControls';
|
package/dist/Sound/index.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./MuteSounds"), exports);
|
|
18
|
-
__exportStar(require("./UnmuteSounds"), exports);
|
|
19
|
-
__exportStar(require("./useSoundControls"), exports);
|
|
1
|
+
export * from './muteSounds';
|
|
2
|
+
export * from './unmuteSounds';
|
|
3
|
+
export * from './useSoundControls';
|
|
20
4
|
//# sourceMappingURL=index.js.map
|
package/dist/Sound/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Sound/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Sound/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type SoundControls = {
|
|
2
|
-
mute: () => void;
|
|
3
|
-
unmute: () => void;
|
|
4
|
-
muted: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare function useSoundControls(): SoundControls;
|
|
7
|
-
export {};
|
|
1
|
+
type SoundControls = {
|
|
2
|
+
mute: () => void;
|
|
3
|
+
unmute: () => void;
|
|
4
|
+
muted: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function useSoundControls(): SoundControls;
|
|
7
|
+
export {};
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
muted: muted
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
exports.useSoundControls = useSoundControls;
|
|
1
|
+
import { useGameDispatch, useGameSelector } from '../Store';
|
|
2
|
+
import { muteSounds } from './muteSounds';
|
|
3
|
+
import { unmuteSounds } from './unmuteSounds';
|
|
4
|
+
export function useSoundControls() {
|
|
5
|
+
const muted = useGameSelector(state => state.soundsMuted);
|
|
6
|
+
const dispatch = useGameDispatch();
|
|
7
|
+
return {
|
|
8
|
+
mute: () => {
|
|
9
|
+
dispatch(muteSounds());
|
|
10
|
+
localStorage.setItem('soundsMuted', 'true');
|
|
11
|
+
},
|
|
12
|
+
unmute: () => {
|
|
13
|
+
dispatch(unmuteSounds());
|
|
14
|
+
localStorage.removeItem('soundsMuted');
|
|
15
|
+
},
|
|
16
|
+
muted
|
|
17
|
+
};
|
|
18
|
+
}
|
|
23
19
|
//# sourceMappingURL=useSoundControls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSoundControls.js","sourceRoot":"","sources":["../../src/Sound/useSoundControls.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSoundControls.js","sourceRoot":"","sources":["../../src/Sound/useSoundControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAQ7C,MAAM,UAAU,gBAAgB;IAC9B,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;IACzD,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAA;IAClC,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAA;YACtB,YAAY,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;QAC7C,CAAC;QACD,MAAM,EAAE,GAAG,EAAE;YACX,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAA;YACxB,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QACxC,CAAC;QACD,KAAK;KACN,CAAA;AACH,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Action } from '@gamepark/rules-api';
|
|
2
|
-
import { AnimationState, AnimationStep } from '../animations';
|
|
3
|
-
export type DisplayedAction<Move = any, PlayerId = any> = Action<Move, PlayerId> & {
|
|
4
|
-
played: number;
|
|
5
|
-
pending?: boolean;
|
|
6
|
-
delayed?: boolean;
|
|
7
|
-
animation?: AnimationState;
|
|
8
|
-
cancelled?: boolean;
|
|
9
|
-
cancelPending?: boolean;
|
|
10
|
-
local?: boolean;
|
|
11
|
-
activePlayers?: PlayerId[];
|
|
12
|
-
transient?: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare function isActionToAnimate(action: DisplayedAction): boolean;
|
|
15
|
-
export declare function getAnimatedMove<Move>(action: DisplayedAction<Move>, step?: AnimationStep | undefined): Move;
|
|
1
|
+
import { Action } from '@gamepark/rules-api';
|
|
2
|
+
import { AnimationState, AnimationStep } from '../animations';
|
|
3
|
+
export type DisplayedAction<Move = any, PlayerId = any> = Action<Move, PlayerId> & {
|
|
4
|
+
played: number;
|
|
5
|
+
pending?: boolean;
|
|
6
|
+
delayed?: boolean;
|
|
7
|
+
animation?: AnimationState;
|
|
8
|
+
cancelled?: boolean;
|
|
9
|
+
cancelPending?: boolean;
|
|
10
|
+
local?: boolean;
|
|
11
|
+
activePlayers?: PlayerId[];
|
|
12
|
+
transient?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function isActionToAnimate(action: DisplayedAction): boolean;
|
|
15
|
+
export declare function getAnimatedMove<Move>(action: DisplayedAction<Move>, step?: AnimationStep | undefined): Move;
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function getAnimatedMove(action, step) {
|
|
14
|
-
var _a;
|
|
15
|
-
if (step === void 0) { step = (_a = action.animation) === null || _a === void 0 ? void 0 : _a.step; }
|
|
16
|
-
var consequenceIndex = (step === animations_1.AnimationStep.BEFORE_MOVE || step === animations_1.AnimationStep.AFTER_UNDO) ? action.played - 1 : action.played - 2;
|
|
17
|
-
return consequenceIndex < 0 ? action.move : action.consequences[consequenceIndex];
|
|
18
|
-
}
|
|
19
|
-
exports.getAnimatedMove = getAnimatedMove;
|
|
1
|
+
import { AnimationStep } from '../animations';
|
|
2
|
+
export function isActionToAnimate(action) {
|
|
3
|
+
if (action.delayed)
|
|
4
|
+
return false;
|
|
5
|
+
if (action.cancelled)
|
|
6
|
+
return action.played > 0;
|
|
7
|
+
return action.played <= action.consequences.length;
|
|
8
|
+
}
|
|
9
|
+
export function getAnimatedMove(action, step = action.animation?.step) {
|
|
10
|
+
const consequenceIndex = (step === AnimationStep.BEFORE_MOVE || step === AnimationStep.AFTER_UNDO) ? action.played - 1 : action.played - 2;
|
|
11
|
+
return consequenceIndex < 0 ? action.move : action.consequences[consequenceIndex];
|
|
12
|
+
}
|
|
20
13
|
//# sourceMappingURL=DisplayedAction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DisplayedAction.js","sourceRoot":"","sources":["../../src/Store/DisplayedAction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DisplayedAction.js","sourceRoot":"","sources":["../../src/Store/DisplayedAction.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,aAAa,EAAE,MAAM,eAAe,CAAA;AAc7D,MAAM,UAAU,iBAAiB,CAAC,MAAuB;IACvD,IAAI,MAAM,CAAC,OAAO;QAAE,OAAO,KAAK,CAAA;IAChC,IAAI,MAAM,CAAC,SAAS;QAAE,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAC9C,OAAO,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,CAAA;AACpD,CAAC;AAED,MAAM,UAAU,eAAe,CAAO,MAA6B,EAAE,IAAI,GAAG,MAAM,CAAC,SAAS,EAAE,IAAI;IAChG,MAAM,gBAAgB,GAAG,CAAC,IAAI,KAAK,aAAa,CAAC,WAAW,IAAI,IAAI,KAAK,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAA;IAC1I,OAAO,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAA;AACnF,CAAC"}
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
import { GameMode, GameOptions, IndexedGameNotification, Player, Tournament } from '../Types';
|
|
2
|
-
import { PlayedMove } from './PlayedMove';
|
|
3
|
-
import { DisplayedAction } from './DisplayedAction';
|
|
4
|
-
export type GamePageState<Game = any, Move = any, PlayerId = any> = {
|
|
5
|
-
players: Player<PlayerId>[];
|
|
6
|
-
playerId?: PlayerId;
|
|
7
|
-
options?: GameOptions;
|
|
8
|
-
gameMode?: GameMode;
|
|
9
|
-
setup?: Game;
|
|
10
|
-
state?: Game;
|
|
11
|
-
actions?: DisplayedAction<Move, PlayerId>[];
|
|
12
|
-
pendingNotifications: IndexedGameNotification<PlayerId>[];
|
|
13
|
-
nextNotificationIndex: number;
|
|
14
|
-
legalMoves: Move[];
|
|
15
|
-
failures: string[];
|
|
16
|
-
animationIncrement: number;
|
|
17
|
-
animationsSpeed: number;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
1
|
+
import { GameMode, GameOptions, IndexedGameNotification, Player, Tournament } from '../Types';
|
|
2
|
+
import { PlayedMove } from './PlayedMove';
|
|
3
|
+
import { DisplayedAction } from './DisplayedAction';
|
|
4
|
+
export type GamePageState<Game = any, Move = any, PlayerId = any> = {
|
|
5
|
+
players: Player<PlayerId>[];
|
|
6
|
+
playerId?: PlayerId;
|
|
7
|
+
options?: GameOptions;
|
|
8
|
+
gameMode?: GameMode;
|
|
9
|
+
setup?: Game;
|
|
10
|
+
state?: Game;
|
|
11
|
+
actions?: DisplayedAction<Move, PlayerId>[];
|
|
12
|
+
pendingNotifications: IndexedGameNotification<PlayerId>[];
|
|
13
|
+
nextNotificationIndex: number;
|
|
14
|
+
legalMoves: Move[];
|
|
15
|
+
failures: string[];
|
|
16
|
+
animationIncrement: number;
|
|
17
|
+
animationsSpeed: number;
|
|
18
|
+
soundsMuted: boolean;
|
|
19
|
+
liveLogStopped: boolean;
|
|
20
|
+
clientTimeDelta: number;
|
|
21
|
+
gameOver?: boolean;
|
|
22
|
+
tournament?: Tournament;
|
|
23
|
+
client?: {
|
|
24
|
+
player?: PlayerId;
|
|
25
|
+
};
|
|
26
|
+
playedMoves?: PlayedMove<Move>[];
|
|
27
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type PlayedMove<Move = any> = {
|
|
2
|
-
move: Move;
|
|
3
|
-
actionId: string;
|
|
4
|
-
consequenceIndex?: number;
|
|
5
|
-
};
|
|
1
|
+
export type PlayedMove<Move = any> = {
|
|
2
|
+
move: Move;
|
|
3
|
+
actionId: string;
|
|
4
|
+
consequenceIndex?: number;
|
|
5
|
+
};
|
package/dist/Store/PlayedMove.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const endAnimation: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endAnimation.js","sourceRoot":"","sources":["../../src/Store/endAnimation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAS,cAAc,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Middleware } from 'redux';
|
|
2
|
-
import { GameAPI } from '../api/GameAPI';
|
|
3
|
-
import { GamePageState } from './GamePageState';
|
|
4
|
-
export declare function gameMiddleware<Game, Move, PlayerId>(api: GameAPI<Move, PlayerId>): Middleware<{}, GamePageState<Game, Move, PlayerId>>;
|
|
1
|
+
import { Middleware } from 'redux';
|
|
2
|
+
import { GameAPI } from '../api/GameAPI';
|
|
3
|
+
import { GamePageState } from './GamePageState';
|
|
4
|
+
export declare function gameMiddleware<Game, Move, PlayerId>(api: GameAPI<Move, PlayerId>): Middleware<{}, GamePageState<Game, Move, PlayerId>>;
|
|
@@ -1,42 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
api.playTutorialMoves(event.quantity);
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
return next(event);
|
|
39
|
-
}; }; };
|
|
40
|
-
}
|
|
41
|
-
exports.gameMiddleware = gameMiddleware;
|
|
1
|
+
import { giveUp, playMove, undoMove } from '../Actions';
|
|
2
|
+
import { ejectPlayer } from '../EjectPlayer';
|
|
3
|
+
import { playTutorialMoves } from '../Tutorial';
|
|
4
|
+
import { findLastItem } from '../util/ArrayUtil';
|
|
5
|
+
export function gameMiddleware(api) {
|
|
6
|
+
return store => next => action => {
|
|
7
|
+
if (playMove.match(action)) {
|
|
8
|
+
if (!action.payload.options?.local && !action.payload.options?.transient) {
|
|
9
|
+
api.play(action.payload.move);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
else if (undoMove.match(action)) {
|
|
13
|
+
const actions = store.getState().actions;
|
|
14
|
+
if (!actions)
|
|
15
|
+
return console.error('gameMiddleware - undoMove: Actions is missing');
|
|
16
|
+
const gameAction = findLastItem(actions, gameAction => gameAction.id === action.payload.actionId);
|
|
17
|
+
if (!gameAction)
|
|
18
|
+
return console.error('gameMiddleware - undoMove: Action not found');
|
|
19
|
+
if (!gameAction.local) {
|
|
20
|
+
api.undo(action.payload.actionId);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else if (ejectPlayer.match(action)) {
|
|
24
|
+
api.eject(action.payload);
|
|
25
|
+
}
|
|
26
|
+
else if (giveUp.match(action)) {
|
|
27
|
+
api.giveUp();
|
|
28
|
+
}
|
|
29
|
+
else if (playTutorialMoves.match(action)) {
|
|
30
|
+
api.playTutorialMoves(action.payload);
|
|
31
|
+
}
|
|
32
|
+
return next(action);
|
|
33
|
+
};
|
|
34
|
+
}
|
|
42
35
|
//# sourceMappingURL=gameMiddleware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gameMiddleware.js","sourceRoot":"","sources":["../../src/Store/gameMiddleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gameMiddleware.js","sourceRoot":"","sources":["../../src/Store/gameMiddleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAEvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD,MAAM,UAAU,cAAc,CAAuB,GAA4B;IAE/E,OAAO,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;QAC/B,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC;gBACzE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC/B,CAAC;QACH,CAAC;aAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAA;YACxC,IAAI,CAAC,OAAO;gBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAA;YACnF,MAAM,UAAU,GAAG,YAAY,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;YACjG,IAAI,CAAC,UAAU;gBAAE,OAAO,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAA;YACpF,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;gBACtB,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;YACnC,CAAC;QACH,CAAC;aAAM,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,OAAmB,CAAC,CAAA;QACvC,CAAC;aAAM,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAChC,GAAG,CAAC,MAAM,EAAE,CAAA;QACd,CAAC;aAAM,IAAI,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3C,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACvC,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAA;IACrB,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { Rules, RulesCreator } from '@gamepark/rules-api';
|
|
2
|
-
import { Reducer } from '
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
export type GameActions<Game = any, Move = any, PlayerId = any> = GameStateLoaded<Game, PlayerId> | GameNotificationsReceived<PlayerId> | MovePlayed<Move> | MoveUndone | AnimationStart | AnimationComplete | AnimationPaused | ActionFailed | ClearFailures | SetAnimationsSpeed | GiveUp | PlayerQuit | MuteSounds | UnmuteSounds | GameOver<PlayerId> | StopLiveLog | StartLiveLog;
|
|
17
|
-
export declare function gameReducer<Game, Move, PlayerId>(context: GameReducerContext<Game, Move, PlayerId>): Reducer<GamePageState<Game, Move, PlayerId>, GameActions<Game, Move, PlayerId>>;
|
|
18
|
-
export declare function getGameAfterAnimations<Game, Move, PlayerId>(state: GamePageState<Game, Move, PlayerId>, Rules: RulesCreator<Game, Move, PlayerId>): Rules<Game, Move, PlayerId>;
|
|
19
|
-
export declare function replayActions<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, actions: DisplayedAction<Move, PlayerId>[], previousState: Game): void;
|
|
20
|
-
export declare function replayAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, action: DisplayedAction<Move, PlayerId>): void;
|
|
1
|
+
import { Rules, RulesCreator } from '@gamepark/rules-api';
|
|
2
|
+
import { Reducer } from '@reduxjs/toolkit';
|
|
3
|
+
import { Animations } from '../animations';
|
|
4
|
+
import { DisplayedAction } from './DisplayedAction';
|
|
5
|
+
import { GamePageState } from './GamePageState';
|
|
6
|
+
export type GameReducerContext<Game = any, Move = any, PlayerId = any> = {
|
|
7
|
+
Rules: RulesCreator<Game, Move, PlayerId>;
|
|
8
|
+
animations?: Animations<Game, Move, PlayerId>;
|
|
9
|
+
version?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function gameReducer(context?: GameReducerContext): Reducer<GamePageState>;
|
|
12
|
+
export declare function getGameAfterAnimations<Game, Move, PlayerId>(state: GamePageState<Game, Move, PlayerId>, Rules: RulesCreator<Game, Move, PlayerId>): Rules<Game, Move, PlayerId>;
|
|
13
|
+
export declare function replayActions<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, actions: DisplayedAction<Move, PlayerId>[], previousState: Game): void;
|
|
14
|
+
export declare function replayAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, action: DisplayedAction<Move, PlayerId>): void;
|