trucoshi 0.1.1 → 0.1.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/package.json +3 -6
- package/dist/index.d.ts +0 -2
- package/dist/lib/classes/Deck.d.ts +0 -16
- package/dist/lib/classes/Deck.js +0 -38
- package/dist/lib/classes/GameLoop.d.ts +0 -20
- package/dist/lib/classes/GameLoop.js +0 -103
- package/dist/lib/classes/Hand.d.ts +0 -38
- package/dist/lib/classes/Hand.js +0 -233
- package/dist/lib/classes/Lobby.d.ts +0 -27
- package/dist/lib/classes/Lobby.js +0 -114
- package/dist/lib/classes/Match.d.ts +0 -18
- package/dist/lib/classes/Match.js +0 -115
- package/dist/lib/classes/Play.d.ts +0 -21
- package/dist/lib/classes/Play.js +0 -39
- package/dist/lib/classes/Player.d.ts +0 -24
- package/dist/lib/classes/Player.js +0 -71
- package/dist/lib/classes/Round.d.ts +0 -17
- package/dist/lib/classes/Round.js +0 -34
- package/dist/lib/classes/Table.d.ts +0 -12
- package/dist/lib/classes/Table.js +0 -30
- package/dist/lib/classes/Team.d.ts +0 -17
- package/dist/lib/classes/Team.js +0 -58
- package/dist/lib/classes/Truco.d.ts +0 -18
- package/dist/lib/classes/Truco.js +0 -110
- package/dist/lib/classes/index.d.ts +0 -11
- package/dist/lib/classes/index.js +0 -27
- package/dist/lib/constants.d.ts +0 -45
- package/dist/lib/constants.js +0 -85
- package/dist/lib/index.d.ts +0 -2
- package/dist/lib/index.js +0 -18
- package/dist/lib/types.d.ts +0 -50
- package/dist/lib/types.js +0 -34
- package/dist/lib/utils.d.ts +0 -5
- package/dist/lib/utils.js +0 -59
- package/dist/server/classes/MatchTable.d.ts +0 -32
- package/dist/server/classes/MatchTable.js +0 -77
- package/dist/server/classes/User.d.ts +0 -5
- package/dist/server/classes/User.js +0 -11
- package/dist/server/classes/index.d.ts +0 -0
- package/dist/server/classes/index.js +0 -1
- package/dist/server/index.d.ts +0 -1
- package/dist/server/index.js +0 -379
- package/dist/server/types.d.ts +0 -36
- package/dist/server/types.js +0 -26
- package/dist/test/autoplay.d.ts +0 -1
- package/dist/test/autoplay.js +0 -94
- package/dist/test/play.d.ts +0 -1
- package/dist/test/play.js +0 -214
- package/dist/types.d.ts +0 -83
- package/dist/types.js +0 -57
package/dist/test/play.js
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
62
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
63
|
-
if (ar || !(i in from)) {
|
|
64
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
65
|
-
ar[i] = from[i];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
69
|
-
};
|
|
70
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71
|
-
var readline = __importStar(require("readline"));
|
|
72
|
-
var lib_1 = require("../lib");
|
|
73
|
-
var command = function (title, onLine) {
|
|
74
|
-
var promise = function () {
|
|
75
|
-
return new Promise(function (resolve) {
|
|
76
|
-
var rl = readline.createInterface(process.stdin, process.stdout);
|
|
77
|
-
rl.setPrompt(title);
|
|
78
|
-
rl.prompt();
|
|
79
|
-
rl.on("line", function (line) { return __awaiter(void 0, void 0, void 0, function () {
|
|
80
|
-
var e_1;
|
|
81
|
-
return __generator(this, function (_a) {
|
|
82
|
-
switch (_a.label) {
|
|
83
|
-
case 0:
|
|
84
|
-
_a.trys.push([0, 2, , 3]);
|
|
85
|
-
return [4 /*yield*/, onLine(line, function () { return rl.close(); })];
|
|
86
|
-
case 1:
|
|
87
|
-
_a.sent();
|
|
88
|
-
rl.close();
|
|
89
|
-
resolve();
|
|
90
|
-
return [3 /*break*/, 3];
|
|
91
|
-
case 2:
|
|
92
|
-
e_1 = _a.sent();
|
|
93
|
-
rl.close();
|
|
94
|
-
return [2 /*return*/, (function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
95
|
-
return __generator(this, function (_a) {
|
|
96
|
-
switch (_a.label) {
|
|
97
|
-
case 0: return [4 /*yield*/, promise()];
|
|
98
|
-
case 1:
|
|
99
|
-
_a.sent();
|
|
100
|
-
resolve();
|
|
101
|
-
return [2 /*return*/];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
}); })()];
|
|
105
|
-
case 3: return [2 /*return*/];
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}); });
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
return promise;
|
|
112
|
-
};
|
|
113
|
-
var playCommand = function (play) {
|
|
114
|
-
var _a, _b, _d;
|
|
115
|
-
return command("".concat((_a = play.player) === null || _a === void 0 ? void 0 : _a.id, " elije una carta [").concat((_b = play.player) === null || _b === void 0 ? void 0 : _b.hand.map(function (_c, i) { return i + 1; }), "]: ").concat(JSON.stringify((_d = play.player) === null || _d === void 0 ? void 0 : _d.hand), "\n"), function (idx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
116
|
-
var card, playedCard, handString;
|
|
117
|
-
var _a, _b;
|
|
118
|
-
return __generator(this, function (_d) {
|
|
119
|
-
card = (_a = play.player) === null || _a === void 0 ? void 0 : _a.hand[Number(idx) - 1];
|
|
120
|
-
playedCard = play.use(Number(idx) - 1, card);
|
|
121
|
-
if (!playedCard) {
|
|
122
|
-
return [2 /*return*/, Promise.reject()];
|
|
123
|
-
}
|
|
124
|
-
handString = JSON.stringify((_b = play.player) === null || _b === void 0 ? void 0 : _b.hand);
|
|
125
|
-
console.log("\n".concat(handString, "\nUsing ").concat(playedCard));
|
|
126
|
-
console.log(play.rounds && play.rounds.length
|
|
127
|
-
? play.rounds.map(function (round) {
|
|
128
|
-
return round.cards.length ? round.cards.map(function (c) { return [c.player.id, c.card]; }) : "";
|
|
129
|
-
})
|
|
130
|
-
: "");
|
|
131
|
-
return [2 /*return*/, Promise.resolve()];
|
|
132
|
-
});
|
|
133
|
-
}); });
|
|
134
|
-
};
|
|
135
|
-
var sayCommand = function (play, canPlay) {
|
|
136
|
-
var _a, _b;
|
|
137
|
-
return command("".concat((_a = play.player) === null || _a === void 0 ? void 0 : _a.id, " elije una accion [").concat(canPlay ? "0," : "").concat((_b = play.commands) === null || _b === void 0 ? void 0 : _b.map(function (_c, i) { return i + 1; }), "]: ").concat(canPlay ? JSON.stringify(__spreadArray(["CARTA"], (play.commands || []), true)) : JSON.stringify(play.commands), "\n"), function (idx, close) { return __awaiter(void 0, void 0, void 0, function () {
|
|
138
|
-
var selectedCommand;
|
|
139
|
-
var _a;
|
|
140
|
-
return __generator(this, function (_b) {
|
|
141
|
-
switch (_b.label) {
|
|
142
|
-
case 0:
|
|
143
|
-
selectedCommand = (_a = play.commands) === null || _a === void 0 ? void 0 : _a[Number(idx) - 1];
|
|
144
|
-
if (selectedCommand) {
|
|
145
|
-
play.say(selectedCommand);
|
|
146
|
-
return [2 /*return*/, Promise.resolve()];
|
|
147
|
-
}
|
|
148
|
-
if (!(idx === "0" && canPlay)) return [3 /*break*/, 2];
|
|
149
|
-
close();
|
|
150
|
-
return [4 /*yield*/, playCommand(play)()];
|
|
151
|
-
case 1:
|
|
152
|
-
_b.sent();
|
|
153
|
-
return [2 /*return*/, Promise.resolve()];
|
|
154
|
-
case 2: return [2 /*return*/, Promise.reject()];
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}); });
|
|
158
|
-
};
|
|
159
|
-
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
160
|
-
var trucoshi;
|
|
161
|
-
return __generator(this, function (_a) {
|
|
162
|
-
trucoshi = (0, lib_1.Lobby)();
|
|
163
|
-
trucoshi.addPlayer("lukini", "lukini").setReady(true);
|
|
164
|
-
trucoshi.addPlayer("denoph", "denoph").setReady(true);
|
|
165
|
-
trucoshi.addPlayer("guada", "guada").setReady(true);
|
|
166
|
-
trucoshi.addPlayer("juli", "juli").setReady(true);
|
|
167
|
-
trucoshi
|
|
168
|
-
.startMatch()
|
|
169
|
-
.onTruco(function (play) { return __awaiter(void 0, void 0, void 0, function () {
|
|
170
|
-
return __generator(this, function (_a) {
|
|
171
|
-
switch (_a.label) {
|
|
172
|
-
case 0: return [4 /*yield*/, sayCommand(play, false)()];
|
|
173
|
-
case 1:
|
|
174
|
-
_a.sent();
|
|
175
|
-
return [2 /*return*/];
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
}); })
|
|
179
|
-
.onTurn(function (play) { return __awaiter(void 0, void 0, void 0, function () {
|
|
180
|
-
var name;
|
|
181
|
-
var _a;
|
|
182
|
-
return __generator(this, function (_b) {
|
|
183
|
-
switch (_b.label) {
|
|
184
|
-
case 0:
|
|
185
|
-
name = (_a = play.player) === null || _a === void 0 ? void 0 : _a.id.toUpperCase();
|
|
186
|
-
console.log("=== Mano ".concat(play.handIdx, " === Ronda ").concat(play.roundIdx, " === Turno de ").concat(name, " ==="));
|
|
187
|
-
play.teams.map(function (team, id) {
|
|
188
|
-
return console.log("=== Team ".concat(id, " = ").concat(team.points.malas, " malas ").concat(team.points.buenas, " buenas"));
|
|
189
|
-
});
|
|
190
|
-
console.log(play.rounds && play.rounds.length
|
|
191
|
-
? play.rounds.map(function (round) {
|
|
192
|
-
return round.cards.length ? round.cards.map(function (c) { return [c.player.id, c.card]; }) : "";
|
|
193
|
-
})
|
|
194
|
-
: "");
|
|
195
|
-
return [4 /*yield*/, sayCommand(play, true)()];
|
|
196
|
-
case 1:
|
|
197
|
-
_b.sent();
|
|
198
|
-
return [2 /*return*/];
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
}); })
|
|
202
|
-
.onWinner(function (winner, teams) { return __awaiter(void 0, void 0, void 0, function () {
|
|
203
|
-
return __generator(this, function (_a) {
|
|
204
|
-
teams.map(function (t, i) {
|
|
205
|
-
return console.log("Equipo ".concat(i, ": ").concat(t.players.map(function (p) { return " ".concat(p.id); }), " === ").concat(t.points.malas, " malas ").concat(t.points.buenas, " buenas"));
|
|
206
|
-
});
|
|
207
|
-
console.log("\nEquipo Ganador:".concat(winner === null || winner === void 0 ? void 0 : winner.players.map(function (p) { return " ".concat(p.id); })));
|
|
208
|
-
return [2 /*return*/];
|
|
209
|
-
});
|
|
210
|
-
}); })
|
|
211
|
-
.begin();
|
|
212
|
-
return [2 /*return*/];
|
|
213
|
-
});
|
|
214
|
-
}); })();
|
package/dist/types.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Socket } from "socket.io";
|
|
2
|
-
import { ICard, IPlayer, ITeam } from "./lib";
|
|
3
|
-
export declare enum ESayCommand {
|
|
4
|
-
QUIERO = "QUIERO",
|
|
5
|
-
NO_QUIERO = "NO_QUIERO",
|
|
6
|
-
TRUCO = "TRUCO",
|
|
7
|
-
MAZO = "MAZO",
|
|
8
|
-
FLOR = "FLOR",
|
|
9
|
-
CONTRAFLOR = "CONTRAFLOR"
|
|
10
|
-
}
|
|
11
|
-
export declare enum EEnvidoCommand {
|
|
12
|
-
ENVIDO = "ENVIDO",
|
|
13
|
-
ENVIDO_ENVIDO = "ENVIDO_ENVIDO",
|
|
14
|
-
REAL_ENVIDO = "REAL_ENVIDO",
|
|
15
|
-
FALTA_ENVIDO = "FALTA_ENVIDO"
|
|
16
|
-
}
|
|
17
|
-
export declare enum EHandState {
|
|
18
|
-
WAITING_PLAY = "WAITING_PLAY",
|
|
19
|
-
WAITING_FOR_TRUCO_ANSWER = "WAITING_FOR_TRUCO_ANSWER",
|
|
20
|
-
WAITING_ENVIDO_ANSWER = "WAITING_ENVIDO_ANSWER",
|
|
21
|
-
FINISHED = "FINISHED"
|
|
22
|
-
}
|
|
23
|
-
export type ECommand = ESayCommand | EEnvidoCommand;
|
|
24
|
-
export declare enum GAME_ERROR {
|
|
25
|
-
MATCH_ALREADY_STARTED = "MATCH_ALREADY_STARTED",
|
|
26
|
-
LOBBY_IS_FULL = "LOBBY_IS_FULL",
|
|
27
|
-
UNEXPECTED_TEAM_SIZE = "UNEXPECTED_TEAM_SIZE",
|
|
28
|
-
TEAM_NOT_READY = "TEAM_NOT_READY",
|
|
29
|
-
TEAM_IS_FULL = "TEAM_IS_FULL"
|
|
30
|
-
}
|
|
31
|
-
export interface EnvidoState {
|
|
32
|
-
accept: number;
|
|
33
|
-
decline: number;
|
|
34
|
-
teamIdx: 0 | 1 | null;
|
|
35
|
-
}
|
|
36
|
-
export type IHandCommands = {
|
|
37
|
-
[key in ECommand]: (player: IPlayer) => void;
|
|
38
|
-
};
|
|
39
|
-
export type IEnvidoCalculatorResult = {
|
|
40
|
-
accept: number;
|
|
41
|
-
decline: number;
|
|
42
|
-
next: Array<ECommand>;
|
|
43
|
-
};
|
|
44
|
-
export type IEnvidoCalculatorArgs = {
|
|
45
|
-
teams: [ITeam, ITeam];
|
|
46
|
-
matchPoint: number;
|
|
47
|
-
};
|
|
48
|
-
export type IEnvidoCalculator = {
|
|
49
|
-
[key in EEnvidoCommand]: (args?: IEnvidoCalculatorArgs) => IEnvidoCalculatorResult;
|
|
50
|
-
};
|
|
51
|
-
export declare enum EClientEvent {
|
|
52
|
-
PING = "PING",
|
|
53
|
-
PLAY = "PLAY",
|
|
54
|
-
CREATE_MATCH = "CREATE_MATCH",
|
|
55
|
-
GET_MATCH = "GET_MATCH",
|
|
56
|
-
JOIN_MATCH = "JOIN_MATCH",
|
|
57
|
-
START_MATCH = "START_MATCH",
|
|
58
|
-
SET_PLAYER_READY = "SET_PLAYER_READY",
|
|
59
|
-
SET_SESSION = "SET_SESSION"
|
|
60
|
-
}
|
|
61
|
-
export declare enum EServerEvent {
|
|
62
|
-
PONG = "PONG",
|
|
63
|
-
UPDATE_MATCH = "UPDATE_MATCH",
|
|
64
|
-
WAITING_PLAY = "WAITING_PLAY"
|
|
65
|
-
}
|
|
66
|
-
export interface TrucoshiSocket extends Socket {
|
|
67
|
-
session?: string;
|
|
68
|
-
}
|
|
69
|
-
export declare enum ETrucoshiMatchState {
|
|
70
|
-
UNREADY = 0,
|
|
71
|
-
STARTED = 1,
|
|
72
|
-
FINISHED = 2
|
|
73
|
-
}
|
|
74
|
-
export type IWaitingPlayData = {
|
|
75
|
-
cardIdx: number;
|
|
76
|
-
card: ICard;
|
|
77
|
-
command?: undefined;
|
|
78
|
-
} | {
|
|
79
|
-
cardIdx?: undefined;
|
|
80
|
-
card?: undefined;
|
|
81
|
-
command: ECommand;
|
|
82
|
-
};
|
|
83
|
-
export type IWaitingPlayCallback = (data: IWaitingPlayData) => void | null;
|
package/dist/types.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ETrucoshiMatchState = exports.EServerEvent = exports.EClientEvent = exports.GAME_ERROR = exports.EHandState = exports.EEnvidoCommand = exports.ESayCommand = void 0;
|
|
4
|
-
var ESayCommand;
|
|
5
|
-
(function (ESayCommand) {
|
|
6
|
-
ESayCommand["QUIERO"] = "QUIERO";
|
|
7
|
-
ESayCommand["NO_QUIERO"] = "NO_QUIERO";
|
|
8
|
-
ESayCommand["TRUCO"] = "TRUCO";
|
|
9
|
-
ESayCommand["MAZO"] = "MAZO";
|
|
10
|
-
ESayCommand["FLOR"] = "FLOR";
|
|
11
|
-
ESayCommand["CONTRAFLOR"] = "CONTRAFLOR";
|
|
12
|
-
})(ESayCommand = exports.ESayCommand || (exports.ESayCommand = {}));
|
|
13
|
-
var EEnvidoCommand;
|
|
14
|
-
(function (EEnvidoCommand) {
|
|
15
|
-
EEnvidoCommand["ENVIDO"] = "ENVIDO";
|
|
16
|
-
EEnvidoCommand["ENVIDO_ENVIDO"] = "ENVIDO_ENVIDO";
|
|
17
|
-
EEnvidoCommand["REAL_ENVIDO"] = "REAL_ENVIDO";
|
|
18
|
-
EEnvidoCommand["FALTA_ENVIDO"] = "FALTA_ENVIDO";
|
|
19
|
-
})(EEnvidoCommand = exports.EEnvidoCommand || (exports.EEnvidoCommand = {}));
|
|
20
|
-
var EHandState;
|
|
21
|
-
(function (EHandState) {
|
|
22
|
-
EHandState["WAITING_PLAY"] = "WAITING_PLAY";
|
|
23
|
-
EHandState["WAITING_FOR_TRUCO_ANSWER"] = "WAITING_FOR_TRUCO_ANSWER";
|
|
24
|
-
EHandState["WAITING_ENVIDO_ANSWER"] = "WAITING_ENVIDO_ANSWER";
|
|
25
|
-
EHandState["FINISHED"] = "FINISHED";
|
|
26
|
-
})(EHandState = exports.EHandState || (exports.EHandState = {}));
|
|
27
|
-
var GAME_ERROR;
|
|
28
|
-
(function (GAME_ERROR) {
|
|
29
|
-
GAME_ERROR["MATCH_ALREADY_STARTED"] = "MATCH_ALREADY_STARTED";
|
|
30
|
-
GAME_ERROR["LOBBY_IS_FULL"] = "LOBBY_IS_FULL";
|
|
31
|
-
GAME_ERROR["UNEXPECTED_TEAM_SIZE"] = "UNEXPECTED_TEAM_SIZE";
|
|
32
|
-
GAME_ERROR["TEAM_NOT_READY"] = "TEAM_NOT_READY";
|
|
33
|
-
GAME_ERROR["TEAM_IS_FULL"] = "TEAM_IS_FULL";
|
|
34
|
-
})(GAME_ERROR = exports.GAME_ERROR || (exports.GAME_ERROR = {}));
|
|
35
|
-
var EClientEvent;
|
|
36
|
-
(function (EClientEvent) {
|
|
37
|
-
EClientEvent["PING"] = "PING";
|
|
38
|
-
EClientEvent["PLAY"] = "PLAY";
|
|
39
|
-
EClientEvent["CREATE_MATCH"] = "CREATE_MATCH";
|
|
40
|
-
EClientEvent["GET_MATCH"] = "GET_MATCH";
|
|
41
|
-
EClientEvent["JOIN_MATCH"] = "JOIN_MATCH";
|
|
42
|
-
EClientEvent["START_MATCH"] = "START_MATCH";
|
|
43
|
-
EClientEvent["SET_PLAYER_READY"] = "SET_PLAYER_READY";
|
|
44
|
-
EClientEvent["SET_SESSION"] = "SET_SESSION";
|
|
45
|
-
})(EClientEvent = exports.EClientEvent || (exports.EClientEvent = {}));
|
|
46
|
-
var EServerEvent;
|
|
47
|
-
(function (EServerEvent) {
|
|
48
|
-
EServerEvent["PONG"] = "PONG";
|
|
49
|
-
EServerEvent["UPDATE_MATCH"] = "UPDATE_MATCH";
|
|
50
|
-
EServerEvent["WAITING_PLAY"] = "WAITING_PLAY";
|
|
51
|
-
})(EServerEvent = exports.EServerEvent || (exports.EServerEvent = {}));
|
|
52
|
-
var ETrucoshiMatchState;
|
|
53
|
-
(function (ETrucoshiMatchState) {
|
|
54
|
-
ETrucoshiMatchState[ETrucoshiMatchState["UNREADY"] = 0] = "UNREADY";
|
|
55
|
-
ETrucoshiMatchState[ETrucoshiMatchState["STARTED"] = 1] = "STARTED";
|
|
56
|
-
ETrucoshiMatchState[ETrucoshiMatchState["FINISHED"] = 2] = "FINISHED";
|
|
57
|
-
})(ETrucoshiMatchState = exports.ETrucoshiMatchState || (exports.ETrucoshiMatchState = {}));
|