trucoshi 0.4.9 → 0.5.1
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/lib/constants.d.ts +1 -0
- package/dist/lib/constants.js +2 -1
- package/dist/types.d.ts +9 -3
- package/dist/types.js +5 -1
- package/package.json +1 -1
package/dist/lib/constants.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare const CARDS: {
|
|
|
40
40
|
"4b": number;
|
|
41
41
|
"4c": number;
|
|
42
42
|
};
|
|
43
|
+
export declare const BURNT_CARD: "1e" | "1b" | "7e" | "7o" | "3e" | "3o" | "3b" | "3c" | "2e" | "2o" | "2b" | "2c" | "1o" | "1c" | "re" | "ro" | "rb" | "rc" | "ce" | "co" | "cb" | "cc" | "pe" | "po" | "pb" | "pc" | "7b" | "7c" | "6e" | "6o" | "6b" | "6c" | "5e" | "5o" | "5b" | "5c" | "4e" | "4o" | "4b" | "4c";
|
|
43
44
|
export declare const CARDS_HUMAN_READABLE: {
|
|
44
45
|
"1e": string;
|
|
45
46
|
"1b": string;
|
package/dist/lib/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TEAM_SIZE_VALUES = exports.CARDS_HUMAN_READABLE = exports.CARDS = void 0;
|
|
3
|
+
exports.TEAM_SIZE_VALUES = exports.CARDS_HUMAN_READABLE = exports.BURNT_CARD = exports.CARDS = void 0;
|
|
4
4
|
exports.CARDS = {
|
|
5
5
|
"1e": 13,
|
|
6
6
|
"1b": 12,
|
|
@@ -43,6 +43,7 @@ exports.CARDS = {
|
|
|
43
43
|
"4b": 0,
|
|
44
44
|
"4c": 0,
|
|
45
45
|
};
|
|
46
|
+
exports.BURNT_CARD = "xx";
|
|
46
47
|
exports.CARDS_HUMAN_READABLE = {
|
|
47
48
|
"1e": "1🗡️",
|
|
48
49
|
"1b": "1🌵",
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CARDS, CARDS_HUMAN_READABLE } from "./lib/constants";
|
|
2
2
|
export { CARDS, CARDS_HUMAN_READABLE };
|
|
3
|
+
export { PREVIOUS_HAND_ACK_TIMEOUT, PLAYER_ABANDON_TIMEOUT, PLAYER_TURN_TIMEOUT, } from "./server/constants";
|
|
3
4
|
export interface ISaidCommand {
|
|
4
5
|
player: IPlayer | IPublicPlayer;
|
|
5
6
|
command: ECommand | number;
|
|
@@ -171,7 +172,7 @@ export type IWaitingPlayData = {
|
|
|
171
172
|
};
|
|
172
173
|
export type IWaitingPlayCallback = (data: IWaitingPlayData) => void | null;
|
|
173
174
|
export type IWaitingSayData = {
|
|
174
|
-
command: ECommand;
|
|
175
|
+
command: ECommand | number;
|
|
175
176
|
};
|
|
176
177
|
export type IWaitingSayCallback = (data: IWaitingSayData) => void | null;
|
|
177
178
|
export declare class TMap<K, V> extends Map<K, V> {
|
|
@@ -220,7 +221,7 @@ export interface IDeck {
|
|
|
220
221
|
}
|
|
221
222
|
export type ICard = keyof typeof CARDS;
|
|
222
223
|
export interface IPlayedCard {
|
|
223
|
-
|
|
224
|
+
key: string;
|
|
224
225
|
player: IPlayer | IPublicPlayer;
|
|
225
226
|
card: ICard;
|
|
226
227
|
}
|
|
@@ -228,7 +229,7 @@ export interface IHandPoints {
|
|
|
228
229
|
0: number;
|
|
229
230
|
1: number;
|
|
230
231
|
}
|
|
231
|
-
export type IPublicPlayer = Pick<IPlayer, "id" | "key" | "disabled" | "ready" | "hand" | "usedHand" | "prevHand" | "teamIdx" | "isTurn" | "isEnvidoTurn" | "isOwner"> & ({
|
|
232
|
+
export type IPublicPlayer = Pick<IPlayer, "id" | "key" | "disabled" | "abandoned" | "ready" | "hand" | "usedHand" | "prevHand" | "teamIdx" | "isTurn" | "turnExpiresAt" | "turnExtensionExpiresAt" | "isEnvidoTurn" | "isOwner"> & ({
|
|
232
233
|
isMe?: true;
|
|
233
234
|
commands: IPlayer["commands"];
|
|
234
235
|
hasFlor: IPlayer["hasFlor"];
|
|
@@ -254,20 +255,25 @@ export interface IPlayer {
|
|
|
254
255
|
usedHand: Array<ICard>;
|
|
255
256
|
prevHand: Array<ICard>;
|
|
256
257
|
isTurn: boolean;
|
|
258
|
+
turnExpiresAt: number | null;
|
|
259
|
+
turnExtensionExpiresAt: number | null;
|
|
257
260
|
hasFlor: boolean;
|
|
258
261
|
isEnvidoTurn: boolean;
|
|
259
262
|
isOwner: boolean;
|
|
260
263
|
disabled: boolean;
|
|
264
|
+
abandoned: boolean;
|
|
261
265
|
ready: boolean;
|
|
262
266
|
resetCommands(): void;
|
|
263
267
|
calculateEnvido(): Array<number>;
|
|
264
268
|
setTurn(turn: boolean): void;
|
|
269
|
+
setTurnExpiration(...args: [number, number | null] | [null, null]): void;
|
|
265
270
|
setEnvidoTurn(turn: boolean): void;
|
|
266
271
|
getPublicPlayer(session?: string): IPublicPlayer;
|
|
267
272
|
setSession(session: string): void;
|
|
268
273
|
setIsOwner(isOwner: boolean): void;
|
|
269
274
|
enable(): void;
|
|
270
275
|
disable(): void;
|
|
276
|
+
abandon(): void;
|
|
271
277
|
setReady(ready: boolean): void;
|
|
272
278
|
setHand(hand: Array<ICard>): Array<ICard>;
|
|
273
279
|
useCard(idx: number, card: ICard): ICard | null;
|
package/dist/types.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GAME_ERROR = exports.TMap = exports.ETrucoshiMatchState = exports.EClientEvent = exports.EServerEvent = exports.EHandState = exports.EEnvidoCommand = exports.EEnvidoAnswerCommand = exports.EAnswerCommand = exports.ETrucoCommand = exports.EFlorCommand = exports.ESayCommand = exports.EMatchTableState = exports.EChatSystem = exports.CARDS_HUMAN_READABLE = exports.CARDS = void 0;
|
|
3
|
+
exports.GAME_ERROR = exports.TMap = exports.ETrucoshiMatchState = exports.EClientEvent = exports.EServerEvent = exports.EHandState = exports.EEnvidoCommand = exports.EEnvidoAnswerCommand = exports.EAnswerCommand = exports.ETrucoCommand = exports.EFlorCommand = exports.ESayCommand = exports.EMatchTableState = exports.EChatSystem = exports.PLAYER_TURN_TIMEOUT = exports.PLAYER_ABANDON_TIMEOUT = exports.PREVIOUS_HAND_ACK_TIMEOUT = exports.CARDS_HUMAN_READABLE = exports.CARDS = void 0;
|
|
4
4
|
const constants_1 = require("./lib/constants");
|
|
5
5
|
Object.defineProperty(exports, "CARDS", { enumerable: true, get: function () { return constants_1.CARDS; } });
|
|
6
6
|
Object.defineProperty(exports, "CARDS_HUMAN_READABLE", { enumerable: true, get: function () { return constants_1.CARDS_HUMAN_READABLE; } });
|
|
7
|
+
var constants_2 = require("./server/constants");
|
|
8
|
+
Object.defineProperty(exports, "PREVIOUS_HAND_ACK_TIMEOUT", { enumerable: true, get: function () { return constants_2.PREVIOUS_HAND_ACK_TIMEOUT; } });
|
|
9
|
+
Object.defineProperty(exports, "PLAYER_ABANDON_TIMEOUT", { enumerable: true, get: function () { return constants_2.PLAYER_ABANDON_TIMEOUT; } });
|
|
10
|
+
Object.defineProperty(exports, "PLAYER_TURN_TIMEOUT", { enumerable: true, get: function () { return constants_2.PLAYER_TURN_TIMEOUT; } });
|
|
7
11
|
var EChatSystem;
|
|
8
12
|
(function (EChatSystem) {
|
|
9
13
|
EChatSystem[EChatSystem["TEAM_0"] = 0] = "TEAM_0";
|