@gamepark/react-client 6.38.5 → 7.0.0-beta.0
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 +8 -8
- package/dist/Actions/ActionFailed.js.map +1 -1
- package/dist/Actions/ActionType.d.ts +3 -3
- package/dist/Actions/ActionType.js +7 -7
- package/dist/Actions/ActionType.js.map +1 -1
- package/dist/Actions/AnimationComplete.d.ts +6 -6
- package/dist/Actions/AnimationComplete.js +8 -8
- package/dist/Actions/AnimationComplete.js.map +1 -1
- package/dist/Actions/AnimationPaused.d.ts +6 -6
- package/dist/Actions/AnimationPaused.js +8 -8
- package/dist/Actions/AnimationPaused.js.map +1 -1
- package/dist/Actions/AnimationStart.d.ts +5 -5
- package/dist/Actions/AnimationStart.js +4 -4
- package/dist/Actions/ClearFailures.d.ts +5 -5
- package/dist/Actions/ClearFailures.js +8 -8
- package/dist/Actions/ClearFailures.js.map +1 -1
- package/dist/Actions/GameNotificationsReceived.d.ts +10 -10
- package/dist/Actions/GameNotificationsReceived.js +9 -9
- package/dist/Actions/GameNotificationsReceived.js.map +1 -1
- package/dist/Actions/GameOver.d.ts +16 -16
- package/dist/Actions/GameOver.js +8 -8
- package/dist/Actions/GameOver.js.map +1 -1
- package/dist/Actions/GameStateLoaded.d.ts +16 -16
- package/dist/Actions/GameStateLoaded.js +20 -20
- package/dist/Actions/GameStateLoaded.js.map +1 -1
- package/dist/Actions/MovePlayed.d.ts +11 -11
- package/dist/Actions/MovePlayed.js +4 -2
- package/dist/Actions/MovePlayed.js.map +1 -1
- package/dist/Actions/MoveUndone.d.ts +7 -7
- package/dist/Actions/MoveUndone.js +9 -9
- package/dist/Actions/MoveUndone.js.map +1 -1
- package/dist/Actions/PlayerQuit.d.ts +11 -11
- package/dist/Actions/PlayerQuit.js +19 -19
- package/dist/Actions/PlayerQuit.js.map +1 -1
- package/dist/Actions/SetAnimationsSpeed.d.ts +6 -6
- package/dist/Actions/SetAnimationsSpeed.js +8 -8
- package/dist/Actions/SetAnimationsSpeed.js.map +1 -1
- package/dist/Actions/index.d.ts +11 -12
- package/dist/Actions/index.js +27 -28
- package/dist/Actions/index.js.map +1 -1
- package/dist/Chat/ChatChannel.d.ts +5 -5
- package/dist/Chat/ChatChannel.js +2 -2
- package/dist/Chat/Message.d.ts +6 -6
- package/dist/Chat/Message.js +2 -2
- package/dist/Chat/index.d.ts +2 -2
- package/dist/Chat/index.js +18 -18
- package/dist/Deckbuilding/Deck.d.ts +5 -5
- package/dist/Deckbuilding/Deck.js +2 -2
- package/dist/Deckbuilding/index.d.ts +4 -4
- package/dist/Deckbuilding/index.js +24 -24
- package/dist/Deckbuilding/useDeleteDeck.d.ts +2 -2
- package/dist/Deckbuilding/useDeleteDeck.js +15 -15
- package/dist/Deckbuilding/useDeleteDeck.js.map +1 -1
- package/dist/Deckbuilding/useMyDecks.d.ts +2 -2
- package/dist/Deckbuilding/useMyDecks.js +14 -14
- package/dist/Deckbuilding/useMyDecks.js.map +1 -1
- package/dist/Deckbuilding/useSaveDeck.d.ts +2 -2
- package/dist/Deckbuilding/useSaveDeck.js +15 -15
- package/dist/Deckbuilding/useSaveDeck.js.map +1 -1
- package/dist/EjectPlayer/EjectPlayer.d.ts +6 -6
- package/dist/EjectPlayer/EjectPlayer.js +8 -8
- package/dist/EjectPlayer/EjectPlayer.js.map +1 -1
- package/dist/EjectPlayer/index.d.ts +1 -1
- package/dist/EjectPlayer/index.js +17 -17
- package/dist/Failure/Failure.d.ts +6 -6
- package/dist/Failure/Failure.js +9 -9
- package/dist/Failure/index.d.ts +1 -1
- package/dist/Failure/index.js +17 -17
- package/dist/GiveUp/GiveUp.d.ts +7 -7
- package/dist/GiveUp/GiveUp.js +5 -5
- package/dist/GiveUp/index.d.ts +1 -1
- package/dist/GiveUp/index.js +17 -17
- package/dist/Hooks/index.d.ts +5 -5
- package/dist/Hooks/index.js +21 -21
- package/dist/Hooks/useChatMessages.d.ts +12 -12
- package/dist/Hooks/useChatMessages.js +53 -51
- package/dist/Hooks/useChatMessages.js.map +1 -1
- package/dist/Hooks/useMessageAuthor.d.ts +4 -4
- package/dist/Hooks/useMessageAuthor.js +17 -18
- package/dist/Hooks/useMessageAuthor.js.map +1 -1
- package/dist/Hooks/useOptions.d.ts +2 -2
- package/dist/Hooks/useOptions.js +7 -8
- package/dist/Hooks/useOptions.js.map +1 -1
- package/dist/Hooks/useRematch.d.ts +7 -7
- package/dist/Hooks/useRematch.js +22 -19
- package/dist/Hooks/useRematch.js.map +1 -1
- package/dist/Hooks/useSendMessage.d.ts +1 -1
- package/dist/Hooks/useSendMessage.js +13 -14
- package/dist/Hooks/useSendMessage.js.map +1 -1
- package/dist/Log/StartLiveLog.d.ts +4 -4
- package/dist/Log/StartLiveLog.js +4 -4
- package/dist/Log/StopLiveLog.d.ts +5 -5
- package/dist/Log/StopLiveLog.js +8 -8
- package/dist/Log/StopLiveLog.js.map +1 -1
- package/dist/Log/index.d.ts +4 -4
- package/dist/Log/index.js +20 -20
- package/dist/Log/useLogControls.d.ts +7 -7
- package/dist/Log/useLogControls.js +21 -22
- package/dist/Log/useLogControls.js.map +1 -1
- package/dist/PlayerTime/PlayerTime.d.ts +11 -11
- package/dist/PlayerTime/PlayerTime.js +2 -2
- package/dist/PlayerTime/index.d.ts +1 -1
- package/dist/PlayerTime/index.js +17 -17
- package/dist/Rematch/RematchQueries.d.ts +19 -19
- package/dist/Rematch/RematchQueries.js +13 -13
- package/dist/Rematch/index.d.ts +1 -1
- package/dist/Rematch/index.js +17 -17
- package/dist/Sound/MuteSounds.d.ts +5 -5
- package/dist/Sound/MuteSounds.js +9 -9
- package/dist/Sound/MuteSounds.js.map +1 -1
- package/dist/Sound/UnmuteSounds.d.ts +4 -4
- package/dist/Sound/UnmuteSounds.js +4 -4
- package/dist/Sound/index.d.ts +3 -3
- package/dist/Sound/index.js +19 -19
- package/dist/Sound/useSoundControls.d.ts +7 -7
- package/dist/Sound/useSoundControls.js +21 -22
- package/dist/Sound/useSoundControls.js.map +1 -1
- package/dist/Store/DisplayedAction.d.ts +15 -15
- package/dist/Store/DisplayedAction.js +18 -19
- package/dist/Store/DisplayedAction.js.map +1 -1
- package/dist/Store/GamePageState.d.ts +28 -28
- package/dist/Store/GamePageState.js +2 -2
- package/dist/Store/PlayedMove.d.ts +5 -5
- package/dist/Store/PlayedMove.js +2 -2
- package/dist/Store/gameMiddleware.d.ts +4 -4
- package/dist/Store/gameMiddleware.js +45 -41
- package/dist/Store/gameMiddleware.js.map +1 -1
- package/dist/Store/gameReducer.d.ts +23 -20
- package/dist/Store/gameReducer.js +538 -525
- package/dist/Store/gameReducer.js.map +1 -1
- package/dist/Store/index.d.ts +3 -3
- package/dist/Store/index.js +19 -19
- package/dist/Store/localMovePreviewMiddleware.d.ts +4 -4
- package/dist/Store/localMovePreviewMiddleware.js +17 -18
- package/dist/Store/localMovePreviewMiddleware.js.map +1 -1
- package/dist/Tutorial/PlayTutorialMoves.d.ts +9 -9
- package/dist/Tutorial/PlayTutorialMoves.js +6 -6
- package/dist/Tutorial/Tutorial.d.ts +5 -5
- package/dist/Tutorial/Tutorial.js +2 -2
- package/dist/Tutorial/TutorialDescription.d.ts +7 -7
- package/dist/Tutorial/TutorialDescription.js +2 -2
- package/dist/Tutorial/index.d.ts +4 -4
- package/dist/Tutorial/index.js +20 -20
- package/dist/Tutorial/useTutorial.d.ts +2 -2
- package/dist/Tutorial/useTutorial.js +21 -22
- package/dist/Tutorial/useTutorial.js.map +1 -1
- package/dist/Types/GameAI.d.ts +1 -1
- package/dist/Types/GameAI.js +2 -2
- package/dist/Types/GameData.d.ts +18 -18
- package/dist/Types/GameData.js +2 -2
- package/dist/Types/GameMessage.d.ts +8 -8
- package/dist/Types/GameMessage.js +2 -2
- package/dist/Types/GameMode.d.ts +6 -6
- package/dist/Types/GameMode.js +10 -10
- package/dist/Types/GameMode.js.map +1 -1
- package/dist/Types/GameNotification.d.ts +6 -6
- package/dist/Types/GameNotification.js +2 -2
- package/dist/Types/GameOptions.d.ts +9 -9
- package/dist/Types/GameOptions.js +8 -8
- package/dist/Types/GameOptions.js.map +1 -1
- package/dist/Types/MovePlayedNotification.d.ts +9 -9
- package/dist/Types/MovePlayedNotification.js +11 -12
- package/dist/Types/MovePlayedNotification.js.map +1 -1
- package/dist/Types/MoveUndoneNotification.d.ts +8 -8
- package/dist/Types/MoveUndoneNotification.js +11 -12
- package/dist/Types/MoveUndoneNotification.js.map +1 -1
- package/dist/Types/Player.d.ts +13 -13
- package/dist/Types/Player.js +2 -2
- package/dist/Types/PlayerQuitReason.d.ts +4 -4
- package/dist/Types/PlayerQuitReason.js +8 -8
- package/dist/Types/PlayerQuitReason.js.map +1 -1
- package/dist/Types/ProxyGameData.d.ts +13 -13
- package/dist/Types/ProxyGameData.js +2 -2
- package/dist/Types/Tournament.d.ts +4 -4
- package/dist/Types/Tournament.js +2 -2
- package/dist/Types/index.d.ts +12 -12
- package/dist/Types/index.js +28 -28
- package/dist/User/User.d.ts +6 -6
- package/dist/User/User.js +2 -2
- package/dist/User/index.d.ts +2 -2
- package/dist/User/index.js +18 -18
- package/dist/User/useMe.d.ts +4 -4
- package/dist/User/useMe.js +20 -21
- package/dist/User/useMe.js.map +1 -1
- package/dist/animations/Animation.d.ts +6 -6
- package/dist/animations/Animation.js +2 -2
- package/dist/animations/AnimationContext.d.ts +8 -8
- package/dist/animations/AnimationContext.js +2 -2
- package/dist/animations/AnimationState.d.ts +6 -6
- package/dist/animations/AnimationState.js +2 -2
- package/dist/animations/AnimationStep.d.ts +6 -6
- package/dist/animations/AnimationStep.js +10 -10
- package/dist/animations/AnimationStep.js.map +1 -1
- package/dist/animations/Animations.d.ts +8 -8
- package/dist/animations/Animations.js +22 -22
- package/dist/animations/Animations.js.map +1 -1
- package/dist/animations/AnimationsListenerCreator.d.ts +5 -4
- package/dist/animations/AnimationsListenerCreator.js +46 -50
- package/dist/animations/AnimationsListenerCreator.js.map +1 -1
- package/dist/animations/index.d.ts +6 -6
- package/dist/animations/index.js +22 -22
- package/dist/api/Client/GameClientAPI.d.ts +25 -24
- package/dist/api/Client/GameClientAPI.js +166 -166
- package/dist/api/Client/GameClientAPI.js.map +1 -1
- package/dist/api/Client/GameNotificationsListener.d.ts +5 -5
- package/dist/api/Client/GameNotificationsListener.js +116 -114
- package/dist/api/Client/GameNotificationsListener.js.map +1 -1
- package/dist/api/Client/RemoteGameLoader.d.ts +4 -5
- package/dist/api/Client/RemoteGameLoader.js +61 -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 +55 -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 +57 -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 +20 -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 +16 -0
- package/dist/api/Client/pusher.js.map +1 -0
- package/dist/api/GameAPI.d.ts +11 -10
- package/dist/api/GameAPI.js +2 -2
- package/dist/api/Local/ConsoleTools.d.ts +26 -25
- package/dist/api/Local/ConsoleTools.js +85 -86
- package/dist/api/Local/ConsoleTools.js.map +1 -1
- package/dist/api/Local/GameLocalAPI.d.ts +45 -44
- package/dist/api/Local/GameLocalAPI.js +541 -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 +49 -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 +17 -17
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.js +36 -36
- package/dist/util/ArrayUtil.d.ts +2 -2
- package/dist/util/ArrayUtil.js +20 -21
- package/dist/util/ArrayUtil.js.map +1 -1
- package/package.json +19 -22
|
@@ -1,51 +1,47 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
exports.createAnimationsListener = createAnimationsListener;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAnimationsListener = createAnimationsListener;
|
|
4
|
+
var es_toolkit_1 = require("es-toolkit");
|
|
5
|
+
var Actions_1 = require("../Actions");
|
|
6
|
+
var Store_1 = require("../Store");
|
|
7
|
+
function createAnimationsListener(store, Rules) {
|
|
8
|
+
var timers = new Map();
|
|
9
|
+
return function () {
|
|
10
|
+
var _a = store.getState(), actions = _a.actions, animationPaused = _a.animationPaused, players = _a.players, state = _a.state;
|
|
11
|
+
if (!actions || !state)
|
|
12
|
+
return;
|
|
13
|
+
var rules = new Rules(state);
|
|
14
|
+
var playersToAnimateAction = players.filter(function (player) { return rules.isTurnToPlay(player.id); }).map(function (player) { return player.id; });
|
|
15
|
+
var isAnimating = false;
|
|
16
|
+
var _loop_1 = function (action) {
|
|
17
|
+
var animation = action.animation;
|
|
18
|
+
if (animation) {
|
|
19
|
+
isAnimating = true;
|
|
20
|
+
if (action.activePlayers) {
|
|
21
|
+
playersToAnimateAction = (0, es_toolkit_1.intersection)(playersToAnimateAction, action.activePlayers);
|
|
22
|
+
}
|
|
23
|
+
var index = playersToAnimateAction.findIndex(function (p) { return p === action.playerId; });
|
|
24
|
+
if (index !== -1) {
|
|
25
|
+
playersToAnimateAction.splice(index, 1);
|
|
26
|
+
}
|
|
27
|
+
if (!timers.has(animation.id)) {
|
|
28
|
+
timers.set(animation.id, setTimeout(function () {
|
|
29
|
+
timers.delete(animation.id);
|
|
30
|
+
store.dispatch((0, Actions_1.animationComplete)(animation.id));
|
|
31
|
+
}, animation.duration * 1000));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else if (!animationPaused && (0, Store_1.isActionToAnimate)(action) && (!isAnimating || playersToAnimateAction.includes(action.playerId))) {
|
|
35
|
+
store.dispatch({ type: Actions_1.ANIMATION_START, actionId: action.id });
|
|
36
|
+
return { value: void 0 };
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
for (var _i = 0, actions_1 = actions; _i < actions_1.length; _i++) {
|
|
40
|
+
var action = actions_1[_i];
|
|
41
|
+
var state_1 = _loop_1(action);
|
|
42
|
+
if (typeof state_1 === "object")
|
|
43
|
+
return state_1.value;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
51
47
|
//# sourceMappingURL=AnimationsListenerCreator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationsListenerCreator.js","sourceRoot":"","sources":["../../src/animations/AnimationsListenerCreator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationsListenerCreator.js","sourceRoot":"","sources":["../../src/animations/AnimationsListenerCreator.ts"],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,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;oBAC9B,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,EAAE,UAAU,CAAC;wBAClC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;wBAC3B,KAAK,CAAC,QAAQ,CAAC,IAAA,2BAAiB,EAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAA;oBACjD,CAAC,EAAE,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAA;gBAChC,CAAC;YACH,CAAC;iBAAM,IAAI,CAAC,eAAe,IAAI,IAAA,yBAAiB,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,WAAW,IAAI,sBAAsB,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;gBAC/H,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,yBAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAG,EAAE,CAAC,CAAA;;YAEjE,CAAC;;QApBH,KAAqB,UAAO,EAAP,mBAAO,EAAP,qBAAO,EAAP,IAAO;YAAvB,IAAM,MAAM,gBAAA;kCAAN,MAAM;;;SAqBhB;IACH,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Animation';
|
|
2
|
-
export * from './AnimationContext';
|
|
3
|
-
export * from './Animations';
|
|
4
|
-
export * from './AnimationsListenerCreator';
|
|
5
|
-
export * from './AnimationState';
|
|
6
|
-
export * from './AnimationStep';
|
|
1
|
+
export * from './Animation';
|
|
2
|
+
export * from './AnimationContext';
|
|
3
|
+
export * from './Animations';
|
|
4
|
+
export * from './AnimationsListenerCreator';
|
|
5
|
+
export * from './AnimationState';
|
|
6
|
+
export * from './AnimationStep';
|
package/dist/animations/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
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("./Animation"), exports);
|
|
18
|
-
__exportStar(require("./AnimationContext"), exports);
|
|
19
|
-
__exportStar(require("./Animations"), exports);
|
|
20
|
-
__exportStar(require("./AnimationsListenerCreator"), exports);
|
|
21
|
-
__exportStar(require("./AnimationState"), exports);
|
|
22
|
-
__exportStar(require("./AnimationStep"), exports);
|
|
1
|
+
"use strict";
|
|
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("./Animation"), exports);
|
|
18
|
+
__exportStar(require("./AnimationContext"), exports);
|
|
19
|
+
__exportStar(require("./Animations"), exports);
|
|
20
|
+
__exportStar(require("./AnimationsListenerCreator"), exports);
|
|
21
|
+
__exportStar(require("./AnimationState"), exports);
|
|
22
|
+
__exportStar(require("./AnimationStep"), exports);
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { ApolloError } from '@apollo/client';
|
|
2
|
-
import { Dispatch } from 'redux';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare
|
|
9
|
-
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { ApolloError } from '@apollo/client';
|
|
2
|
+
import { Dispatch } from 'redux';
|
|
3
|
+
import { GameActions } from '../../Store/gameReducer';
|
|
4
|
+
import { GameAPI } from '../GameAPI';
|
|
5
|
+
export declare const AVATAR_INFO: import("@apollo/client").DocumentNode;
|
|
6
|
+
export declare const PLAYERS_TIME: import("@apollo/client").DocumentNode;
|
|
7
|
+
export declare const NOTIFICATIONS: import("@apollo/client").DocumentNode;
|
|
8
|
+
export declare const GET_MESSAGE_AUTHOR: import("@apollo/client").DocumentNode;
|
|
9
|
+
export declare class GameClientAPI<Game = any, Move = any, PlayerId = any> implements GameAPI<Game, Move, PlayerId> {
|
|
10
|
+
private dispatch?;
|
|
11
|
+
private readonly gameId;
|
|
12
|
+
private ongoingAction?;
|
|
13
|
+
private pendingActions;
|
|
14
|
+
constructor(gameId: string);
|
|
15
|
+
init(dispatch: Dispatch<GameActions<Game, Move, PlayerId>>): Promise<void>;
|
|
16
|
+
play(move: Move): void;
|
|
17
|
+
undo(action: number | string): void;
|
|
18
|
+
private executePendingActions;
|
|
19
|
+
private handleGameMessageResult;
|
|
20
|
+
eject(playerId: PlayerId): void;
|
|
21
|
+
giveUp(): void;
|
|
22
|
+
onError({ graphQLErrors, networkError }: ApolloError): void;
|
|
23
|
+
playTutorialMoves(): void;
|
|
24
|
+
claimVictory(): Promise<import("@apollo/client").FetchResult<any>>;
|
|
25
|
+
}
|
|
@@ -1,167 +1,167 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
16
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
17
|
-
return g =
|
|
18
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
19
|
-
function step(op) {
|
|
20
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
21
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
22
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
23
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
24
|
-
switch (op[0]) {
|
|
25
|
-
case 0: case 1: t = op; break;
|
|
26
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
27
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
28
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
29
|
-
default:
|
|
30
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
31
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
32
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
34
|
-
if (t[2]) _.ops.pop();
|
|
35
|
-
_.trys.pop(); continue;
|
|
36
|
-
}
|
|
37
|
-
op = body.call(thisArg, _);
|
|
38
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
39
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.GameClientAPI = exports.GET_MESSAGE_AUTHOR = exports.NOTIFICATIONS = exports.PLAYERS_TIME = exports.AVATAR_INFO = void 0;
|
|
44
|
-
var client_1 = require("@apollo/client");
|
|
45
|
-
var Actions_1 = require("../../Actions");
|
|
46
|
-
var Failure_1 = require("../../Failure");
|
|
47
|
-
var apollo_client_1 = require("./apollo-client");
|
|
48
|
-
exports.AVATAR_INFO = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["fragment AvatarInfo on Avataaar {accessoriesType clotheColor clotheType eyeType eyebrowType facialHairType facialHairColor graphicType hairColor mouthType skinColor topType}"], ["fragment AvatarInfo on Avataaar {accessoriesType clotheColor clotheType eyeType eyebrowType facialHairType facialHairColor graphicType hairColor mouthType skinColor topType}"])));
|
|
49
|
-
exports.PLAYERS_TIME = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["fragment PlayerTime on Player { time { availableTime cumulatedDownTime cumulatedPlayTime cumulatedWaitForMeTime highestDownTime highestPlayTime lastChange playing weightedWaitForMeTime } }"], ["fragment PlayerTime on Player { time { availableTime cumulatedDownTime cumulatedPlayTime cumulatedWaitForMeTime highestDownTime highestPlayTime lastChange playing weightedWaitForMeTime } }"])));
|
|
50
|
-
exports.NOTIFICATIONS = (0, client_1.gql)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["fragment Notifications on GameNotification { playerId ... on MovePlayedNotification { actionId moveView consequences } ... on MoveUndoneNotification { actionId moveUndone } }"], ["fragment Notifications on GameNotification { playerId ... on MovePlayedNotification { actionId moveView consequences } ... on MoveUndoneNotification { actionId moveUndone } }"])));
|
|
51
|
-
var PLAY = (0, client_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["mutation PlayMoves($gameId: String!, $moves: [JSON!]!) { playMoves(gameId: $gameId, moves: $moves) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""], ["mutation PlayMoves($gameId: String!, $moves: [JSON!]!) { playMoves(gameId: $gameId, moves: $moves) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""])), exports.NOTIFICATIONS, exports.PLAYERS_TIME);
|
|
52
|
-
var UNDO = (0, client_1.gql)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["mutation UndoMoves($gameId: String!, $actions: [String!]!) { undoMoves(gameId: $gameId, actions: $actions) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""], ["mutation UndoMoves($gameId: String!, $actions: [String!]!) { undoMoves(gameId: $gameId, actions: $actions) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""])), exports.NOTIFICATIONS, exports.PLAYERS_TIME);
|
|
53
|
-
var EJECT_PLAYER = (0, client_1.gql)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["mutation EjectPlayer($gameId: String!, $playerId: JSON!) { ejectPlayer(gameId: $gameId, playerId: $playerId) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""], ["mutation EjectPlayer($gameId: String!, $playerId: JSON!) { ejectPlayer(gameId: $gameId, playerId: $playerId) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""])), exports.NOTIFICATIONS, exports.PLAYERS_TIME);
|
|
54
|
-
var GIVE_UP = (0, client_1.gql)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["mutation GiveUp($gameId: String!) { giveUp(gameId: $gameId) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""], ["mutation GiveUp($gameId: String!) { giveUp(gameId: $gameId) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""])), exports.NOTIFICATIONS, exports.PLAYERS_TIME);
|
|
55
|
-
var CLAIM_VICTORY = (0, client_1.gql)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["mutation ClaimVictory($gameId: String!) { claimVictory(gameId: $gameId) { id endDate } }"], ["mutation ClaimVictory($gameId: String!) { claimVictory(gameId: $gameId) { id endDate } }"])));
|
|
56
|
-
exports.GET_MESSAGE_AUTHOR = (0, client_1.gql)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n query GetMessageAuthor($id: String!) {\n user(id: $id) {\n id name avatar {...AvatarInfo}\n }\n } ", "\n"], ["\n query GetMessageAuthor($id: String!) {\n user(id: $id) {\n id name avatar {...AvatarInfo}\n }\n } ", "\n"])), exports.AVATAR_INFO);
|
|
57
|
-
var GameClientAPI = (function () {
|
|
58
|
-
function GameClientAPI(gameId) {
|
|
59
|
-
this.pendingActions = [];
|
|
60
|
-
this.gameId = gameId;
|
|
61
|
-
}
|
|
62
|
-
GameClientAPI.prototype.init = function (dispatch) {
|
|
63
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
-
return __generator(this, function (_a) {
|
|
65
|
-
this.dispatch = dispatch;
|
|
66
|
-
return [2];
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
GameClientAPI.prototype.play = function (move) {
|
|
71
|
-
var _this = this;
|
|
72
|
-
if (this.pendingActions.length === 0) {
|
|
73
|
-
this.pendingActions.push({ type: 'PLAY', moves: [move] });
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
var lastPendingAction = this.pendingActions[this.pendingActions.length - 1];
|
|
77
|
-
if (lastPendingAction.type === 'PLAY') {
|
|
78
|
-
lastPendingAction.moves.push(move);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
this.pendingActions.push({ type: 'PLAY', moves: [move] });
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (!this.ongoingAction) {
|
|
85
|
-
this.ongoingAction = new Promise(function (resolve) { return setTimeout(resolve, 50); }).then(function () { return _this.executePendingActions(); });
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
GameClientAPI.prototype.undo = function (action) {
|
|
89
|
-
if (typeof action === 'number')
|
|
90
|
-
return console.error('GameClientAPI can no longer undo without an action ID');
|
|
91
|
-
if (this.pendingActions.length === 0) {
|
|
92
|
-
this.pendingActions.push({ type: 'UNDO', actions: [action] });
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
var lastPendingAction = this.pendingActions[this.pendingActions.length - 1];
|
|
96
|
-
if (lastPendingAction.type === 'UNDO') {
|
|
97
|
-
lastPendingAction.actions.push(action);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
this.pendingActions.push({ type: 'UNDO', actions: [action] });
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (!this.ongoingAction) {
|
|
104
|
-
this.executePendingActions();
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
GameClientAPI.prototype.executePendingActions = function () {
|
|
108
|
-
var _this = this;
|
|
109
|
-
if (this.pendingActions.length > 0) {
|
|
110
|
-
var pendingAction = this.pendingActions.shift();
|
|
111
|
-
if (pendingAction.type == 'PLAY') {
|
|
112
|
-
this.ongoingAction = (0, apollo_client_1.getApolloClient)().mutate({
|
|
113
|
-
mutation: PLAY, variables: { gameId: this.gameId, moves: pendingAction.moves }
|
|
114
|
-
}).then(function (result) { return result.data && _this.handleGameMessageResult(result.data.playMoves); });
|
|
115
|
-
}
|
|
116
|
-
else if (pendingAction.type === 'UNDO') {
|
|
117
|
-
this.ongoingAction = (0, apollo_client_1.getApolloClient)().mutate({
|
|
118
|
-
mutation: UNDO, variables: { gameId: this.gameId, actions: pendingAction.actions }
|
|
119
|
-
}).then(function (result) { return result.data && _this.handleGameMessageResult(result.data.undoMoves); });
|
|
120
|
-
}
|
|
121
|
-
if (this.ongoingAction) {
|
|
122
|
-
this.ongoingAction = this.ongoingAction.catch(function (error) { return _this.onError(error); }).finally(function () { return _this.executePendingActions(); });
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
delete this.ongoingAction;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
GameClientAPI.prototype.handleGameMessageResult = function (_a) {
|
|
130
|
-
var date = _a.date, index = _a.index, notifications = _a.notifications, players = _a.players;
|
|
131
|
-
this.dispatch((0, Actions_1.gameNotificationsReceived)(notifications, index, players, Date.parse(date)));
|
|
132
|
-
};
|
|
133
|
-
GameClientAPI.prototype.eject = function (playerId) {
|
|
134
|
-
var _this = this;
|
|
135
|
-
(0, apollo_client_1.getApolloClient)().mutate({ mutation: EJECT_PLAYER, variables: { gameId: this.gameId, playerId: playerId } })
|
|
136
|
-
.then(function (result) { return result.data && _this.handleGameMessageResult(result.data.ejectPlayer); });
|
|
137
|
-
};
|
|
138
|
-
GameClientAPI.prototype.giveUp = function () {
|
|
139
|
-
var _this = this;
|
|
140
|
-
(0, apollo_client_1.getApolloClient)().mutate({ mutation: GIVE_UP, variables: { gameId: this.gameId } })
|
|
141
|
-
.then(function (result) { return result.data && _this.handleGameMessageResult(result.data.giveUp); });
|
|
142
|
-
};
|
|
143
|
-
GameClientAPI.prototype.onError = function (_a) {
|
|
144
|
-
var _this = this;
|
|
145
|
-
var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError;
|
|
146
|
-
if (graphQLErrors) {
|
|
147
|
-
graphQLErrors.map(function (_a) {
|
|
148
|
-
var message = _a.message;
|
|
149
|
-
return _this.dispatch((0, Actions_1.actionFailed)(message));
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
if (networkError) {
|
|
153
|
-
console.error(networkError);
|
|
154
|
-
this.dispatch((0, Actions_1.actionFailed)(Failure_1.Failure.NETWORK));
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
GameClientAPI.prototype.playTutorialMoves = function () {
|
|
158
|
-
console.error('Tutorial should only be played with local API');
|
|
159
|
-
};
|
|
160
|
-
GameClientAPI.prototype.claimVictory = function () {
|
|
161
|
-
return (0, apollo_client_1.getApolloClient)().mutate({ mutation: CLAIM_VICTORY, variables: { gameId: this.gameId } });
|
|
162
|
-
};
|
|
163
|
-
return GameClientAPI;
|
|
164
|
-
}());
|
|
165
|
-
exports.GameClientAPI = GameClientAPI;
|
|
166
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
6
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
7
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
8
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
9
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
10
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
11
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
12
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
16
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
17
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
18
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
19
|
+
function step(op) {
|
|
20
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
21
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
22
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
23
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
24
|
+
switch (op[0]) {
|
|
25
|
+
case 0: case 1: t = op; break;
|
|
26
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
27
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
28
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
29
|
+
default:
|
|
30
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
31
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
32
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
33
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
34
|
+
if (t[2]) _.ops.pop();
|
|
35
|
+
_.trys.pop(); continue;
|
|
36
|
+
}
|
|
37
|
+
op = body.call(thisArg, _);
|
|
38
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
39
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.GameClientAPI = exports.GET_MESSAGE_AUTHOR = exports.NOTIFICATIONS = exports.PLAYERS_TIME = exports.AVATAR_INFO = void 0;
|
|
44
|
+
var client_1 = require("@apollo/client");
|
|
45
|
+
var Actions_1 = require("../../Actions");
|
|
46
|
+
var Failure_1 = require("../../Failure");
|
|
47
|
+
var apollo_client_1 = require("./apollo-client");
|
|
48
|
+
exports.AVATAR_INFO = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["fragment AvatarInfo on Avataaar {accessoriesType clotheColor clotheType eyeType eyebrowType facialHairType facialHairColor graphicType hairColor mouthType skinColor topType}"], ["fragment AvatarInfo on Avataaar {accessoriesType clotheColor clotheType eyeType eyebrowType facialHairType facialHairColor graphicType hairColor mouthType skinColor topType}"])));
|
|
49
|
+
exports.PLAYERS_TIME = (0, client_1.gql)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["fragment PlayerTime on Player { time { availableTime cumulatedDownTime cumulatedPlayTime cumulatedWaitForMeTime highestDownTime highestPlayTime lastChange playing weightedWaitForMeTime } }"], ["fragment PlayerTime on Player { time { availableTime cumulatedDownTime cumulatedPlayTime cumulatedWaitForMeTime highestDownTime highestPlayTime lastChange playing weightedWaitForMeTime } }"])));
|
|
50
|
+
exports.NOTIFICATIONS = (0, client_1.gql)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["fragment Notifications on GameNotification { playerId ... on MovePlayedNotification { actionId moveView consequences } ... on MoveUndoneNotification { actionId moveUndone } }"], ["fragment Notifications on GameNotification { playerId ... on MovePlayedNotification { actionId moveView consequences } ... on MoveUndoneNotification { actionId moveUndone } }"])));
|
|
51
|
+
var PLAY = (0, client_1.gql)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["mutation PlayMoves($gameId: String!, $moves: [JSON!]!) { playMoves(gameId: $gameId, moves: $moves) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""], ["mutation PlayMoves($gameId: String!, $moves: [JSON!]!) { playMoves(gameId: $gameId, moves: $moves) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""])), exports.NOTIFICATIONS, exports.PLAYERS_TIME);
|
|
52
|
+
var UNDO = (0, client_1.gql)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["mutation UndoMoves($gameId: String!, $actions: [String!]!) { undoMoves(gameId: $gameId, actions: $actions) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""], ["mutation UndoMoves($gameId: String!, $actions: [String!]!) { undoMoves(gameId: $gameId, actions: $actions) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""])), exports.NOTIFICATIONS, exports.PLAYERS_TIME);
|
|
53
|
+
var EJECT_PLAYER = (0, client_1.gql)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["mutation EjectPlayer($gameId: String!, $playerId: JSON!) { ejectPlayer(gameId: $gameId, playerId: $playerId) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""], ["mutation EjectPlayer($gameId: String!, $playerId: JSON!) { ejectPlayer(gameId: $gameId, playerId: $playerId) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""])), exports.NOTIFICATIONS, exports.PLAYERS_TIME);
|
|
54
|
+
var GIVE_UP = (0, client_1.gql)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["mutation GiveUp($gameId: String!) { giveUp(gameId: $gameId) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""], ["mutation GiveUp($gameId: String!) { giveUp(gameId: $gameId) { notifications { ...Notifications } index players { id ...PlayerTime } date } } ", " ", ""])), exports.NOTIFICATIONS, exports.PLAYERS_TIME);
|
|
55
|
+
var CLAIM_VICTORY = (0, client_1.gql)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["mutation ClaimVictory($gameId: String!) { claimVictory(gameId: $gameId) { id endDate } }"], ["mutation ClaimVictory($gameId: String!) { claimVictory(gameId: $gameId) { id endDate } }"])));
|
|
56
|
+
exports.GET_MESSAGE_AUTHOR = (0, client_1.gql)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n query GetMessageAuthor($id: String!) {\n user(id: $id) {\n id name avatar {...AvatarInfo}\n }\n } ", "\n"], ["\n query GetMessageAuthor($id: String!) {\n user(id: $id) {\n id name avatar {...AvatarInfo}\n }\n } ", "\n"])), exports.AVATAR_INFO);
|
|
57
|
+
var GameClientAPI = (function () {
|
|
58
|
+
function GameClientAPI(gameId) {
|
|
59
|
+
this.pendingActions = [];
|
|
60
|
+
this.gameId = gameId;
|
|
61
|
+
}
|
|
62
|
+
GameClientAPI.prototype.init = function (dispatch) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
this.dispatch = dispatch;
|
|
66
|
+
return [2];
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
GameClientAPI.prototype.play = function (move) {
|
|
71
|
+
var _this = this;
|
|
72
|
+
if (this.pendingActions.length === 0) {
|
|
73
|
+
this.pendingActions.push({ type: 'PLAY', moves: [move] });
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
var lastPendingAction = this.pendingActions[this.pendingActions.length - 1];
|
|
77
|
+
if (lastPendingAction.type === 'PLAY') {
|
|
78
|
+
lastPendingAction.moves.push(move);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.pendingActions.push({ type: 'PLAY', moves: [move] });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!this.ongoingAction) {
|
|
85
|
+
this.ongoingAction = new Promise(function (resolve) { return setTimeout(resolve, 50); }).then(function () { return _this.executePendingActions(); });
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
GameClientAPI.prototype.undo = function (action) {
|
|
89
|
+
if (typeof action === 'number')
|
|
90
|
+
return console.error('GameClientAPI can no longer undo without an action ID');
|
|
91
|
+
if (this.pendingActions.length === 0) {
|
|
92
|
+
this.pendingActions.push({ type: 'UNDO', actions: [action] });
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
var lastPendingAction = this.pendingActions[this.pendingActions.length - 1];
|
|
96
|
+
if (lastPendingAction.type === 'UNDO') {
|
|
97
|
+
lastPendingAction.actions.push(action);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
this.pendingActions.push({ type: 'UNDO', actions: [action] });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!this.ongoingAction) {
|
|
104
|
+
this.executePendingActions();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
GameClientAPI.prototype.executePendingActions = function () {
|
|
108
|
+
var _this = this;
|
|
109
|
+
if (this.pendingActions.length > 0) {
|
|
110
|
+
var pendingAction = this.pendingActions.shift();
|
|
111
|
+
if (pendingAction.type == 'PLAY') {
|
|
112
|
+
this.ongoingAction = (0, apollo_client_1.getApolloClient)().mutate({
|
|
113
|
+
mutation: PLAY, variables: { gameId: this.gameId, moves: pendingAction.moves }
|
|
114
|
+
}).then(function (result) { return result.data && _this.handleGameMessageResult(result.data.playMoves); });
|
|
115
|
+
}
|
|
116
|
+
else if (pendingAction.type === 'UNDO') {
|
|
117
|
+
this.ongoingAction = (0, apollo_client_1.getApolloClient)().mutate({
|
|
118
|
+
mutation: UNDO, variables: { gameId: this.gameId, actions: pendingAction.actions }
|
|
119
|
+
}).then(function (result) { return result.data && _this.handleGameMessageResult(result.data.undoMoves); });
|
|
120
|
+
}
|
|
121
|
+
if (this.ongoingAction) {
|
|
122
|
+
this.ongoingAction = this.ongoingAction.catch(function (error) { return _this.onError(error); }).finally(function () { return _this.executePendingActions(); });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
delete this.ongoingAction;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
GameClientAPI.prototype.handleGameMessageResult = function (_a) {
|
|
130
|
+
var date = _a.date, index = _a.index, notifications = _a.notifications, players = _a.players;
|
|
131
|
+
this.dispatch((0, Actions_1.gameNotificationsReceived)(notifications, index, players, Date.parse(date)));
|
|
132
|
+
};
|
|
133
|
+
GameClientAPI.prototype.eject = function (playerId) {
|
|
134
|
+
var _this = this;
|
|
135
|
+
(0, apollo_client_1.getApolloClient)().mutate({ mutation: EJECT_PLAYER, variables: { gameId: this.gameId, playerId: playerId } })
|
|
136
|
+
.then(function (result) { return result.data && _this.handleGameMessageResult(result.data.ejectPlayer); });
|
|
137
|
+
};
|
|
138
|
+
GameClientAPI.prototype.giveUp = function () {
|
|
139
|
+
var _this = this;
|
|
140
|
+
(0, apollo_client_1.getApolloClient)().mutate({ mutation: GIVE_UP, variables: { gameId: this.gameId } })
|
|
141
|
+
.then(function (result) { return result.data && _this.handleGameMessageResult(result.data.giveUp); });
|
|
142
|
+
};
|
|
143
|
+
GameClientAPI.prototype.onError = function (_a) {
|
|
144
|
+
var _this = this;
|
|
145
|
+
var graphQLErrors = _a.graphQLErrors, networkError = _a.networkError;
|
|
146
|
+
if (graphQLErrors) {
|
|
147
|
+
graphQLErrors.map(function (_a) {
|
|
148
|
+
var message = _a.message;
|
|
149
|
+
return _this.dispatch((0, Actions_1.actionFailed)(message));
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (networkError) {
|
|
153
|
+
console.error(networkError);
|
|
154
|
+
this.dispatch((0, Actions_1.actionFailed)(Failure_1.Failure.NETWORK));
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
GameClientAPI.prototype.playTutorialMoves = function () {
|
|
158
|
+
console.error('Tutorial should only be played with local API');
|
|
159
|
+
};
|
|
160
|
+
GameClientAPI.prototype.claimVictory = function () {
|
|
161
|
+
return (0, apollo_client_1.getApolloClient)().mutate({ mutation: CLAIM_VICTORY, variables: { gameId: this.gameId } });
|
|
162
|
+
};
|
|
163
|
+
return GameClientAPI;
|
|
164
|
+
}());
|
|
165
|
+
exports.GameClientAPI = GameClientAPI;
|
|
166
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
167
167
|
//# sourceMappingURL=GameClientAPI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameClientAPI.js","sourceRoot":"","sources":["../../../src/api/Client/GameClientAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAiD;AAEjD,yCAAuE;AACvE,yCAAuC;
|
|
1
|
+
{"version":3,"file":"GameClientAPI.js","sourceRoot":"","sources":["../../../src/api/Client/GameClientAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAiD;AAEjD,yCAAuE;AACvE,yCAAuC;AAIvC,iDAAiD;AAEpC,QAAA,WAAW,OAAG,YAAG,mPAAA,+KAA+K,KAAA;AAChM,QAAA,YAAY,OAAG,YAAG,kQAAA,8LAA8L,KAAA;AAChN,QAAA,aAAa,OAAG,YAAG,oPAAA,gLAAgL,KAAA;AAChN,IAAM,IAAI,OAAG,YAAG,mQAAA,sLAAuL,EAAa,GAAI,EAAY,EAAE,KAA/B,qBAA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;QACnC,IAAI,aAAa,EAAE,CAAC;YAClB,aAAa,CAAC,GAAG,CAAC,UAAC,EAAW;oBAAT,OAAO,aAAA;gBAAO,OAAA,KAAI,CAAC,QAAS,CAAC,IAAA,sBAAY,EAAC,OAAO,CAAC,CAAC;YAArC,CAAqC,CAAC,CAAA;QAC3E,CAAC;QACD,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;YAC3B,IAAI,CAAC,QAAS,CAAC,IAAA,sBAAY,EAAC,iBAAO,CAAC,OAAO,CAAC,CAAC,CAAA;QAC/C,CAAC;IACH,CAAC;IAED,yCAAiB,GAAjB;QACE,OAAO,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAA;IAChE,CAAC;IAED,oCAAY,GAAZ;QACE,OAAO,IAAA,+BAAe,GAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAClG,CAAC;IACH,oBAAC;AAAD,CAAC,AAnGD,IAmGC;AAnGY,sCAAa"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function GameNotificationsListener({ gameId, channelName, notificationsCount }: {
|
|
2
|
-
gameId: string;
|
|
3
|
-
channelName: string;
|
|
4
|
-
notificationsCount: number;
|
|
5
|
-
}): null;
|
|
1
|
+
export declare function GameNotificationsListener({ gameId, channelName, notificationsCount }: {
|
|
2
|
+
gameId: string;
|
|
3
|
+
channelName: string;
|
|
4
|
+
notificationsCount: number;
|
|
5
|
+
}): null;
|