@vankosoft/game-platform 0.1.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/CHANGELOG.md +6 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/VERSION +1 -0
- package/package.json +21 -0
- package/src/Model/BoardGame/checkerDto.ts +7 -0
- package/src/Model/BoardGame/chessMoveDto.ts +26 -0
- package/src/Model/BoardGame/chessMoveType.ts +10 -0
- package/src/Model/BoardGame/chessPieceDto.ts +11 -0
- package/src/Model/BoardGame/chessPieceType.ts +11 -0
- package/src/Model/BoardGame/chessSquareDto.ts +10 -0
- package/src/Model/BoardGame/diceDto.ts +7 -0
- package/src/Model/BoardGame/gameDto.ts +23 -0
- package/src/Model/BoardGame/moveDto.ts +13 -0
- package/src/Model/BoardGame/playerColor.ts +8 -0
- package/src/Model/BoardGame/playerDto.ts +11 -0
- package/src/Model/BoardGame/pointDto.ts +9 -0
- package/src/Model/BoardGame/toplist.ts +9 -0
- package/src/Model/BoardGame/toplistResult.ts +8 -0
- package/src/Model/CardGame/announceDto.ts +12 -0
- package/src/Model/CardGame/announceType.ts +15 -0
- package/src/Model/CardGame/bidDto.ts +14 -0
- package/src/Model/CardGame/bidType.ts +15 -0
- package/src/Model/CardGame/bridgeBeloteCardType.ts +13 -0
- package/src/Model/CardGame/bridgeBeloteScoreDto.ts +10 -0
- package/src/Model/CardGame/cardDto.ts +16 -0
- package/src/Model/CardGame/cardGameTeam.ts +8 -0
- package/src/Model/CardGame/cardSuit.ts +9 -0
- package/src/Model/CardGame/contractBridgeCardType.ts +18 -0
- package/src/Model/CardGame/gameDto.ts +27 -0
- package/src/Model/CardGame/playerDto.ts +8 -0
- package/src/Model/CardGame/playerPosition.ts +10 -0
- package/src/Model/CardGameAnnounceSymbolModel.ts +11 -0
- package/src/Model/Core/connectionDto.ts +7 -0
- package/src/Model/Core/errorReportDto.ts +7 -0
- package/src/Model/Core/gameCookieDto.ts +15 -0
- package/src/Model/Core/gameDto.ts +9 -0
- package/src/Model/Core/gameState.ts +19 -0
- package/src/Model/Core/newScoreDto.ts +6 -0
- package/src/Model/Core/playerDto.ts +9 -0
- package/src/Model/Core/userDto.ts +23 -0
- package/src/Model/GameInterface.ts +12 -0
- package/src/Model/GamePlayInterface.ts +9 -0
- package/src/Model/GameRoomInterface.ts +14 -0
- package/src/Model/GameRoomModel.ts +9 -0
- package/src/Model/PlayerInterface.ts +13 -0
package/CHANGELOG.md
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ivan I. Atanasov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# game-platform
|
package/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.0
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vankosoft/game-platform",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Game Platform",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/iatanasov77/game-platform.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"online games"
|
|
14
|
+
],
|
|
15
|
+
"author": "iatanasov77",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/iatanasov77/game-platform/issues"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/iatanasov77/game-platform#readme"
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import PlayerColor from './playerColor';
|
|
2
|
+
import ChessMoveType from './chessMoveType';
|
|
3
|
+
import ChessPieceType from './chessPieceType';
|
|
4
|
+
|
|
5
|
+
interface ChessMoveDto
|
|
6
|
+
{
|
|
7
|
+
color: PlayerColor;
|
|
8
|
+
type: ChessMoveType;
|
|
9
|
+
from: string;
|
|
10
|
+
to: string;
|
|
11
|
+
|
|
12
|
+
causeCheck: boolean;
|
|
13
|
+
|
|
14
|
+
piece: ChessPieceType;
|
|
15
|
+
capturedPiece?: ChessPieceType;
|
|
16
|
+
promoPiece?: ChessPieceType;
|
|
17
|
+
enpassantPiece?: ChessPieceType;
|
|
18
|
+
|
|
19
|
+
nextMoves: ChessMoveDto[];
|
|
20
|
+
totalMoves: ChessMoveDto[];
|
|
21
|
+
|
|
22
|
+
animate: boolean;
|
|
23
|
+
hint: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default ChessMoveDto;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import GameDto from '../Core/gameDto';
|
|
2
|
+
import BoardGamePlayerDto from './playerDto';
|
|
3
|
+
import PlayerColor from './playerColor';
|
|
4
|
+
import PointDto from './pointDto';
|
|
5
|
+
import MoveDto from './moveDto';
|
|
6
|
+
import ChessSquareDto from './chessSquareDto';
|
|
7
|
+
|
|
8
|
+
interface BoardGameDto extends GameDto {
|
|
9
|
+
blackPlayer: BoardGamePlayerDto;
|
|
10
|
+
whitePlayer: BoardGamePlayerDto;
|
|
11
|
+
currentPlayer: PlayerColor;
|
|
12
|
+
winner: PlayerColor;
|
|
13
|
+
points: PointDto[];
|
|
14
|
+
squares: ChessSquareDto[];
|
|
15
|
+
validMoves: MoveDto[];
|
|
16
|
+
thinkTime: number;
|
|
17
|
+
goldMultiplier: number;
|
|
18
|
+
isGoldGame: boolean;
|
|
19
|
+
lastDoubler?: PlayerColor;
|
|
20
|
+
stake: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default BoardGameDto;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import PlayerDto from '../Core/playerDto';
|
|
2
|
+
import PlayerColor from './playerColor';
|
|
3
|
+
|
|
4
|
+
interface BoardGamePlayerDto extends PlayerDto {
|
|
5
|
+
playerColor: PlayerColor;
|
|
6
|
+
pointsLeft: number;
|
|
7
|
+
elo: number;
|
|
8
|
+
gold: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default BoardGamePlayerDto;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import PlayerPosition from './playerPosition';
|
|
2
|
+
import AnnounceType from './announceType';
|
|
3
|
+
import CardDto from './cardDto';
|
|
4
|
+
|
|
5
|
+
interface AnnounceDto
|
|
6
|
+
{
|
|
7
|
+
Player: PlayerPosition;
|
|
8
|
+
Type: AnnounceType;
|
|
9
|
+
Card: CardDto;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default AnnounceDto;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import PlayerPosition from './playerPosition';
|
|
2
|
+
import BidType from './bidType';
|
|
3
|
+
|
|
4
|
+
interface BidDto
|
|
5
|
+
{
|
|
6
|
+
Player: PlayerPosition;
|
|
7
|
+
KontraPlayer?: PlayerPosition;
|
|
8
|
+
ReKontraPlayer?: PlayerPosition;
|
|
9
|
+
|
|
10
|
+
Type: BidType;
|
|
11
|
+
NextBids: BidDto[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default BidDto;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import CardSuit from './cardSuit';
|
|
2
|
+
import BridgeBeloteCardType from './bridgeBeloteCardType';
|
|
3
|
+
import ContractBridgeCardType from './contractBridgeCardType';
|
|
4
|
+
import PlayerPosition from './playerPosition';
|
|
5
|
+
|
|
6
|
+
interface CardDto
|
|
7
|
+
{
|
|
8
|
+
Suit: CardSuit;
|
|
9
|
+
Type: BridgeBeloteCardType | ContractBridgeCardType;
|
|
10
|
+
|
|
11
|
+
position: PlayerPosition;
|
|
12
|
+
cardIndex: string;
|
|
13
|
+
animate: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default CardDto;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import GameDto from '../Core/gameDto';
|
|
2
|
+
import CardGamePlayerDto from './playerDto';
|
|
3
|
+
import PlayerPosition from './playerPosition';
|
|
4
|
+
import CardGameTeam from './cardGameTeam'
|
|
5
|
+
|
|
6
|
+
interface CardGameDto extends GameDto {
|
|
7
|
+
players: CardGamePlayerDto[];
|
|
8
|
+
validBids: any;
|
|
9
|
+
validCards: any;
|
|
10
|
+
contract: any;
|
|
11
|
+
|
|
12
|
+
currentPlayer: PlayerPosition;
|
|
13
|
+
winner: CardGameTeam;
|
|
14
|
+
thinkTime: number;
|
|
15
|
+
|
|
16
|
+
FirstToPlayInTheRound: PlayerPosition;
|
|
17
|
+
RoundNumber: number;
|
|
18
|
+
TrickNumber: number;
|
|
19
|
+
|
|
20
|
+
SouthNorthPoints: number;
|
|
21
|
+
EastWestPoints: number;
|
|
22
|
+
|
|
23
|
+
MyCards: any;
|
|
24
|
+
Bids: any;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default CardGameDto;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import PlayerColor from './playerColor';
|
|
2
|
+
import PlayerPosition from '../CardGame/playerPosition';
|
|
3
|
+
|
|
4
|
+
interface GameCookieDto
|
|
5
|
+
{
|
|
6
|
+
id: string;
|
|
7
|
+
game: string;
|
|
8
|
+
|
|
9
|
+
color?: PlayerColor;
|
|
10
|
+
position?: PlayerPosition;
|
|
11
|
+
|
|
12
|
+
roomSelected: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default GameCookieDto;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
enum GameState
|
|
2
|
+
{
|
|
3
|
+
opponentConnectWaiting,
|
|
4
|
+
firstThrow,
|
|
5
|
+
playing,
|
|
6
|
+
requestedDoubling,
|
|
7
|
+
ended,
|
|
8
|
+
|
|
9
|
+
// Chess States
|
|
10
|
+
firstMove,
|
|
11
|
+
|
|
12
|
+
// Card Games States
|
|
13
|
+
firstBid,
|
|
14
|
+
bidding,
|
|
15
|
+
firstRound,
|
|
16
|
+
roundEnded
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default GameState;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
interface UserDto {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
photoUrl: string;
|
|
6
|
+
showPhoto: boolean;
|
|
7
|
+
socialProvider: string;
|
|
8
|
+
socialProviderId: string;
|
|
9
|
+
createdNew: boolean;
|
|
10
|
+
isAdmin: boolean;
|
|
11
|
+
preferredLanguage: string;
|
|
12
|
+
theme: string;
|
|
13
|
+
emailNotification: boolean;
|
|
14
|
+
gold: number;
|
|
15
|
+
lastFreeGold: number;
|
|
16
|
+
elo: number;
|
|
17
|
+
passHash: number;
|
|
18
|
+
localLoginName: string;
|
|
19
|
+
acceptedLanguages: string[];
|
|
20
|
+
muteIntro: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default UserDto;
|