trucoshi 0.4.3 → 0.4.4

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.
@@ -40,4 +40,46 @@ export declare const CARDS: {
40
40
  "4b": number;
41
41
  "4c": number;
42
42
  };
43
+ export declare const CARDS_HUMAN_READABLE: {
44
+ "1e": string;
45
+ "1b": string;
46
+ "7e": string;
47
+ "7o": string;
48
+ "3e": string;
49
+ "3o": string;
50
+ "3b": string;
51
+ "3c": string;
52
+ "2e": string;
53
+ "2o": string;
54
+ "2b": string;
55
+ "2c": string;
56
+ "1o": string;
57
+ "1c": string;
58
+ re: string;
59
+ ro: string;
60
+ rb: string;
61
+ rc: string;
62
+ ce: string;
63
+ co: string;
64
+ cb: string;
65
+ cc: string;
66
+ pe: string;
67
+ po: string;
68
+ pb: string;
69
+ pc: string;
70
+ "7b": string;
71
+ "7c": string;
72
+ "6e": string;
73
+ "6o": string;
74
+ "6b": string;
75
+ "6c": string;
76
+ "5e": string;
77
+ "5o": string;
78
+ "5b": string;
79
+ "5c": string;
80
+ "4e": string;
81
+ "4o": string;
82
+ "4b": string;
83
+ "4c": string;
84
+ };
43
85
  export declare const TEAM_SIZE_VALUES: number[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TEAM_SIZE_VALUES = exports.CARDS = void 0;
3
+ exports.TEAM_SIZE_VALUES = exports.CARDS_HUMAN_READABLE = exports.CARDS = void 0;
4
4
  exports.CARDS = {
5
5
  "1e": 13,
6
6
  "1b": 12,
@@ -43,4 +43,46 @@ exports.CARDS = {
43
43
  "4b": 0,
44
44
  "4c": 0,
45
45
  };
46
+ exports.CARDS_HUMAN_READABLE = {
47
+ "1e": "1🗡️",
48
+ "1b": "1🌵",
49
+ "7e": "7🗡️",
50
+ "7o": "7💰",
51
+ "3e": "3🗡️",
52
+ "3o": "3💰",
53
+ "3b": "3🌵",
54
+ "3c": "3🍷",
55
+ "2e": "2🗡️",
56
+ "2o": "2💰",
57
+ "2b": "2🌵",
58
+ "2c": "2🍷",
59
+ "1o": "1💰",
60
+ "1c": "1🍷",
61
+ re: "12🗡️",
62
+ ro: "12💰",
63
+ rb: "12🌵",
64
+ rc: "12🍷",
65
+ ce: "11🗡️",
66
+ co: "11💰",
67
+ cb: "11🌵",
68
+ cc: "11🍷",
69
+ pe: "10🗡️",
70
+ po: "10💰",
71
+ pb: "10🌵",
72
+ pc: "10🍷",
73
+ "7b": "7🌵",
74
+ "7c": "7🍷",
75
+ "6e": "6🗡️",
76
+ "6o": "6💰",
77
+ "6b": "6🌵",
78
+ "6c": "6🍷",
79
+ "5e": "5🗡️",
80
+ "5o": "5💰",
81
+ "5b": "5🌵",
82
+ "5c": "5🍷",
83
+ "4e": "4🗡️",
84
+ "4o": "4💰",
85
+ "4b": "4🌵",
86
+ "4c": "4🍷",
87
+ };
46
88
  exports.TEAM_SIZE_VALUES = [1, 2, 3];
package/dist/types.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { CARDS } from "./lib/constants";
1
+ import { CARDS, CARDS_HUMAN_READABLE } from "./lib/constants";
2
+ export { CARDS, CARDS_HUMAN_READABLE };
2
3
  export interface ISaidCommand {
3
4
  player: IPlayer | IPublicPlayer;
4
5
  command: ECommand | number;
@@ -224,9 +225,17 @@ export interface IHandPoints {
224
225
  0: number;
225
226
  1: number;
226
227
  }
227
- export type IPublicPlayer = Pick<IPlayer, "id" | "key" | "disabled" | "ready" | "hand" | "envido" | "usedHand" | "prevHand" | "teamIdx" | "session" | "hasFlor" | "isTurn" | "isEnvidoTurn" | "isOwner"> & {
228
- commands: Array<ECommand>;
229
- };
228
+ export type IPublicPlayer = Pick<IPlayer, "id" | "key" | "disabled" | "ready" | "hand" | "usedHand" | "prevHand" | "teamIdx" | "isTurn" | "isEnvidoTurn" | "isOwner"> & ({
229
+ isMe?: true;
230
+ commands: IPlayer["commands"];
231
+ hasFlor: IPlayer["hasFlor"];
232
+ envido: IPlayer["envido"];
233
+ } | {
234
+ isMe?: false;
235
+ commands?: undefined;
236
+ hasFlor?: undefined;
237
+ envido?: undefined;
238
+ });
230
239
  export type IPublicTeam = Pick<ITeam, "points"> & {
231
240
  players: Array<IPublicPlayer>;
232
241
  };
@@ -251,7 +260,7 @@ export interface IPlayer {
251
260
  calculateEnvido(): Array<number>;
252
261
  setTurn(turn: boolean): void;
253
262
  setEnvidoTurn(turn: boolean): void;
254
- getPublicPlayer(): IPublicPlayer;
263
+ getPublicPlayer(session?: string): IPublicPlayer;
255
264
  setSession(session: string): void;
256
265
  setIsOwner(isOwner: boolean): void;
257
266
  enable(): void;
package/dist/types.js CHANGED
@@ -1,6 +1,9 @@
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 = 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.CARDS_HUMAN_READABLE = exports.CARDS = void 0;
4
+ const constants_1 = require("./lib/constants");
5
+ Object.defineProperty(exports, "CARDS", { enumerable: true, get: function () { return constants_1.CARDS; } });
6
+ Object.defineProperty(exports, "CARDS_HUMAN_READABLE", { enumerable: true, get: function () { return constants_1.CARDS_HUMAN_READABLE; } });
4
7
  var EChatSystem;
5
8
  (function (EChatSystem) {
6
9
  EChatSystem[EChatSystem["TEAM_0"] = 0] = "TEAM_0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trucoshi",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "main": "dist/types.js",
5
5
  "license": "GPL-3.0",
6
6
  "scripts": {