@gamepark/react-client 6.38.5 → 7.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/ActionFailed.d.ts +6 -6
- package/dist/Actions/ActionFailed.js +4 -8
- package/dist/Actions/ActionFailed.js.map +1 -1
- package/dist/Actions/AnimationComplete.d.ts +6 -6
- package/dist/Actions/AnimationComplete.js +4 -8
- package/dist/Actions/AnimationComplete.js.map +1 -1
- package/dist/Actions/AnimationPaused.d.ts +6 -6
- package/dist/Actions/AnimationPaused.js +4 -8
- package/dist/Actions/AnimationPaused.js.map +1 -1
- package/dist/Actions/AnimationStart.d.ts +5 -5
- package/dist/Actions/AnimationStart.js +1 -4
- package/dist/Actions/AnimationStart.js.map +1 -1
- package/dist/Actions/ClearFailures.d.ts +1 -5
- package/dist/Actions/ClearFailures.js +3 -9
- package/dist/Actions/ClearFailures.js.map +1 -1
- package/dist/Actions/GameNotificationsReceived.d.ts +8 -10
- package/dist/Actions/GameNotificationsReceived.js +2 -9
- package/dist/Actions/GameNotificationsReceived.js.map +1 -1
- package/dist/Actions/GameOver.d.ts +16 -16
- package/dist/Actions/GameOver.js +4 -8
- package/dist/Actions/GameOver.js.map +1 -1
- package/dist/Actions/GameStateLoaded.d.ts +16 -16
- package/dist/Actions/GameStateLoaded.js +7 -20
- package/dist/Actions/GameStateLoaded.js.map +1 -1
- package/dist/Actions/MovePlayed.d.ts +11 -11
- package/dist/Actions/MovePlayed.js +3 -2
- package/dist/Actions/MovePlayed.js.map +1 -1
- package/dist/Actions/MoveUndone.d.ts +7 -7
- package/dist/Actions/MoveUndone.js +4 -9
- package/dist/Actions/MoveUndone.js.map +1 -1
- package/dist/Actions/PlayerQuit.d.ts +5 -11
- package/dist/Actions/PlayerQuit.js +2 -19
- package/dist/Actions/PlayerQuit.js.map +1 -1
- package/dist/Actions/SetAnimationsSpeed.d.ts +1 -6
- package/dist/Actions/SetAnimationsSpeed.js +3 -9
- package/dist/Actions/SetAnimationsSpeed.js.map +1 -1
- package/dist/Actions/giveUp.d.ts +1 -0
- package/dist/Actions/giveUp.js +3 -0
- package/dist/Actions/giveUp.js.map +1 -0
- package/dist/Actions/index.d.ts +7 -12
- package/dist/Actions/index.js +7 -28
- package/dist/Actions/index.js.map +1 -1
- package/dist/Actions/loadGameState.d.ts +14 -0
- package/dist/Actions/loadGameState.js +3 -0
- package/dist/Actions/loadGameState.js.map +1 -0
- package/dist/Actions/playMove.d.ts +10 -0
- package/dist/Actions/playMove.js +3 -0
- package/dist/Actions/playMove.js.map +1 -0
- package/dist/Actions/receiveNotifications.d.ts +8 -0
- package/dist/Actions/receiveNotifications.js +3 -0
- package/dist/Actions/receiveNotifications.js.map +1 -0
- package/dist/Actions/removePlayer.d.ts +5 -0
- package/dist/Actions/removePlayer.js +3 -0
- package/dist/Actions/removePlayer.js.map +1 -0
- package/dist/Actions/reportFailure.d.ts +1 -0
- package/dist/Actions/reportFailure.js +3 -0
- package/dist/Actions/reportFailure.js.map +1 -0
- package/dist/Actions/setGameOver.d.ts +2 -0
- package/dist/Actions/setGameOver.js +3 -0
- package/dist/Actions/setGameOver.js.map +1 -0
- package/dist/Actions/startAnimation.d.ts +1 -0
- package/dist/Actions/startAnimation.js +3 -0
- package/dist/Actions/startAnimation.js.map +1 -0
- package/dist/Actions/undoMove.d.ts +5 -0
- package/dist/Actions/undoMove.js +4 -0
- package/dist/Actions/undoMove.js.map +1 -0
- package/dist/Chat/ChatChannel.d.ts +5 -5
- package/dist/Chat/ChatChannel.js +1 -2
- package/dist/Chat/Message.d.ts +6 -6
- package/dist/Chat/Message.js +1 -2
- package/dist/Chat/index.d.ts +2 -2
- package/dist/Chat/index.js +2 -18
- package/dist/Chat/index.js.map +1 -1
- package/dist/Deckbuilding/Deck.d.ts +5 -5
- package/dist/Deckbuilding/Deck.js +1 -2
- package/dist/Deckbuilding/index.d.ts +4 -4
- package/dist/Deckbuilding/index.js +4 -24
- package/dist/Deckbuilding/index.js.map +1 -1
- package/dist/Deckbuilding/useDeleteDeck.d.ts +5 -2
- package/dist/Deckbuilding/useDeleteDeck.js +9 -15
- package/dist/Deckbuilding/useDeleteDeck.js.map +1 -1
- package/dist/Deckbuilding/useMyDecks.d.ts +3 -2
- package/dist/Deckbuilding/useMyDecks.js +8 -14
- package/dist/Deckbuilding/useMyDecks.js.map +1 -1
- package/dist/Deckbuilding/useSaveDeck.d.ts +5 -2
- package/dist/Deckbuilding/useSaveDeck.js +9 -15
- package/dist/Deckbuilding/useSaveDeck.js.map +1 -1
- package/dist/EjectPlayer/EjectPlayer.d.ts +1 -6
- package/dist/EjectPlayer/EjectPlayer.js +2 -8
- package/dist/EjectPlayer/EjectPlayer.js.map +1 -1
- package/dist/EjectPlayer/index.d.ts +1 -1
- package/dist/EjectPlayer/index.js +1 -17
- package/dist/EjectPlayer/index.js.map +1 -1
- package/dist/Failure/Failure.d.ts +6 -6
- package/dist/Failure/Failure.js +6 -9
- package/dist/Failure/Failure.js.map +1 -1
- package/dist/Failure/index.d.ts +1 -1
- package/dist/Failure/index.js +1 -17
- package/dist/Failure/index.js.map +1 -1
- package/dist/GiveUp/GiveUp.d.ts +7 -7
- package/dist/GiveUp/GiveUp.js +2 -5
- package/dist/GiveUp/GiveUp.js.map +1 -1
- package/dist/GiveUp/index.d.ts +1 -1
- package/dist/GiveUp/index.js +1 -17
- package/dist/GiveUp/index.js.map +1 -1
- package/dist/Hooks/index.d.ts +5 -5
- package/dist/Hooks/index.js +5 -21
- package/dist/Hooks/index.js.map +1 -1
- package/dist/Hooks/useChatMessages.d.ts +7 -12
- package/dist/Hooks/useChatMessages.js +44 -51
- package/dist/Hooks/useChatMessages.js.map +1 -1
- package/dist/Hooks/useMessageAuthor.d.ts +4 -4
- package/dist/Hooks/useMessageAuthor.js +13 -18
- package/dist/Hooks/useMessageAuthor.js.map +1 -1
- package/dist/Hooks/useOptions.d.ts +2 -2
- package/dist/Hooks/useOptions.js +4 -8
- package/dist/Hooks/useOptions.js.map +1 -1
- package/dist/Hooks/useRematch.d.ts +7 -7
- package/dist/Hooks/useRematch.js +18 -19
- package/dist/Hooks/useRematch.js.map +1 -1
- package/dist/Hooks/useSendMessage.d.ts +4 -1
- package/dist/Hooks/useSendMessage.js +6 -14
- package/dist/Hooks/useSendMessage.js.map +1 -1
- package/dist/Log/StartLiveLog.d.ts +1 -4
- package/dist/Log/StartLiveLog.js +3 -5
- package/dist/Log/StartLiveLog.js.map +1 -1
- package/dist/Log/StopLiveLog.d.ts +2 -5
- package/dist/Log/StopLiveLog.js +6 -9
- package/dist/Log/StopLiveLog.js.map +1 -1
- package/dist/Log/index.d.ts +4 -4
- package/dist/Log/index.js +4 -20
- package/dist/Log/index.js.map +1 -1
- package/dist/Log/useLogControls.d.ts +7 -7
- package/dist/Log/useLogControls.js +18 -22
- package/dist/Log/useLogControls.js.map +1 -1
- package/dist/PlayerTime/PlayerTime.d.ts +11 -11
- package/dist/PlayerTime/PlayerTime.js +1 -2
- package/dist/PlayerTime/index.d.ts +1 -1
- package/dist/PlayerTime/index.js +1 -17
- package/dist/PlayerTime/index.js.map +1 -1
- package/dist/Rematch/RematchQueries.d.ts +19 -19
- package/dist/Rematch/RematchQueries.js +23 -13
- package/dist/Rematch/RematchQueries.js.map +1 -1
- package/dist/Rematch/index.d.ts +1 -1
- package/dist/Rematch/index.js +1 -17
- package/dist/Rematch/index.js.map +1 -1
- package/dist/Sound/MuteSounds.d.ts +2 -5
- package/dist/Sound/MuteSounds.js +7 -10
- package/dist/Sound/MuteSounds.js.map +1 -1
- package/dist/Sound/UnmuteSounds.d.ts +1 -4
- package/dist/Sound/UnmuteSounds.js +3 -5
- package/dist/Sound/UnmuteSounds.js.map +1 -1
- package/dist/Sound/index.d.ts +3 -3
- package/dist/Sound/index.js +3 -19
- package/dist/Sound/index.js.map +1 -1
- package/dist/Sound/useSoundControls.d.ts +7 -7
- package/dist/Sound/useSoundControls.js +18 -22
- package/dist/Sound/useSoundControls.js.map +1 -1
- package/dist/Store/DisplayedAction.d.ts +15 -15
- package/dist/Store/DisplayedAction.js +12 -19
- package/dist/Store/DisplayedAction.js.map +1 -1
- package/dist/Store/GamePageState.d.ts +27 -28
- package/dist/Store/GamePageState.js +1 -2
- package/dist/Store/PlayedMove.d.ts +5 -5
- package/dist/Store/PlayedMove.js +1 -2
- package/dist/Store/endAnimation.d.ts +1 -0
- package/dist/Store/endAnimation.js +3 -0
- package/dist/Store/endAnimation.js.map +1 -0
- package/dist/Store/gameMiddleware.d.ts +4 -4
- package/dist/Store/gameMiddleware.js +34 -41
- package/dist/Store/gameMiddleware.js.map +1 -1
- package/dist/Store/gameReducer.d.ts +14 -20
- package/dist/Store/gameReducer.js +462 -525
- package/dist/Store/gameReducer.js.map +1 -1
- package/dist/Store/index.d.ts +4 -3
- package/dist/Store/index.js +4 -19
- package/dist/Store/index.js.map +1 -1
- package/dist/Store/localMovePreviewMiddleware.d.ts +4 -4
- package/dist/Store/localMovePreviewMiddleware.js +19 -18
- package/dist/Store/localMovePreviewMiddleware.js.map +1 -1
- package/dist/Store/store.d.ts +13 -0
- package/dist/Store/store.js +27 -0
- package/dist/Store/store.js.map +1 -0
- package/dist/Tutorial/PlayTutorialMoves.d.ts +1 -9
- package/dist/Tutorial/PlayTutorialMoves.js +2 -6
- package/dist/Tutorial/PlayTutorialMoves.js.map +1 -1
- package/dist/Tutorial/Tutorial.d.ts +5 -5
- package/dist/Tutorial/Tutorial.js +1 -2
- package/dist/Tutorial/TutorialDescription.d.ts +7 -7
- package/dist/Tutorial/TutorialDescription.js +1 -2
- package/dist/Tutorial/index.d.ts +4 -4
- package/dist/Tutorial/index.js +4 -20
- package/dist/Tutorial/index.js.map +1 -1
- package/dist/Tutorial/useTutorial.d.ts +2 -2
- package/dist/Tutorial/useTutorial.js +12 -22
- package/dist/Tutorial/useTutorial.js.map +1 -1
- package/dist/Types/GameAI.d.ts +1 -1
- package/dist/Types/GameAI.js +1 -2
- package/dist/Types/GameData.d.ts +18 -18
- package/dist/Types/GameData.js +1 -2
- package/dist/Types/GameMessage.d.ts +8 -8
- package/dist/Types/GameMessage.js +1 -2
- package/dist/Types/GameMode.d.ts +6 -6
- package/dist/Types/GameMode.js +7 -10
- package/dist/Types/GameMode.js.map +1 -1
- package/dist/Types/GameNotification.d.ts +6 -6
- package/dist/Types/GameNotification.js +1 -2
- package/dist/Types/GameOptions.d.ts +9 -9
- package/dist/Types/GameOptions.js +5 -8
- package/dist/Types/GameOptions.js.map +1 -1
- package/dist/Types/MovePlayedNotification.d.ts +9 -9
- package/dist/Types/MovePlayedNotification.js +6 -12
- package/dist/Types/MovePlayedNotification.js.map +1 -1
- package/dist/Types/MoveUndoneNotification.d.ts +8 -8
- package/dist/Types/MoveUndoneNotification.js +6 -12
- package/dist/Types/MoveUndoneNotification.js.map +1 -1
- package/dist/Types/Player.d.ts +13 -13
- package/dist/Types/Player.js +1 -2
- package/dist/Types/PlayerQuitReason.d.ts +4 -4
- package/dist/Types/PlayerQuitReason.js +5 -8
- package/dist/Types/PlayerQuitReason.js.map +1 -1
- package/dist/Types/ProxyGameData.d.ts +13 -13
- package/dist/Types/ProxyGameData.js +1 -2
- package/dist/Types/Tournament.d.ts +4 -4
- package/dist/Types/Tournament.js +1 -2
- package/dist/Types/index.d.ts +12 -12
- package/dist/Types/index.js +12 -28
- package/dist/Types/index.js.map +1 -1
- package/dist/User/User.d.ts +6 -6
- package/dist/User/User.js +1 -2
- package/dist/User/index.d.ts +2 -2
- package/dist/User/index.js +2 -18
- package/dist/User/index.js.map +1 -1
- package/dist/User/useMe.d.ts +4 -4
- package/dist/User/useMe.js +10 -21
- package/dist/User/useMe.js.map +1 -1
- package/dist/animations/Animation.d.ts +6 -6
- package/dist/animations/Animation.js +1 -2
- package/dist/animations/AnimationContext.d.ts +8 -8
- package/dist/animations/AnimationContext.js +1 -2
- package/dist/animations/AnimationState.d.ts +6 -6
- package/dist/animations/AnimationState.js +1 -2
- package/dist/animations/AnimationStep.d.ts +6 -6
- package/dist/animations/AnimationStep.js +7 -10
- package/dist/animations/AnimationStep.js.map +1 -1
- package/dist/animations/Animations.d.ts +8 -8
- package/dist/animations/Animations.js +15 -22
- package/dist/animations/Animations.js.map +1 -1
- package/dist/animations/AnimationsListener.d.ts +6 -0
- package/dist/animations/AnimationsListener.js +54 -0
- package/dist/animations/AnimationsListener.js.map +1 -0
- package/dist/animations/AnimationsListenerCreator.d.ts +2 -4
- package/dist/animations/AnimationsListenerCreator.js +40 -50
- package/dist/animations/AnimationsListenerCreator.js.map +1 -1
- package/dist/animations/animationMiddleware.d.ts +4 -0
- package/dist/animations/animationMiddleware.js +50 -0
- package/dist/animations/animationMiddleware.js.map +1 -0
- package/dist/animations/index.d.ts +5 -6
- package/dist/animations/index.js +5 -22
- package/dist/animations/index.js.map +1 -1
- package/dist/api/Client/GameClientAPI.d.ts +24 -24
- package/dist/api/Client/GameClientAPI.js +116 -165
- package/dist/api/Client/GameClientAPI.js.map +1 -1
- package/dist/api/Client/GameNotificationsListener.d.ts +5 -5
- package/dist/api/Client/GameNotificationsListener.js +62 -113
- package/dist/api/Client/GameNotificationsListener.js.map +1 -1
- package/dist/api/Client/RemoteGameLoader.d.ts +4 -5
- package/dist/api/Client/RemoteGameLoader.js +66 -62
- package/dist/api/Client/RemoteGameLoader.js.map +1 -1
- package/dist/api/Client/RemoteGameProvider.d.ts +7 -7
- package/dist/api/Client/RemoteGameProvider.js +19 -70
- package/dist/api/Client/RemoteGameProvider.js.map +1 -1
- package/dist/api/Client/apollo-client.d.ts +2 -2
- package/dist/api/Client/apollo-client.js +40 -58
- package/dist/api/Client/apollo-client.js.map +1 -1
- package/dist/api/Client/index.d.ts +4 -3
- package/dist/api/Client/index.js +4 -19
- package/dist/api/Client/index.js.map +1 -1
- package/dist/api/Client/pusher.d.ts +2 -0
- package/dist/api/Client/pusher.js +9 -0
- package/dist/api/Client/pusher.js.map +1 -0
- package/dist/api/GameAPI.d.ts +10 -10
- package/dist/api/GameAPI.js +1 -2
- package/dist/api/Local/ConsoleTools.d.ts +25 -25
- package/dist/api/Local/ConsoleTools.js +78 -86
- package/dist/api/Local/ConsoleTools.js.map +1 -1
- package/dist/api/Local/GameLocalAPI.d.ts +44 -44
- package/dist/api/Local/GameLocalAPI.js +442 -540
- package/dist/api/Local/GameLocalAPI.js.map +1 -1
- package/dist/api/Local/LocalGameProvider.d.ts +15 -15
- package/dist/api/Local/LocalGameProvider.js +18 -58
- package/dist/api/Local/LocalGameProvider.js.map +1 -1
- package/dist/api/Local/index.d.ts +1 -1
- package/dist/api/Local/index.js +1 -17
- package/dist/api/Local/index.js.map +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +2 -18
- package/dist/api/index.js.map +1 -1
- package/dist/index.d.ts +16 -18
- package/dist/index.js +16 -36
- package/dist/index.js.map +1 -1
- package/dist/util/ArrayUtil.d.ts +2 -2
- package/dist/util/ArrayUtil.js +16 -21
- package/dist/util/ArrayUtil.js.map +1 -1
- package/package.json +66 -65
- package/dist/Actions/ActionType.d.ts +0 -3
- package/dist/Actions/ActionType.js +0 -8
- package/dist/Actions/ActionType.js.map +0 -1
- package/dist/Scoring/ScoringDescription.d.ts +0 -8
- package/dist/Scoring/ScoringDescription.js +0 -3
- package/dist/Scoring/ScoringDescription.js.map +0 -1
- package/dist/Scoring/index.d.ts +0 -1
- package/dist/Scoring/index.js +0 -18
- package/dist/Scoring/index.js.map +0 -1
- package/dist/util/TimeUtil.d.ts +0 -2
- package/dist/util/TimeUtil.js +0 -27
- package/dist/util/TimeUtil.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Action } from '@gamepark/rules-api';
|
|
2
|
-
import { GameNotification } from './GameNotification';
|
|
3
|
-
export type MovePlayedNotification<Move, PlayerId> = GameNotification<PlayerId> & {
|
|
4
|
-
actionId: string | null;
|
|
5
|
-
moveView: Move;
|
|
6
|
-
consequences: Move[];
|
|
7
|
-
};
|
|
8
|
-
export declare function movePlayedNotification<Move, PlayerId>(action: Action): MovePlayedNotification<Move, PlayerId>;
|
|
9
|
-
export declare function isMovePlayedNotification<Move, PlayerId>(notification: GameNotification<PlayerId>): notification is MovePlayedNotification<Move, PlayerId>;
|
|
1
|
+
import { Action } from '@gamepark/rules-api';
|
|
2
|
+
import { GameNotification } from './GameNotification';
|
|
3
|
+
export type MovePlayedNotification<Move = any, PlayerId = any> = GameNotification<PlayerId> & {
|
|
4
|
+
actionId: string | null;
|
|
5
|
+
moveView: Move;
|
|
6
|
+
consequences: Move[];
|
|
7
|
+
};
|
|
8
|
+
export declare function movePlayedNotification<Move, PlayerId>(action: Action): MovePlayedNotification<Move, PlayerId>;
|
|
9
|
+
export declare function isMovePlayedNotification<Move, PlayerId>(notification: GameNotification<PlayerId>): notification is MovePlayedNotification<Move, PlayerId>;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
exports.movePlayedNotification = movePlayedNotification;
|
|
9
|
-
function isMovePlayedNotification(notification) {
|
|
10
|
-
return notification.moveView != undefined;
|
|
11
|
-
}
|
|
12
|
-
exports.isMovePlayedNotification = isMovePlayedNotification;
|
|
1
|
+
export function movePlayedNotification(action) {
|
|
2
|
+
return { actionId: action.id ?? null, playerId: action.playerId, moveView: action.move, consequences: action.consequences };
|
|
3
|
+
}
|
|
4
|
+
export function isMovePlayedNotification(notification) {
|
|
5
|
+
return notification.moveView != undefined;
|
|
6
|
+
}
|
|
13
7
|
//# sourceMappingURL=MovePlayedNotification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MovePlayedNotification.js","sourceRoot":"","sources":["../../src/Types/MovePlayedNotification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MovePlayedNotification.js","sourceRoot":"","sources":["../../src/Types/MovePlayedNotification.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,sBAAsB,CAAiB,MAAc;IACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,IAAI,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAA;AAC7H,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAiB,YAAwC;IAC/F,OAAQ,YAAuD,CAAC,QAAQ,IAAI,SAAS,CAAA;AACvF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Action } from '@gamepark/rules-api';
|
|
2
|
-
import { GameNotification } from './GameNotification';
|
|
3
|
-
export type MoveUndoneNotification<PlayerId> = GameNotification<PlayerId> & {
|
|
4
|
-
actionId: string | null;
|
|
5
|
-
moveUndone: number;
|
|
6
|
-
};
|
|
7
|
-
export declare function moveUndoneNotification<PlayerId>(action: Action<any, PlayerId>, moveUndone: number): MoveUndoneNotification<PlayerId>;
|
|
8
|
-
export declare function isMoveUndoneNotification<PlayerId>(notification: GameNotification<PlayerId>): notification is MoveUndoneNotification<PlayerId>;
|
|
1
|
+
import { Action } from '@gamepark/rules-api';
|
|
2
|
+
import { GameNotification } from './GameNotification';
|
|
3
|
+
export type MoveUndoneNotification<PlayerId = any> = GameNotification<PlayerId> & {
|
|
4
|
+
actionId: string | null;
|
|
5
|
+
moveUndone: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function moveUndoneNotification<PlayerId>(action: Action<any, PlayerId>, moveUndone: number): MoveUndoneNotification<PlayerId>;
|
|
8
|
+
export declare function isMoveUndoneNotification<PlayerId>(notification: GameNotification<PlayerId>): notification is MoveUndoneNotification<PlayerId>;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
exports.moveUndoneNotification = moveUndoneNotification;
|
|
9
|
-
function isMoveUndoneNotification(notification) {
|
|
10
|
-
return notification.moveUndone != undefined;
|
|
11
|
-
}
|
|
12
|
-
exports.isMoveUndoneNotification = isMoveUndoneNotification;
|
|
1
|
+
export function moveUndoneNotification(action, moveUndone) {
|
|
2
|
+
return { playerId: action.playerId, actionId: action.id ?? null, moveUndone };
|
|
3
|
+
}
|
|
4
|
+
export function isMoveUndoneNotification(notification) {
|
|
5
|
+
return notification.moveUndone != undefined;
|
|
6
|
+
}
|
|
13
7
|
//# sourceMappingURL=MoveUndoneNotification.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MoveUndoneNotification.js","sourceRoot":"","sources":["../../src/Types/MoveUndoneNotification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MoveUndoneNotification.js","sourceRoot":"","sources":["../../src/Types/MoveUndoneNotification.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,sBAAsB,CAAW,MAA6B,EAAE,UAAkB;IAChG,OAAO,EAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,IAAI,IAAI,EAAE,UAAU,EAAC,CAAA;AAC7E,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAW,YAAwC;IACzF,OAAQ,YAAiD,CAAC,UAAU,IAAI,SAAS,CAAA;AACnF,CAAC"}
|
package/dist/Types/Player.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { PlayerTime } from '../PlayerTime';
|
|
2
|
-
import { PlayerQuitReason } from './PlayerQuitReason';
|
|
3
|
-
export type Player<PlayerId = any> = {
|
|
4
|
-
id: PlayerId;
|
|
5
|
-
userId?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
avatar?: any;
|
|
8
|
-
gamePointsDelta?: number | null;
|
|
9
|
-
tournamentPoints?: number | null;
|
|
10
|
-
time?: PlayerTime;
|
|
11
|
-
quit?: boolean;
|
|
12
|
-
quitReason?: PlayerQuitReason;
|
|
13
|
-
};
|
|
1
|
+
import { PlayerTime } from '../PlayerTime';
|
|
2
|
+
import { PlayerQuitReason } from './PlayerQuitReason';
|
|
3
|
+
export type Player<PlayerId = any> = {
|
|
4
|
+
id: PlayerId;
|
|
5
|
+
userId?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
avatar?: any;
|
|
8
|
+
gamePointsDelta?: number | null;
|
|
9
|
+
tournamentPoints?: number | null;
|
|
10
|
+
time?: PlayerTime;
|
|
11
|
+
quit?: boolean;
|
|
12
|
+
quitReason?: PlayerQuitReason;
|
|
13
|
+
};
|
package/dist/Types/Player.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare enum PlayerQuitReason {
|
|
2
|
-
GiveUp = 1,
|
|
3
|
-
Ejected = 2
|
|
4
|
-
}
|
|
1
|
+
export declare enum PlayerQuitReason {
|
|
2
|
+
GiveUp = 1,
|
|
3
|
+
Ejected = 2
|
|
4
|
+
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(
|
|
6
|
-
PlayerQuitReason[PlayerQuitReason["GiveUp"] = 1] = "GiveUp";
|
|
7
|
-
PlayerQuitReason[PlayerQuitReason["Ejected"] = 2] = "Ejected";
|
|
8
|
-
})(PlayerQuitReason = exports.PlayerQuitReason || (exports.PlayerQuitReason = {}));
|
|
1
|
+
export var PlayerQuitReason;
|
|
2
|
+
(function (PlayerQuitReason) {
|
|
3
|
+
PlayerQuitReason[PlayerQuitReason["GiveUp"] = 1] = "GiveUp";
|
|
4
|
+
PlayerQuitReason[PlayerQuitReason["Ejected"] = 2] = "Ejected";
|
|
5
|
+
})(PlayerQuitReason || (PlayerQuitReason = {}));
|
|
9
6
|
//# sourceMappingURL=PlayerQuitReason.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlayerQuitReason.js","sourceRoot":"","sources":["../../src/Types/PlayerQuitReason.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlayerQuitReason.js","sourceRoot":"","sources":["../../src/Types/PlayerQuitReason.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2DAAU,CAAA;IACV,6DAAW,CAAA;AACb,CAAC,EAHW,gBAAgB,KAAhB,gBAAgB,QAG3B"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Action } from '@gamepark/rules-api';
|
|
2
|
-
import { Player } from './Player';
|
|
3
|
-
import { GameOptions } from './GameOptions';
|
|
4
|
-
export type ProxyGameData<Game = any, Move = any, PlayerId = any> = {
|
|
5
|
-
playerId?: PlayerId;
|
|
6
|
-
players: Player<PlayerId>[];
|
|
7
|
-
setup: Game;
|
|
8
|
-
state: Game;
|
|
9
|
-
actions: Action<Move, PlayerId>[];
|
|
10
|
-
monkeyOpponents: boolean;
|
|
11
|
-
tutorial?: number;
|
|
12
|
-
options?: GameOptions;
|
|
13
|
-
};
|
|
1
|
+
import { Action } from '@gamepark/rules-api';
|
|
2
|
+
import { Player } from './Player';
|
|
3
|
+
import { GameOptions } from './GameOptions';
|
|
4
|
+
export type ProxyGameData<Game = any, Move = any, PlayerId = any> = {
|
|
5
|
+
playerId?: PlayerId;
|
|
6
|
+
players: Player<PlayerId>[];
|
|
7
|
+
setup: Game;
|
|
8
|
+
state: Game;
|
|
9
|
+
actions: Action<Move, PlayerId>[];
|
|
10
|
+
monkeyOpponents: boolean;
|
|
11
|
+
tutorial?: number;
|
|
12
|
+
options?: GameOptions;
|
|
13
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Tournament = {
|
|
2
|
-
signedUp: boolean;
|
|
3
|
-
number: number;
|
|
4
|
-
};
|
|
1
|
+
export type Tournament = {
|
|
2
|
+
signedUp: boolean;
|
|
3
|
+
number: number;
|
|
4
|
+
};
|
package/dist/Types/Tournament.js
CHANGED
package/dist/Types/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export * from './GameAI';
|
|
2
|
-
export * from './GameData';
|
|
3
|
-
export * from './GameMessage';
|
|
4
|
-
export * from './GameMode';
|
|
5
|
-
export * from './GameNotification';
|
|
6
|
-
export * from './GameOptions';
|
|
7
|
-
export * from './MovePlayedNotification';
|
|
8
|
-
export * from './MoveUndoneNotification';
|
|
9
|
-
export * from './Player';
|
|
10
|
-
export * from './PlayerQuitReason';
|
|
11
|
-
export * from './ProxyGameData';
|
|
12
|
-
export * from './Tournament';
|
|
1
|
+
export * from './GameAI';
|
|
2
|
+
export * from './GameData';
|
|
3
|
+
export * from './GameMessage';
|
|
4
|
+
export * from './GameMode';
|
|
5
|
+
export * from './GameNotification';
|
|
6
|
+
export * from './GameOptions';
|
|
7
|
+
export * from './MovePlayedNotification';
|
|
8
|
+
export * from './MoveUndoneNotification';
|
|
9
|
+
export * from './Player';
|
|
10
|
+
export * from './PlayerQuitReason';
|
|
11
|
+
export * from './ProxyGameData';
|
|
12
|
+
export * from './Tournament';
|
package/dist/Types/index.js
CHANGED
|
@@ -1,29 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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("./GameAI"), exports);
|
|
18
|
-
__exportStar(require("./GameData"), exports);
|
|
19
|
-
__exportStar(require("./GameMessage"), exports);
|
|
20
|
-
__exportStar(require("./GameMode"), exports);
|
|
21
|
-
__exportStar(require("./GameNotification"), exports);
|
|
22
|
-
__exportStar(require("./GameOptions"), exports);
|
|
23
|
-
__exportStar(require("./MovePlayedNotification"), exports);
|
|
24
|
-
__exportStar(require("./MoveUndoneNotification"), exports);
|
|
25
|
-
__exportStar(require("./Player"), exports);
|
|
26
|
-
__exportStar(require("./PlayerQuitReason"), exports);
|
|
27
|
-
__exportStar(require("./ProxyGameData"), exports);
|
|
28
|
-
__exportStar(require("./Tournament"), exports);
|
|
1
|
+
export * from './GameAI';
|
|
2
|
+
export * from './GameData';
|
|
3
|
+
export * from './GameMessage';
|
|
4
|
+
export * from './GameMode';
|
|
5
|
+
export * from './GameNotification';
|
|
6
|
+
export * from './GameOptions';
|
|
7
|
+
export * from './MovePlayedNotification';
|
|
8
|
+
export * from './MoveUndoneNotification';
|
|
9
|
+
export * from './Player';
|
|
10
|
+
export * from './PlayerQuitReason';
|
|
11
|
+
export * from './ProxyGameData';
|
|
12
|
+
export * from './Tournament';
|
|
29
13
|
//# sourceMappingURL=index.js.map
|
package/dist/Types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,cAAc,CAAA"}
|
package/dist/User/User.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type User = {
|
|
2
|
-
id: string;
|
|
3
|
-
name?: string;
|
|
4
|
-
avatar?: any;
|
|
5
|
-
subscriptionSince: string | null;
|
|
6
|
-
};
|
|
1
|
+
export type User = {
|
|
2
|
+
id: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
avatar?: any;
|
|
5
|
+
subscriptionSince: string | null;
|
|
6
|
+
};
|
package/dist/User/User.js
CHANGED
package/dist/User/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './User';
|
|
2
|
-
export * from './useMe';
|
|
1
|
+
export * from './User';
|
|
2
|
+
export * from './useMe';
|
package/dist/User/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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("./User"), exports);
|
|
18
|
-
__exportStar(require("./useMe"), exports);
|
|
1
|
+
export * from './User';
|
|
2
|
+
export * from './useMe';
|
|
19
3
|
//# sourceMappingURL=index.js.map
|
package/dist/User/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/User/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/User/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA"}
|
package/dist/User/useMe.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { User } from './User';
|
|
2
|
-
export declare function useMe(): {
|
|
3
|
-
user: User;
|
|
4
|
-
} | undefined;
|
|
1
|
+
import { User } from './User';
|
|
2
|
+
export declare function useMe(): {
|
|
3
|
+
user: User;
|
|
4
|
+
} | undefined;
|
package/dist/User/useMe.js
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var GET_ME = (0, client_1.gql)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["query Me { me { user { id name subscriptionSince avatar {...AvatarInfo} } } } ", ""], ["query Me { me { user { id name subscriptionSince avatar {...AvatarInfo} } } } ", ""])), api_1.AVATAR_INFO);
|
|
12
|
-
function useMe() {
|
|
13
|
-
var _a;
|
|
14
|
-
var urlSearchParams = new URLSearchParams(window.location.search);
|
|
15
|
-
var fetchPolicy = (0, react_1.useMemo)(function () {
|
|
16
|
-
return process.env.NODE_ENV !== 'production' && !urlSearchParams.get('game') && !urlSearchParams.get('mode') ? 'cache-only' : 'cache-first';
|
|
17
|
-
}, []);
|
|
18
|
-
return (_a = (0, client_1.useQuery)(GET_ME, { ssr: false, fetchPolicy: fetchPolicy }).data) === null || _a === void 0 ? void 0 : _a.me;
|
|
19
|
-
}
|
|
20
|
-
exports.useMe = useMe;
|
|
21
|
-
var templateObject_1;
|
|
1
|
+
import { gql } from '@apollo/client';
|
|
2
|
+
import { useQuery } from '@apollo/client/react';
|
|
3
|
+
import { useMemo } from 'react';
|
|
4
|
+
import { AVATAR_INFO } from '../api';
|
|
5
|
+
const GET_ME = gql `query Me { me { user { id name subscriptionSince avatar {...AvatarInfo} } } } ${AVATAR_INFO}`;
|
|
6
|
+
export function useMe() {
|
|
7
|
+
const urlSearchParams = new URLSearchParams(window.location.search);
|
|
8
|
+
const fetchPolicy = useMemo(() => process.env.NODE_ENV !== 'production' && !urlSearchParams.get('game') && !urlSearchParams.get('mode') ? 'cache-only' : 'cache-first', []);
|
|
9
|
+
return useQuery(GET_ME, { ssr: false, fetchPolicy }).data?.me;
|
|
10
|
+
}
|
|
22
11
|
//# sourceMappingURL=useMe.js.map
|
package/dist/User/useMe.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMe.js","sourceRoot":"","sources":["../../src/User/useMe.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMe.js","sourceRoot":"","sources":["../../src/User/useMe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAGpC,MAAM,MAAM,GAAG,GAAG,CAAA,iFAAiF,WAAW,EAAE,CAAA;AAEhH,MAAM,UAAU,KAAK;IACnB,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IACnE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAC7B,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,EACpI,EAAE,CAAC,CAAA;IACP,OAAO,QAAQ,CAAyB,MAAM,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAA;AACvF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DisplayedAction } from '../Store';
|
|
2
|
-
export type Animation<Move = any, PlayerId = any> = {
|
|
3
|
-
move: Move;
|
|
4
|
-
duration: number;
|
|
5
|
-
action: DisplayedAction<Move, PlayerId>;
|
|
6
|
-
};
|
|
1
|
+
import { DisplayedAction } from '../Store';
|
|
2
|
+
export type Animation<Move = any, PlayerId = any> = {
|
|
3
|
+
move: Move;
|
|
4
|
+
duration: number;
|
|
5
|
+
action: DisplayedAction<Move, PlayerId>;
|
|
6
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnimationStep } from './AnimationStep';
|
|
2
|
-
import { DisplayedAction } from '../Store';
|
|
3
|
-
export type AnimationContext<Game, Move, PlayerId> = {
|
|
4
|
-
action: DisplayedAction<Move, PlayerId>;
|
|
5
|
-
game: Game;
|
|
6
|
-
step: AnimationStep;
|
|
7
|
-
playerId?: PlayerId;
|
|
8
|
-
};
|
|
1
|
+
import { AnimationStep } from './AnimationStep';
|
|
2
|
+
import { DisplayedAction } from '../Store';
|
|
3
|
+
export type AnimationContext<Game = any, Move = any, PlayerId = any> = {
|
|
4
|
+
action: DisplayedAction<Move, PlayerId>;
|
|
5
|
+
game: Game;
|
|
6
|
+
step: AnimationStep;
|
|
7
|
+
playerId?: PlayerId;
|
|
8
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnimationStep } from './AnimationStep';
|
|
2
|
-
export type AnimationState = {
|
|
3
|
-
id: number;
|
|
4
|
-
duration: number;
|
|
5
|
-
step: AnimationStep;
|
|
6
|
-
};
|
|
1
|
+
import { AnimationStep } from './AnimationStep';
|
|
2
|
+
export type AnimationState = {
|
|
3
|
+
id: number;
|
|
4
|
+
duration: number;
|
|
5
|
+
step: AnimationStep;
|
|
6
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare enum AnimationStep {
|
|
2
|
-
BEFORE_MOVE = 1,
|
|
3
|
-
AFTER_MOVE = 2,
|
|
4
|
-
BEFORE_UNDO = 3,
|
|
5
|
-
AFTER_UNDO = 4
|
|
6
|
-
}
|
|
1
|
+
export declare enum AnimationStep {
|
|
2
|
+
BEFORE_MOVE = 1,
|
|
3
|
+
AFTER_MOVE = 2,
|
|
4
|
+
BEFORE_UNDO = 3,
|
|
5
|
+
AFTER_UNDO = 4
|
|
6
|
+
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
AnimationStep[AnimationStep["
|
|
7
|
-
|
|
8
|
-
AnimationStep[AnimationStep["BEFORE_UNDO"] = 3] = "BEFORE_UNDO";
|
|
9
|
-
AnimationStep[AnimationStep["AFTER_UNDO"] = 4] = "AFTER_UNDO";
|
|
10
|
-
})(AnimationStep = exports.AnimationStep || (exports.AnimationStep = {}));
|
|
1
|
+
export var AnimationStep;
|
|
2
|
+
(function (AnimationStep) {
|
|
3
|
+
AnimationStep[AnimationStep["BEFORE_MOVE"] = 1] = "BEFORE_MOVE";
|
|
4
|
+
AnimationStep[AnimationStep["AFTER_MOVE"] = 2] = "AFTER_MOVE";
|
|
5
|
+
AnimationStep[AnimationStep["BEFORE_UNDO"] = 3] = "BEFORE_UNDO";
|
|
6
|
+
AnimationStep[AnimationStep["AFTER_UNDO"] = 4] = "AFTER_UNDO";
|
|
7
|
+
})(AnimationStep || (AnimationStep = {}));
|
|
11
8
|
//# sourceMappingURL=AnimationStep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimationStep.js","sourceRoot":"","sources":["../../src/animations/AnimationStep.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnimationStep.js","sourceRoot":"","sources":["../../src/animations/AnimationStep.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAEX;AAFD,WAAY,aAAa;IACvB,+DAAe,CAAA;IAAE,6DAAU,CAAA;IAAE,+DAAW,CAAA;IAAE,6DAAU,CAAA;AACtD,CAAC,EAFW,aAAa,KAAb,aAAa,QAExB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AnimationContext } from './AnimationContext';
|
|
2
|
-
export declare class Animations<Game = any, Move = any, PlayerId = any> {
|
|
3
|
-
getDuration(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
4
|
-
getPreDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
5
|
-
getPostDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
6
|
-
getUndoPreDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
7
|
-
getUndoPostDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
8
|
-
}
|
|
1
|
+
import { AnimationContext } from './AnimationContext';
|
|
2
|
+
export declare class Animations<Game = any, Move = any, PlayerId = any> {
|
|
3
|
+
getDuration(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
4
|
+
getPreDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
5
|
+
getPostDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
6
|
+
getUndoPreDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
7
|
+
getUndoPostDuration?(move: Move, context: AnimationContext<Game, Move, PlayerId>): number;
|
|
8
|
+
}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
case AnimationStep_1.AnimationStep.AFTER_UNDO:
|
|
17
|
-
return this.getUndoPostDuration ? this.getUndoPostDuration(move, context) : 0;
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
return Animations;
|
|
21
|
-
}());
|
|
22
|
-
exports.Animations = Animations;
|
|
1
|
+
import { AnimationStep } from './AnimationStep';
|
|
2
|
+
export class Animations {
|
|
3
|
+
getDuration(move, context) {
|
|
4
|
+
switch (context.step) {
|
|
5
|
+
case AnimationStep.BEFORE_MOVE:
|
|
6
|
+
return this.getPreDuration ? this.getPreDuration(move, context) : 0;
|
|
7
|
+
case AnimationStep.AFTER_MOVE:
|
|
8
|
+
return this.getPostDuration ? this.getPostDuration(move, context) : 0;
|
|
9
|
+
case AnimationStep.BEFORE_UNDO:
|
|
10
|
+
return this.getUndoPreDuration ? this.getUndoPreDuration(move, context) : 0;
|
|
11
|
+
case AnimationStep.AFTER_UNDO:
|
|
12
|
+
return this.getUndoPostDuration ? this.getUndoPostDuration(move, context) : 0;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
23
16
|
//# sourceMappingURL=Animations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Animations.js","sourceRoot":"","sources":["../../src/animations/Animations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Animations.js","sourceRoot":"","sources":["../../src/animations/Animations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,OAAO,UAAU;IAErB,WAAW,CAAC,IAAU,EAAE,OAA+C;QACrE,QAAQ,OAAO,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,aAAa,CAAC,WAAW;gBAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACrE,KAAK,aAAa,CAAC,UAAU;gBAC3B,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACvE,KAAK,aAAa,CAAC,WAAW;gBAC5B,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YAC7E,KAAK,aAAa,CAAC,UAAU;gBAC3B,OAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACjF,CAAC;IACH,CAAC;CASF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RulesCreator } from '../../../rules-api';
|
|
2
|
+
type Props<Game = any, Move = any, PlayerId = any> = {
|
|
3
|
+
Rules: RulesCreator<Game, Move, PlayerId>;
|
|
4
|
+
};
|
|
5
|
+
export declare function AnimationsListener<Game = any, Move = any, PlayerId = any>({ Rules }: Props<Game, Move, PlayerId>): null;
|
|
6
|
+
export {};
|