@gamepark/react-client 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/Actions/ActionFailed.js +3 -7
- package/dist/Actions/ActionFailed.js.map +1 -1
- package/dist/Actions/AnimationComplete.js +3 -7
- package/dist/Actions/AnimationComplete.js.map +1 -1
- package/dist/Actions/AnimationPaused.js +3 -7
- package/dist/Actions/AnimationPaused.js.map +1 -1
- 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 +2 -4
- package/dist/Actions/GameNotificationsReceived.js +2 -9
- package/dist/Actions/GameNotificationsReceived.js.map +1 -1
- package/dist/Actions/GameOver.js +3 -7
- package/dist/Actions/GameOver.js.map +1 -1
- package/dist/Actions/GameStateLoaded.js +5 -18
- package/dist/Actions/GameStateLoaded.js.map +1 -1
- package/dist/Actions/MovePlayed.d.ts +4 -4
- package/dist/Actions/MovePlayed.js +3 -4
- package/dist/Actions/MovePlayed.js.map +1 -1
- package/dist/Actions/MoveUndone.js +3 -8
- package/dist/Actions/MoveUndone.js.map +1 -1
- package/dist/Actions/PlayerQuit.d.ts +3 -9
- 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 -11
- package/dist/Actions/index.js +7 -27
- 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.js +1 -2
- package/dist/Chat/Message.js +1 -2
- package/dist/Chat/index.js +2 -18
- package/dist/Chat/index.js.map +1 -1
- package/dist/Deckbuilding/Deck.js +1 -2
- package/dist/Deckbuilding/index.js +4 -24
- package/dist/Deckbuilding/index.js.map +1 -1
- package/dist/Deckbuilding/useDeleteDeck.d.ts +4 -1
- package/dist/Deckbuilding/useDeleteDeck.js +8 -14
- package/dist/Deckbuilding/useDeleteDeck.js.map +1 -1
- package/dist/Deckbuilding/useMyDecks.d.ts +2 -1
- package/dist/Deckbuilding/useMyDecks.js +7 -13
- package/dist/Deckbuilding/useMyDecks.js.map +1 -1
- package/dist/Deckbuilding/useSaveDeck.d.ts +4 -1
- package/dist/Deckbuilding/useSaveDeck.js +8 -14
- 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.js +1 -17
- package/dist/EjectPlayer/index.js.map +1 -1
- package/dist/Failure/Failure.js +1 -4
- package/dist/Failure/Failure.js.map +1 -1
- package/dist/Failure/index.js +1 -17
- package/dist/Failure/index.js.map +1 -1
- package/dist/GiveUp/GiveUp.js +2 -5
- package/dist/GiveUp/GiveUp.js.map +1 -1
- package/dist/GiveUp/index.js +1 -17
- package/dist/GiveUp/index.js.map +1 -1
- package/dist/Hooks/index.js +5 -21
- package/dist/Hooks/index.js.map +1 -1
- package/dist/Hooks/useChatMessages.d.ts +1 -6
- package/dist/Hooks/useChatMessages.js +35 -44
- package/dist/Hooks/useChatMessages.js.map +1 -1
- package/dist/Hooks/useMessageAuthor.js +12 -16
- package/dist/Hooks/useMessageAuthor.js.map +1 -1
- package/dist/Hooks/useOptions.js +3 -6
- package/dist/Hooks/useOptions.js.map +1 -1
- package/dist/Hooks/useRematch.d.ts +1 -1
- package/dist/Hooks/useRematch.js +16 -20
- package/dist/Hooks/useRematch.js.map +1 -1
- package/dist/Hooks/useSendMessage.d.ts +4 -1
- package/dist/Hooks/useSendMessage.js +5 -12
- 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 +1 -4
- package/dist/Log/StopLiveLog.js +4 -7
- package/dist/Log/StopLiveLog.js.map +1 -1
- package/dist/Log/index.d.ts +2 -2
- package/dist/Log/index.js +4 -20
- package/dist/Log/index.js.map +1 -1
- package/dist/Log/useLogControls.js +11 -14
- package/dist/Log/useLogControls.js.map +1 -1
- package/dist/PlayerTime/PlayerTime.js +1 -2
- package/dist/PlayerTime/index.js +1 -17
- package/dist/PlayerTime/index.js.map +1 -1
- package/dist/Rematch/RematchQueries.js +23 -13
- package/dist/Rematch/RematchQueries.js.map +1 -1
- package/dist/Rematch/index.js +1 -17
- package/dist/Rematch/index.js.map +1 -1
- package/dist/Sound/MuteSounds.d.ts +1 -4
- package/dist/Sound/MuteSounds.js +5 -8
- 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 +2 -2
- package/dist/Sound/index.js +3 -19
- package/dist/Sound/index.js.map +1 -1
- package/dist/Sound/useSoundControls.js +11 -14
- package/dist/Sound/useSoundControls.js.map +1 -1
- package/dist/Store/DisplayedAction.js +4 -10
- package/dist/Store/DisplayedAction.js.map +1 -1
- package/dist/Store/GamePageState.d.ts +0 -1
- package/dist/Store/GamePageState.js +1 -2
- 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.js +30 -41
- package/dist/Store/gameMiddleware.js.map +1 -1
- package/dist/Store/gameReducer.d.ts +2 -11
- package/dist/Store/gameReducer.js +301 -377
- package/dist/Store/gameReducer.js.map +1 -1
- package/dist/Store/index.d.ts +1 -0
- package/dist/Store/index.js +4 -19
- package/dist/Store/index.js.map +1 -1
- package/dist/Store/localMovePreviewMiddleware.js +15 -13
- 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.js +1 -2
- package/dist/Tutorial/TutorialDescription.d.ts +1 -1
- package/dist/Tutorial/TutorialDescription.js +1 -2
- package/dist/Tutorial/index.js +4 -20
- package/dist/Tutorial/index.js.map +1 -1
- package/dist/Tutorial/useTutorial.js +11 -20
- package/dist/Tutorial/useTutorial.js.map +1 -1
- package/dist/Types/GameAI.js +1 -2
- package/dist/Types/GameData.js +1 -2
- package/dist/Types/GameMessage.js +1 -2
- package/dist/Types/GameMode.js +2 -5
- package/dist/Types/GameMode.js.map +1 -1
- package/dist/Types/GameNotification.js +1 -2
- package/dist/Types/GameOptions.js +2 -5
- package/dist/Types/GameOptions.js.map +1 -1
- package/dist/Types/MovePlayedNotification.d.ts +1 -1
- package/dist/Types/MovePlayedNotification.js +3 -8
- package/dist/Types/MovePlayedNotification.js.map +1 -1
- package/dist/Types/MoveUndoneNotification.d.ts +1 -1
- package/dist/Types/MoveUndoneNotification.js +3 -8
- package/dist/Types/MoveUndoneNotification.js.map +1 -1
- package/dist/Types/Player.js +1 -2
- package/dist/Types/PlayerQuitReason.js +2 -5
- package/dist/Types/PlayerQuitReason.js.map +1 -1
- package/dist/Types/ProxyGameData.js +1 -2
- package/dist/Types/Tournament.js +1 -2
- package/dist/Types/index.js +12 -28
- package/dist/Types/index.js.map +1 -1
- package/dist/User/User.js +1 -2
- package/dist/User/index.js +2 -18
- package/dist/User/index.js.map +1 -1
- package/dist/User/useMe.js +9 -19
- package/dist/User/useMe.js.map +1 -1
- package/dist/animations/Animation.js +1 -2
- package/dist/animations/AnimationContext.d.ts +1 -1
- package/dist/animations/AnimationContext.js +1 -2
- package/dist/animations/AnimationState.js +1 -2
- package/dist/animations/AnimationStep.js +2 -5
- package/dist/animations/AnimationStep.js.map +1 -1
- package/dist/animations/Animations.js +9 -16
- 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 +1 -4
- package/dist/animations/AnimationsListenerCreator.js +24 -30
- 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 +0 -1
- package/dist/animations/index.js +5 -22
- package/dist/animations/index.js.map +1 -1
- package/dist/api/Client/GameClientAPI.d.ts +5 -6
- package/dist/api/Client/GameClientAPI.js +70 -119
- package/dist/api/Client/GameClientAPI.js.map +1 -1
- package/dist/api/Client/GameNotificationsListener.js +51 -104
- package/dist/api/Client/GameNotificationsListener.js.map +1 -1
- package/dist/api/Client/RemoteGameLoader.js +50 -45
- package/dist/api/Client/RemoteGameLoader.js.map +1 -1
- package/dist/api/Client/RemoteGameProvider.js +15 -51
- package/dist/api/Client/RemoteGameProvider.js.map +1 -1
- package/dist/api/Client/apollo-client.d.ts +1 -1
- package/dist/api/Client/apollo-client.js +14 -31
- package/dist/api/Client/apollo-client.js.map +1 -1
- package/dist/api/Client/index.js +4 -20
- package/dist/api/Client/index.js.map +1 -1
- package/dist/api/Client/pusher.js +5 -12
- package/dist/api/Client/pusher.js.map +1 -1
- package/dist/api/GameAPI.d.ts +2 -3
- package/dist/api/GameAPI.js +1 -2
- package/dist/api/Local/ConsoleTools.d.ts +1 -2
- package/dist/api/Local/ConsoleTools.js +15 -22
- package/dist/api/Local/ConsoleTools.js.map +1 -1
- package/dist/api/Local/GameLocalAPI.d.ts +4 -5
- package/dist/api/Local/GameLocalAPI.js +264 -363
- package/dist/api/Local/GameLocalAPI.js.map +1 -1
- package/dist/api/Local/LocalGameProvider.d.ts +1 -1
- package/dist/api/Local/LocalGameProvider.js +17 -48
- package/dist/api/Local/LocalGameProvider.js.map +1 -1
- package/dist/api/Local/index.js +1 -17
- package/dist/api/Local/index.js.map +1 -1
- package/dist/api/index.js +2 -18
- package/dist/api/index.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +16 -36
- package/dist/index.js.map +1 -1
- package/dist/util/ArrayUtil.js +4 -8
- package/dist/util/ArrayUtil.js.map +1 -1
- package/package.json +66 -62
- 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,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.useSendMessage = useSendMessage;
|
|
8
|
-
var client_1 = require("@apollo/client");
|
|
9
|
-
var SEND_MESSAGE = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["mutation SendMessage($channel: String!, $text: String!) { sendMessage(channel: $channel, text: $text) { date } }"], ["mutation SendMessage($channel: String!, $text: String!) { sendMessage(channel: $channel, text: $text) { date } }"])));
|
|
10
|
-
function useSendMessage() {
|
|
11
|
-
return (0, client_1.useMutation)(SEND_MESSAGE);
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useMutation } from '@apollo/client/react';
|
|
3
|
+
const SEND_MESSAGE = gql `mutation SendMessage($channel: String!, $text: String!) { sendMessage(channel: $channel, text: $text) { date } }`;
|
|
4
|
+
export function useSendMessage() {
|
|
5
|
+
return useMutation(SEND_MESSAGE);
|
|
12
6
|
}
|
|
13
|
-
var templateObject_1;
|
|
14
7
|
//# sourceMappingURL=useSendMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSendMessage.js","sourceRoot":"","sources":["../../src/Hooks/useSendMessage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSendMessage.js","sourceRoot":"","sources":["../../src/Hooks/useSendMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAElD,MAAM,YAAY,GAAG,GAAG,CAAA,kHAAkH,CAAA;AAE1I,MAAM,UAAU,cAAc;IAC5B,OAAO,WAAW,CAAC,YAAY,CAAC,CAAA;AAClC,CAAC"}
|
package/dist/Log/StartLiveLog.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.START_LIVE_LOG = 'START_LIVE_LOG';
|
|
5
|
-
//# sourceMappingURL=StartLiveLog.js.map
|
|
1
|
+
import { createAction } from '@reduxjs/toolkit';
|
|
2
|
+
export const startLiveLog = createAction('startLiveLog');
|
|
3
|
+
//# sourceMappingURL=startLiveLog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"startLiveLog.js","sourceRoot":"","sources":["../../src/Log/startLiveLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CAAC,cAAc,CAAC,CAAA"}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export declare const STOP_LIVE_LOG = "STOP_LIVE_LOG";
|
|
2
|
-
export interface StopLiveLog {
|
|
3
|
-
type: typeof STOP_LIVE_LOG;
|
|
4
|
-
}
|
|
5
1
|
export declare function liveLogStopped(): boolean;
|
|
2
|
+
export declare const stopLiveLog: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"stopLiveLog">;
|
package/dist/Log/StopLiveLog.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.STOP_LIVE_LOG = void 0;
|
|
4
|
-
exports.liveLogStopped = liveLogStopped;
|
|
5
|
-
exports.STOP_LIVE_LOG = 'STOP_LIVE_LOG';
|
|
6
|
-
function liveLogStopped() {
|
|
1
|
+
import { createAction } from '@reduxjs/toolkit';
|
|
2
|
+
export function liveLogStopped() {
|
|
7
3
|
return !!localStorage.getItem('liveLogStopped');
|
|
8
4
|
}
|
|
9
|
-
|
|
5
|
+
export const stopLiveLog = createAction('stopLiveLog');
|
|
6
|
+
//# sourceMappingURL=stopLiveLog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"stopLiveLog.js","sourceRoot":"","sources":["../../src/Log/stopLiveLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;AACjD,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA"}
|
package/dist/Log/index.d.ts
CHANGED
package/dist/Log/index.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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("./useLogControls"), exports);
|
|
18
|
-
__exportStar(require("./StartLiveLog"), exports);
|
|
19
|
-
__exportStar(require("./StopLiveLog"), exports);
|
|
20
|
-
__exportStar(require("./useLogControls"), exports);
|
|
1
|
+
export * from './useLogControls';
|
|
2
|
+
export * from './startLiveLog';
|
|
3
|
+
export * from './stopLiveLog';
|
|
4
|
+
export * from './useLogControls';
|
|
21
5
|
//# sourceMappingURL=index.js.map
|
package/dist/Log/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Log/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Log/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function useLogControls() {
|
|
8
|
-
var stopped = (0, react_redux_1.useSelector)(function (state) { return state.liveLogStopped; });
|
|
9
|
-
var dispatch = (0, react_redux_1.useDispatch)();
|
|
1
|
+
import { useGameDispatch, useGameSelector } from '../Store';
|
|
2
|
+
import { startLiveLog } from './startLiveLog';
|
|
3
|
+
import { stopLiveLog } from './stopLiveLog';
|
|
4
|
+
export function useLogControls() {
|
|
5
|
+
const stopped = useGameSelector(state => state.liveLogStopped);
|
|
6
|
+
const dispatch = useGameDispatch();
|
|
10
7
|
return {
|
|
11
|
-
stop:
|
|
12
|
-
dispatch(
|
|
8
|
+
stop: () => {
|
|
9
|
+
dispatch(stopLiveLog());
|
|
13
10
|
localStorage.setItem('liveLogStopped', 'true');
|
|
14
11
|
},
|
|
15
|
-
start:
|
|
16
|
-
dispatch(
|
|
12
|
+
start: () => {
|
|
13
|
+
dispatch(startLiveLog());
|
|
17
14
|
localStorage.removeItem('liveLogStopped');
|
|
18
15
|
},
|
|
19
|
-
stopped
|
|
16
|
+
stopped
|
|
20
17
|
};
|
|
21
18
|
}
|
|
22
19
|
//# sourceMappingURL=useLogControls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLogControls.js","sourceRoot":"","sources":["../../src/Log/useLogControls.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLogControls.js","sourceRoot":"","sources":["../../src/Log/useLogControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAQ3C,MAAM,UAAU,cAAc;IAC5B,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;IAC9D,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAA;IAClC,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAA;YACvB,YAAY,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;QAChD,CAAC;QACD,KAAK,EAAE,GAAG,EAAE;YACV,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAA;YACxB,YAAY,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAA;QAC3C,CAAC;QACD,OAAO;KACR,CAAA;AACH,CAAC"}
|
package/dist/PlayerTime/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("./PlayerTime"), exports);
|
|
1
|
+
export * from './PlayerTime';
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/PlayerTime/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/PlayerTime/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -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.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"}
|
package/dist/Sound/MuteSounds.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.soundsMuted = soundsMuted;
|
|
5
|
-
exports.MUTE_SOUNDS = 'MUTE_SOUNDS';
|
|
6
|
-
function soundsMuted() {
|
|
7
|
-
var query = new URLSearchParams(window.location.search);
|
|
1
|
+
import { createAction } from '@reduxjs/toolkit';
|
|
2
|
+
export function soundsMuted() {
|
|
3
|
+
const query = new URLSearchParams(window.location.search);
|
|
8
4
|
return !!query.get('mute') || !!localStorage.getItem('soundsMuted');
|
|
9
5
|
}
|
|
10
|
-
|
|
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 './
|
|
1
|
+
export * from './muteSounds';
|
|
2
|
+
export * from './unmuteSounds';
|
|
3
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,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function useSoundControls() {
|
|
8
|
-
var muted = (0, react_redux_1.useSelector)(function (state) { return state.soundsMuted; });
|
|
9
|
-
var dispatch = (0, react_redux_1.useDispatch)();
|
|
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();
|
|
10
7
|
return {
|
|
11
|
-
mute:
|
|
12
|
-
dispatch(
|
|
8
|
+
mute: () => {
|
|
9
|
+
dispatch(muteSounds());
|
|
13
10
|
localStorage.setItem('soundsMuted', 'true');
|
|
14
11
|
},
|
|
15
|
-
unmute:
|
|
16
|
-
dispatch(
|
|
12
|
+
unmute: () => {
|
|
13
|
+
dispatch(unmuteSounds());
|
|
17
14
|
localStorage.removeItem('soundsMuted');
|
|
18
15
|
},
|
|
19
|
-
muted
|
|
16
|
+
muted
|
|
20
17
|
};
|
|
21
18
|
}
|
|
22
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,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isActionToAnimate = isActionToAnimate;
|
|
4
|
-
exports.getAnimatedMove = getAnimatedMove;
|
|
5
|
-
var animations_1 = require("../animations");
|
|
6
|
-
function isActionToAnimate(action) {
|
|
1
|
+
import { AnimationStep } from '../animations';
|
|
2
|
+
export function isActionToAnimate(action) {
|
|
7
3
|
if (action.delayed)
|
|
8
4
|
return false;
|
|
9
5
|
if (action.cancelled)
|
|
10
6
|
return action.played > 0;
|
|
11
7
|
return action.played <= action.consequences.length;
|
|
12
8
|
}
|
|
13
|
-
function getAnimatedMove(action, step) {
|
|
14
|
-
|
|
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;
|
|
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;
|
|
17
11
|
return consequenceIndex < 0 ? action.move : action.consequences[consequenceIndex];
|
|
18
12
|
}
|
|
19
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"}
|
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,46 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
function gameMiddleware(api) {
|
|
11
|
-
return function (store) { return function (next) { return function (action) {
|
|
12
|
-
if ((0, gameReducer_1.isGameAction)(action)) {
|
|
13
|
-
switch (action.type) {
|
|
14
|
-
case Actions_1.MOVE_PLAYED: {
|
|
15
|
-
if (!action.local && !action.transient) {
|
|
16
|
-
api.play(action.move);
|
|
17
|
-
}
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
case Actions_1.MOVE_UNDONE: {
|
|
21
|
-
var actions = store.getState().actions;
|
|
22
|
-
if (!actions)
|
|
23
|
-
return console.error('gameMiddleware - MOVE_UNDONE: Actions is missing');
|
|
24
|
-
var gameAction = (0, ArrayUtil_1.findLastItem)(actions, function (gameAction) { return gameAction.id === action.actionId; });
|
|
25
|
-
if (!gameAction)
|
|
26
|
-
return console.error('gameMiddleware - MOVE_UNDONE: Action not found');
|
|
27
|
-
if (!gameAction.local) {
|
|
28
|
-
api.undo(action.actionId);
|
|
29
|
-
}
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
case EjectPlayer_1.EJECT_PLAYER:
|
|
33
|
-
api.eject(action.playerId);
|
|
34
|
-
break;
|
|
35
|
-
case GiveUp_1.GIVE_UP:
|
|
36
|
-
api.giveUp();
|
|
37
|
-
break;
|
|
38
|
-
case Tutorial_1.PLAY_TUTORIAL_MOVES:
|
|
39
|
-
api.playTutorialMoves(action.quantity);
|
|
40
|
-
break;
|
|
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);
|
|
41
10
|
}
|
|
42
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
|
+
}
|
|
43
32
|
return next(action);
|
|
44
|
-
};
|
|
33
|
+
};
|
|
45
34
|
}
|
|
46
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,13 +1,6 @@
|
|
|
1
1
|
import { Rules, RulesCreator } from '@gamepark/rules-api';
|
|
2
|
-
import { Reducer } from '
|
|
3
|
-
import { ActionFailed, AnimationComplete, AnimationPaused, AnimationStart, ClearFailures, GameNotificationsReceived, GameOver, GameStateLoaded, MovePlayed, MoveUndone, SetAnimationsSpeed } from '../Actions';
|
|
4
|
-
import { PlayerQuit } from '../Actions/PlayerQuit';
|
|
2
|
+
import { Reducer } from '@reduxjs/toolkit';
|
|
5
3
|
import { Animations } from '../animations';
|
|
6
|
-
import { EjectPlayer } from '../EjectPlayer';
|
|
7
|
-
import { GiveUp } from '../GiveUp';
|
|
8
|
-
import { StartLiveLog, StopLiveLog } from '../Log';
|
|
9
|
-
import { MuteSounds, UnmuteSounds } from '../Sound';
|
|
10
|
-
import { PlayTutorialMoves } from '../Tutorial';
|
|
11
4
|
import { DisplayedAction } from './DisplayedAction';
|
|
12
5
|
import { GamePageState } from './GamePageState';
|
|
13
6
|
export type GameReducerContext<Game = any, Move = any, PlayerId = any> = {
|
|
@@ -15,9 +8,7 @@ export type GameReducerContext<Game = any, Move = any, PlayerId = any> = {
|
|
|
15
8
|
animations?: Animations<Game, Move, PlayerId>;
|
|
16
9
|
version?: number;
|
|
17
10
|
};
|
|
18
|
-
export
|
|
19
|
-
export declare function gameReducer<Game, Move, PlayerId>(context: GameReducerContext<Game, Move, PlayerId>): Reducer<GamePageState<Game, Move, PlayerId>, GameActions<Game, Move, PlayerId>>;
|
|
11
|
+
export declare function gameReducer(context?: GameReducerContext): Reducer<GamePageState>;
|
|
20
12
|
export declare function getGameAfterAnimations<Game, Move, PlayerId>(state: GamePageState<Game, Move, PlayerId>, Rules: RulesCreator<Game, Move, PlayerId>): Rules<Game, Move, PlayerId>;
|
|
21
13
|
export declare function replayActions<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, actions: DisplayedAction<Move, PlayerId>[], previousState: Game): void;
|
|
22
14
|
export declare function replayAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, action: DisplayedAction<Move, PlayerId>): void;
|
|
23
|
-
export declare function isGameAction(action: unknown): action is GameActions;
|