@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,59 +1,58 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
-
if (ar || !(i in from)) {
|
|
5
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
-
ar[i] = from[i];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getApolloClient =
|
|
16
|
-
var client_1 = require("@apollo/client");
|
|
17
|
-
var retry_1 = require("@apollo/client/link/retry");
|
|
18
|
-
var dayjs_1 = __importDefault(require("dayjs"));
|
|
19
|
-
var index_1 = require("../../index");
|
|
20
|
-
var apolloClient;
|
|
21
|
-
function getApolloClient() {
|
|
22
|
-
if (!apolloClient) {
|
|
23
|
-
apolloClient = initApolloClient();
|
|
24
|
-
}
|
|
25
|
-
return apolloClient;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var _a;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getApolloClient = getApolloClient;
|
|
16
|
+
var client_1 = require("@apollo/client");
|
|
17
|
+
var retry_1 = require("@apollo/client/link/retry");
|
|
18
|
+
var dayjs_1 = __importDefault(require("dayjs"));
|
|
19
|
+
var index_1 = require("../../index");
|
|
20
|
+
var apolloClient;
|
|
21
|
+
function getApolloClient() {
|
|
22
|
+
if (!apolloClient) {
|
|
23
|
+
apolloClient = initApolloClient();
|
|
24
|
+
}
|
|
25
|
+
return apolloClient;
|
|
26
|
+
}
|
|
27
|
+
function initApolloClient() {
|
|
28
|
+
var _a;
|
|
29
|
+
var httpLink = new client_1.HttpLink({ uri: index_1.PLATFORM_URI + ((_a = process.env.REACT_APP_GRAPHQL_ENDPOINT) !== null && _a !== void 0 ? _a : '/api/graphql'), fetch: fetch, credentials: 'include' });
|
|
30
|
+
return new client_1.ApolloClient({
|
|
31
|
+
link: client_1.ApolloLink.from([new retry_1.RetryLink(), httpLink]),
|
|
32
|
+
cache: new client_1.InMemoryCache({
|
|
33
|
+
typePolicies: {
|
|
34
|
+
ChatChannel: {
|
|
35
|
+
keyFields: ['name'],
|
|
36
|
+
fields: {
|
|
37
|
+
messages: {
|
|
38
|
+
keyArgs: false,
|
|
39
|
+
merge: function (existing, incoming) {
|
|
40
|
+
if (existing === void 0) { existing = []; }
|
|
41
|
+
if (incoming === void 0) { incoming = []; }
|
|
42
|
+
return __spreadArray(__spreadArray([], incoming, true), existing, true).sort(function (m1, m2) { return (0, dayjs_1.default)(m1.date).unix() - (0, dayjs_1.default)(m2.date).unix(); })
|
|
43
|
+
.filter(function (message, index, messages) { return index === 0 || message.id !== messages[index - 1].id; });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
Message: {
|
|
49
|
+
keyFields: false
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
possibleTypes: {
|
|
53
|
+
GameNotification: ['MovePlayedNotification', 'MoveUndoneNotification']
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
59
58
|
//# sourceMappingURL=apollo-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apollo-client.js","sourceRoot":"","sources":["../../../src/api/Client/apollo-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apollo-client.js","sourceRoot":"","sources":["../../../src/api/Client/apollo-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAQA,0CAKC;AAbD,yCAAkF;AAClF,mDAAqD;AACrD,gDAAyB;AAEzB,qCAA0C;AAE1C,IAAI,YAA2C,CAAA;AAE/C,SAAgB,eAAe;IAC7B,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,YAAY,GAAG,gBAAgB,EAAE,CAAA;IACnC,CAAC;IACD,OAAO,YAAY,CAAA;AACrB,CAAC;AAED,SAAS,gBAAgB;;IACvB,IAAM,QAAQ,GAAG,IAAI,iBAAQ,CAAC,EAAE,GAAG,EAAE,oBAAY,GAAG,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,0BAA0B,mCAAI,cAAc,CAAC,EAAE,KAAK,OAAA,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,CAAA;IAChJ,OAAO,IAAI,qBAAY,CAAC;QACtB,IAAI,EAAE,mBAAU,CAAC,IAAI,CAAC,CAAC,IAAI,iBAAS,EAAE,EAAE,QAAQ,CAAC,CAAC;QAClD,KAAK,EAAE,IAAI,sBAAa,CAAC;YACvB,YAAY,EAAE;gBACZ,WAAW,EAAE;oBACX,SAAS,EAAE,CAAC,MAAM,CAAC;oBACnB,MAAM,EAAE;wBACN,QAAQ,EAAE;4BACR,OAAO,EAAE,KAAK;4BACd,KAAK,YAAC,QAAwB,EAAE,QAAwB;gCAAlD,yBAAA,EAAA,aAAwB;gCAAE,yBAAA,EAAA,aAAwB;gCACtD,OAAO,gCAAI,QAAQ,SAAK,QAAQ,QAC7B,IAAI,CAAC,UAAC,EAAE,EAAE,EAAE,IAAK,OAAA,IAAA,eAAK,EAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,GAAG,IAAA,eAAK,EAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAA7C,CAA6C,CAAC;qCAC/D,MAAM,CAAC,UAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,IAAK,OAAA,KAAK,KAAK,CAAC,IAAI,OAAO,CAAC,EAAE,KAAK,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,EAApD,CAAoD,CAAC,CAAA;4BAC/F,CAAC;yBACF;qBACF;iBACF;gBACD,OAAO,EAAE;oBACP,SAAS,EAAE,KAAK;iBACjB;aACF;YACD,aAAa,EAAE;gBACb,gBAAgB,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;aACvE;SACF,CAAC;KACH,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from './apollo-client';
|
|
2
|
-
export * from './GameClientAPI';
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './apollo-client';
|
|
2
|
+
export * from './GameClientAPI';
|
|
3
|
+
export * from './pusher';
|
|
4
|
+
export * from './RemoteGameProvider';
|
package/dist/api/Client/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
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("./apollo-client"), exports);
|
|
18
|
-
__exportStar(require("./GameClientAPI"), exports);
|
|
19
|
-
__exportStar(require("./
|
|
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("./apollo-client"), exports);
|
|
18
|
+
__exportStar(require("./GameClientAPI"), exports);
|
|
19
|
+
__exportStar(require("./pusher"), exports);
|
|
20
|
+
__exportStar(require("./RemoteGameProvider"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/Client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,kDAA+B;AAC/B,uDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/Client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA+B;AAC/B,kDAA+B;AAC/B,2CAAwB;AACxB,uDAAoC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
var _a, _b, _c;
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.pusherClient = void 0;
|
|
8
|
+
var pusher_js_1 = __importDefault(require("pusher-js"));
|
|
9
|
+
var index_1 = require("../../index");
|
|
10
|
+
exports.pusherClient = new pusher_js_1.default((_a = process.env.REACT_APP_PUSHER_KEY) !== null && _a !== void 0 ? _a : '747557f1e8edf7fc2816', {
|
|
11
|
+
cluster: (_b = process.env.REACT_APP_PUSHER_CLUSTER) !== null && _b !== void 0 ? _b : 'eu',
|
|
12
|
+
authEndpoint: index_1.PLATFORM_URI + ((_c = process.env.REACT_APP_PUSHER_ENDPOINT) !== null && _c !== void 0 ? _c : '/api/pusher/auth'),
|
|
13
|
+
forceTLS: true,
|
|
14
|
+
disableStats: true
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=pusher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pusher.js","sourceRoot":"","sources":["../../../src/api/Client/pusher.ts"],"names":[],"mappings":";;;;;;;AAAA,wDAA8B;AAC9B,qCAA0C;AAE7B,QAAA,YAAY,GAAG,IAAI,mBAAM,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,oBAAoB,mCAAI,sBAAsB,EAAE;IACjG,OAAO,EAAE,MAAA,OAAO,CAAC,GAAG,CAAC,wBAAwB,mCAAI,IAAI;IACrD,YAAY,EAAE,oBAAY,GAAG,CAAC,MAAA,OAAO,CAAC,GAAG,CAAC,yBAAyB,mCAAI,kBAAkB,CAAC;IAC1F,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;CACnB,CAAC,CAAA"}
|
package/dist/api/GameAPI.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Dispatch } from 'redux';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
undo(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { Dispatch } from 'redux';
|
|
2
|
+
import { GameActions } from '../Store/gameReducer';
|
|
3
|
+
export interface GameAPI<Game = any, Move = string, PlayerId = number> {
|
|
4
|
+
init(dispatch: Dispatch<GameActions<Game, Move, PlayerId>>): void;
|
|
5
|
+
play(move: Move): void;
|
|
6
|
+
undo(playerActionIndex: number): void;
|
|
7
|
+
undo(actionId: string): void;
|
|
8
|
+
eject(playerId: PlayerId): void;
|
|
9
|
+
giveUp(): void;
|
|
10
|
+
playTutorialMoves(quantity: number): void;
|
|
11
|
+
}
|
package/dist/api/GameAPI.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=GameAPI.js.map
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { Action } from '@gamepark/rules-api';
|
|
2
|
-
import { Store } from 'redux';
|
|
3
|
-
import { GamePageState } from '../../Store';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export
|
|
1
|
+
import { Action } from '@gamepark/rules-api';
|
|
2
|
+
import { Store } from 'redux';
|
|
3
|
+
import { GamePageState } from '../../Store';
|
|
4
|
+
import { GameActions } from '../../Store/gameReducer';
|
|
5
|
+
import { GameLocalAPI } from './GameLocalAPI';
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
game: ConsoleTools;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
type ConsoleTools<Game = any, Move = any, PlayerId = any> = {
|
|
12
|
+
state: Game;
|
|
13
|
+
store: GamePageState<Game>;
|
|
14
|
+
moves: Action<Move, PlayerId>[];
|
|
15
|
+
new: (options?: any) => void;
|
|
16
|
+
undo: (quantity?: number) => void;
|
|
17
|
+
monkeyOpponents: (start?: boolean) => void;
|
|
18
|
+
bot: (start?: boolean) => void;
|
|
19
|
+
setPlayerName: (name: string, playerId?: PlayerId) => void;
|
|
20
|
+
setAnimationsSpeed: (speed?: number) => void;
|
|
21
|
+
tutorial: (options?: any) => void;
|
|
22
|
+
changePlayer: (playerId?: PlayerId) => void;
|
|
23
|
+
timer: (seconds: number, playerId?: PlayerId) => void;
|
|
24
|
+
};
|
|
25
|
+
export declare function consoleTools<Game, Move, PlayerId, View, MoveView>(gameServerProxy: GameLocalAPI<Game, Move, PlayerId, View, MoveView>, store: Store<GamePageState<Game, Move, PlayerId>, GameActions<Game, Move, PlayerId>>): ConsoleTools<Game, Move, PlayerId>;
|
|
26
|
+
export {};
|
|
@@ -1,87 +1,86 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.consoleTools =
|
|
4
|
-
var Types_1 = require("../../Types");
|
|
5
|
-
function consoleTools(gameServerProxy, store) {
|
|
6
|
-
return {
|
|
7
|
-
get state() {
|
|
8
|
-
return gameServerProxy.getLocalStore().state;
|
|
9
|
-
},
|
|
10
|
-
get store() {
|
|
11
|
-
return store.getState();
|
|
12
|
-
},
|
|
13
|
-
get moves() {
|
|
14
|
-
return gameServerProxy.getLocalStore().actions;
|
|
15
|
-
},
|
|
16
|
-
new: function (options) {
|
|
17
|
-
gameServerProxy.newGame(options);
|
|
18
|
-
window.location.reload();
|
|
19
|
-
},
|
|
20
|
-
undo: function (quantity) {
|
|
21
|
-
if (quantity === void 0) { quantity = 1; }
|
|
22
|
-
gameServerProxy.undo(quantity);
|
|
23
|
-
},
|
|
24
|
-
monkeyOpponents: function (start) {
|
|
25
|
-
if (start === void 0) { start = true; }
|
|
26
|
-
if (start) {
|
|
27
|
-
gameServerProxy.startBots();
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
gameServerProxy.stopBots();
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
bot: function (start) {
|
|
34
|
-
if (start === void 0) { start = true; }
|
|
35
|
-
if (start) {
|
|
36
|
-
gameServerProxy.startBots();
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
gameServerProxy.stopBots();
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
setPlayerName: function (name, playerId) {
|
|
43
|
-
gameServerProxy.setPlayerName(name, playerId);
|
|
44
|
-
window.location.reload();
|
|
45
|
-
},
|
|
46
|
-
setAnimationsSpeed: function (speed) {
|
|
47
|
-
if (speed === void 0) { speed = 1; }
|
|
48
|
-
gameServerProxy.setAnimationsSpeed(speed);
|
|
49
|
-
},
|
|
50
|
-
tutorial: function () {
|
|
51
|
-
gameServerProxy.newTutorial();
|
|
52
|
-
window.location.reload();
|
|
53
|
-
},
|
|
54
|
-
changePlayer: function (playerId) {
|
|
55
|
-
var localStore = gameServerProxy.getLocalStore();
|
|
56
|
-
localStore.playerId = playerId;
|
|
57
|
-
localStorage.setItem(gameServerProxy.storage, JSON.stringify(localStore));
|
|
58
|
-
window.location.reload();
|
|
59
|
-
},
|
|
60
|
-
timer: function (seconds, playerId) {
|
|
61
|
-
var localStore = gameServerProxy.getLocalStore();
|
|
62
|
-
localStore.options = {
|
|
63
|
-
speed: Types_1.GameSpeed.RealTime,
|
|
64
|
-
maxExceedTime: 60,
|
|
65
|
-
maxSpareTime: 180
|
|
66
|
-
};
|
|
67
|
-
if (playerId === undefined)
|
|
68
|
-
playerId = localStore.playerId;
|
|
69
|
-
var player = localStore.players.find(function (player) { return player.id === playerId; });
|
|
70
|
-
player.time = {
|
|
71
|
-
playing: true,
|
|
72
|
-
lastChange: new Date().toISOString(),
|
|
73
|
-
availableTime: seconds * 1000,
|
|
74
|
-
highestPlayTime: 0,
|
|
75
|
-
highestDownTime: 0,
|
|
76
|
-
cumulatedPlayTime: 0,
|
|
77
|
-
cumulatedDownTime: 0,
|
|
78
|
-
cumulatedWaitForMeTime: 0,
|
|
79
|
-
weightedWaitForMeTime: 0
|
|
80
|
-
};
|
|
81
|
-
localStorage.setItem(gameServerProxy.storage, JSON.stringify(localStore));
|
|
82
|
-
window.location.reload();
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
exports.consoleTools = consoleTools;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.consoleTools = consoleTools;
|
|
4
|
+
var Types_1 = require("../../Types");
|
|
5
|
+
function consoleTools(gameServerProxy, store) {
|
|
6
|
+
return {
|
|
7
|
+
get state() {
|
|
8
|
+
return gameServerProxy.getLocalStore().state;
|
|
9
|
+
},
|
|
10
|
+
get store() {
|
|
11
|
+
return store.getState();
|
|
12
|
+
},
|
|
13
|
+
get moves() {
|
|
14
|
+
return gameServerProxy.getLocalStore().actions;
|
|
15
|
+
},
|
|
16
|
+
new: function (options) {
|
|
17
|
+
gameServerProxy.newGame(options);
|
|
18
|
+
window.location.reload();
|
|
19
|
+
},
|
|
20
|
+
undo: function (quantity) {
|
|
21
|
+
if (quantity === void 0) { quantity = 1; }
|
|
22
|
+
gameServerProxy.undo(quantity);
|
|
23
|
+
},
|
|
24
|
+
monkeyOpponents: function (start) {
|
|
25
|
+
if (start === void 0) { start = true; }
|
|
26
|
+
if (start) {
|
|
27
|
+
gameServerProxy.startBots();
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
gameServerProxy.stopBots();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
bot: function (start) {
|
|
34
|
+
if (start === void 0) { start = true; }
|
|
35
|
+
if (start) {
|
|
36
|
+
gameServerProxy.startBots();
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
gameServerProxy.stopBots();
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
setPlayerName: function (name, playerId) {
|
|
43
|
+
gameServerProxy.setPlayerName(name, playerId);
|
|
44
|
+
window.location.reload();
|
|
45
|
+
},
|
|
46
|
+
setAnimationsSpeed: function (speed) {
|
|
47
|
+
if (speed === void 0) { speed = 1; }
|
|
48
|
+
gameServerProxy.setAnimationsSpeed(speed);
|
|
49
|
+
},
|
|
50
|
+
tutorial: function () {
|
|
51
|
+
gameServerProxy.newTutorial();
|
|
52
|
+
window.location.reload();
|
|
53
|
+
},
|
|
54
|
+
changePlayer: function (playerId) {
|
|
55
|
+
var localStore = gameServerProxy.getLocalStore();
|
|
56
|
+
localStore.playerId = playerId;
|
|
57
|
+
localStorage.setItem(gameServerProxy.storage, JSON.stringify(localStore));
|
|
58
|
+
window.location.reload();
|
|
59
|
+
},
|
|
60
|
+
timer: function (seconds, playerId) {
|
|
61
|
+
var localStore = gameServerProxy.getLocalStore();
|
|
62
|
+
localStore.options = {
|
|
63
|
+
speed: Types_1.GameSpeed.RealTime,
|
|
64
|
+
maxExceedTime: 60,
|
|
65
|
+
maxSpareTime: 180
|
|
66
|
+
};
|
|
67
|
+
if (playerId === undefined)
|
|
68
|
+
playerId = localStore.playerId;
|
|
69
|
+
var player = localStore.players.find(function (player) { return player.id === playerId; });
|
|
70
|
+
player.time = {
|
|
71
|
+
playing: true,
|
|
72
|
+
lastChange: new Date().toISOString(),
|
|
73
|
+
availableTime: seconds * 1000,
|
|
74
|
+
highestPlayTime: 0,
|
|
75
|
+
highestDownTime: 0,
|
|
76
|
+
cumulatedPlayTime: 0,
|
|
77
|
+
cumulatedDownTime: 0,
|
|
78
|
+
cumulatedWaitForMeTime: 0,
|
|
79
|
+
weightedWaitForMeTime: 0
|
|
80
|
+
};
|
|
81
|
+
localStorage.setItem(gameServerProxy.storage, JSON.stringify(localStore));
|
|
82
|
+
window.location.reload();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
87
86
|
//# sourceMappingURL=ConsoleTools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleTools.js","sourceRoot":"","sources":["../../../src/api/Local/ConsoleTools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsoleTools.js","sourceRoot":"","sources":["../../../src/api/Local/ConsoleTools.ts"],"names":[],"mappings":";;AA6BA,oCAsFC;AA/GD,qCAAuC;AAyBvC,SAAgB,YAAY,CAC1B,eAAmE,EAAE,KAAoF;IAEzJ,OAAO;QACL,IAAI,KAAK;YACP,OAAO,eAAe,CAAC,aAAa,EAAE,CAAC,KAAK,CAAA;QAC9C,CAAC;QAED,IAAI,KAAK;YACP,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;QACzB,CAAC;QAED,IAAI,KAAK;YACP,OAAO,eAAe,CAAC,aAAa,EAAE,CAAC,OAAO,CAAA;QAChD,CAAC;QAED,GAAG,EAAE,UAAC,OAAO;YACX,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;YAChC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;QAC1B,CAAC;QAED,IAAI,EAAE,UAAC,QAAoB;YAApB,yBAAA,EAAA,YAAoB;YACzB,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAChC,CAAC;QAED,eAAe,EAAE,UAAC,KAAY;YAAZ,sBAAA,EAAA,YAAY;YAC5B,IAAI,KAAK,EAAE,CAAC;gBACV,eAAe,CAAC,SAAS,EAAE,CAAA;YAC7B,CAAC;iBAAM,CAAC;gBACN,eAAe,CAAC,QAAQ,EAAE,CAAA;YAC5B,CAAC;QACH,CAAC;QAED,GAAG,EAAE,UAAC,KAAY;YAAZ,sBAAA,EAAA,YAAY;YAChB,IAAI,KAAK,EAAE,CAAC;gBACV,eAAe,CAAC,SAAS,EAAE,CAAA;YAC7B,CAAC;iBAAM,CAAC;gBACN,eAAe,CAAC,QAAQ,EAAE,CAAA;YAC5B,CAAC;QACH,CAAC;QAED,aAAa,EAAE,UAAC,IAAY,EAAE,QAAmB;YAC/C,eAAe,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;YAC7C,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;QAC1B,CAAC;QAED,kBAAkB,EAAE,UAAC,KAAS;YAAT,sBAAA,EAAA,SAAS;YAC5B,eAAe,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAA;QAC3C,CAAC;QAED,QAAQ,EAAE;YACR,eAAe,CAAC,WAAW,EAAE,CAAA;YAC7B,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;QAC1B,CAAC;QAED,YAAY,EAAE,UAAC,QAAmB;YAChC,IAAM,UAAU,GAAG,eAAe,CAAC,aAAa,EAAE,CAAA;YAClD,UAAU,CAAC,QAAQ,GAAG,QAAQ,CAAA;YAC9B,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAA;YACzE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;QAC1B,CAAC;QAED,KAAK,EAAE,UAAC,OAAe,EAAE,QAAmB;YAC1C,IAAM,UAAU,GAAG,eAAe,CAAC,aAAa,EAAE,CAAA;YAClD,UAAU,CAAC,OAAO,GAAG;gBACnB,KAAK,EAAE,iBAAS,CAAC,QAAQ;gBACzB,aAAa,EAAE,EAAE;gBACjB,YAAY,EAAE,GAAG;aAClB,CAAA;YACD,IAAI,QAAQ,KAAK,SAAS;gBAAE,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAA;YAC1D,IAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,EAAE,KAAK,QAAQ,EAAtB,CAAsB,CAAE,CAAA;YACzE,MAAM,CAAC,IAAI,GAAG;gBACZ,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;gBACpC,aAAa,EAAE,OAAO,GAAG,IAAI;gBAC7B,eAAe,EAAE,CAAC;gBAClB,eAAe,EAAE,CAAC;gBAClB,iBAAiB,EAAE,CAAC;gBACpB,iBAAiB,EAAE,CAAC;gBACpB,sBAAsB,EAAE,CAAC;gBACzB,qBAAqB,EAAE,CAAC;aACzB,CAAA;YACD,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAA;YACzE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;QAC1B,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { GameSetup, OptionsSpec, RulesCreator } from '@gamepark/rules-api';
|
|
2
|
-
import { Dispatch } from 'redux';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private readonly
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
private
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
1
|
+
import { GameSetup, OptionsSpec, RulesCreator } from '@gamepark/rules-api';
|
|
2
|
+
import { Dispatch } from 'redux';
|
|
3
|
+
import { GameActions } from '../../Store/gameReducer';
|
|
4
|
+
import { GameAI, GameNotification, Player, ProxyGameData } from '../../Types';
|
|
5
|
+
import { GameAPI } from '../GameAPI';
|
|
6
|
+
import { LocalGameProviderProps } from './LocalGameProvider';
|
|
7
|
+
export declare class GameLocalAPI<Game, Move = string, PlayerId = number, GameView = Game, MoveView = Move, Options extends {
|
|
8
|
+
players: any;
|
|
9
|
+
} | undefined = undefined> implements GameAPI<Game, Move, PlayerId> {
|
|
10
|
+
storage: string;
|
|
11
|
+
gameSetup: GameSetup<Game, Options>;
|
|
12
|
+
Rules: RulesCreator<Game, Move, PlayerId>;
|
|
13
|
+
ClientRules: RulesCreator<GameView, MoveView, PlayerId>;
|
|
14
|
+
optionsSpec?: OptionsSpec<Options>;
|
|
15
|
+
private readonly ai?;
|
|
16
|
+
private readonly tutorial?;
|
|
17
|
+
dispatch?: Dispatch<GameActions<Game | GameView, Move, PlayerId>>;
|
|
18
|
+
private lastActionId;
|
|
19
|
+
private notificationsCount;
|
|
20
|
+
private autoPlayersCounter;
|
|
21
|
+
private aiProcessing;
|
|
22
|
+
private tutorialMovesToPlay;
|
|
23
|
+
constructor({ Rules, ServerRules, GameSetup, ai, game, storage, optionsSpec, tutorial }: LocalGameProviderProps<Game, GameView, Move, MoveView, PlayerId>);
|
|
24
|
+
init(dispatch: Dispatch<GameActions<Game, Move, PlayerId>>): void;
|
|
25
|
+
initLocalStore(): ProxyGameData;
|
|
26
|
+
getNotifications(data: ProxyGameData<Game, MoveView, PlayerId>): GameNotification<PlayerId>[];
|
|
27
|
+
newTutorial(): ProxyGameData;
|
|
28
|
+
private getGameOptions;
|
|
29
|
+
newGame(arg?: Options | number): ProxyGameData;
|
|
30
|
+
initGameStore(game: Game, players: Player<PlayerId>[], tutorial?: number): ProxyGameData<Game, Move, PlayerId>;
|
|
31
|
+
getLocalStore(): ProxyGameData<Game, Move, PlayerId>;
|
|
32
|
+
play(move: Move): Promise<void>;
|
|
33
|
+
playActions(playerId: PlayerId, moves: Move[]): void;
|
|
34
|
+
private incrementNotificationsCount;
|
|
35
|
+
undo(arg?: string | number, ignoreRules?: boolean): void;
|
|
36
|
+
startBots(): void;
|
|
37
|
+
stopBots(): void;
|
|
38
|
+
private runAutoPlayers;
|
|
39
|
+
getAI(playerId: PlayerId): GameAI<Game, Move, PlayerId>;
|
|
40
|
+
setPlayerName(name: string, playerId?: PlayerId): void;
|
|
41
|
+
setAnimationsSpeed(speed?: number): void;
|
|
42
|
+
eject(): void;
|
|
43
|
+
giveUp(): void;
|
|
44
|
+
playTutorialMoves(quantity: number): void;
|
|
45
|
+
}
|