@gamepark/rules-api 5.23.2 → 5.24.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/dist/Action.d.ts +25 -25
- package/dist/Action.js +45 -55
- package/dist/Action.js.map +1 -1
- package/dist/ApplyAutomaticMoves.d.ts +2 -2
- package/dist/ApplyAutomaticMoves.js +18 -24
- package/dist/ApplyAutomaticMoves.js.map +1 -1
- package/dist/Competitive.d.ts +6 -6
- package/dist/Competitive.js +3 -7
- package/dist/Competitive.js.map +1 -1
- package/dist/Dummy.d.ts +7 -7
- package/dist/Dummy.js +22 -25
- package/dist/Dummy.js.map +1 -1
- package/dist/Eliminations.d.ts +5 -5
- package/dist/Eliminations.js +4 -8
- package/dist/Eliminations.js.map +1 -1
- package/dist/IncompleteInformation.d.ts +14 -14
- package/dist/IncompleteInformation.js +30 -37
- package/dist/IncompleteInformation.js.map +1 -1
- package/dist/LoopWithFuse.d.ts +4 -4
- package/dist/LoopWithFuse.js +10 -14
- package/dist/LoopWithFuse.js.map +1 -1
- package/dist/RandomMove.d.ts +7 -7
- package/dist/RandomMove.js +7 -12
- package/dist/RandomMove.js.map +1 -1
- package/dist/Robot.d.ts +2 -2
- package/dist/Robot.js +1 -2
- package/dist/Rules.d.ts +14 -14
- package/dist/Rules.js +63 -74
- package/dist/Rules.js.map +1 -1
- package/dist/RulesCreator.d.ts +5 -5
- package/dist/RulesCreator.js +1 -2
- package/dist/TimeLimit.d.ts +18 -18
- package/dist/TimeLimit.js +8 -12
- package/dist/TimeLimit.js.map +1 -1
- package/dist/Undo.d.ts +6 -6
- package/dist/Undo.js +4 -8
- package/dist/Undo.js.map +1 -1
- package/dist/index.d.ts +22 -22
- package/dist/index.js +13 -37
- package/dist/index.js.map +1 -1
- package/dist/options/EnumOption.d.ts +7 -7
- package/dist/options/EnumOption.js +3 -7
- package/dist/options/EnumOption.js.map +1 -1
- package/dist/options/Option.d.ts +9 -9
- package/dist/options/Option.js +1 -2
- package/dist/options/OptionSpecOf.d.ts +4 -4
- package/dist/options/OptionSpecOf.js +1 -2
- package/dist/options/OptionsSpec.d.ts +10 -10
- package/dist/options/OptionsSpec.js +1 -2
- package/dist/options/OptionsValidationError.d.ts +4 -4
- package/dist/options/OptionsValidationError.js +7 -28
- package/dist/options/OptionsValidationError.js.map +1 -1
- package/dist/options/PlayerIdSpec.d.ts +8 -8
- package/dist/options/PlayerIdSpec.js +12 -17
- package/dist/options/PlayerIdSpec.js.map +1 -1
- package/dist/options/PlayersOptionsSpec.d.ts +8 -8
- package/dist/options/PlayersOptionsSpec.js +1 -2
- package/dist/options/WithIdOption.d.ts +4 -4
- package/dist/options/WithIdOption.js +1 -2
- package/dist/options/WithPlayerOptionsSpec.d.ts +5 -5
- package/dist/options/WithPlayerOptionsSpec.js +1 -2
- package/dist/options/WithPlayersOptions.d.ts +4 -4
- package/dist/options/WithPlayersOptions.js +1 -2
- package/dist/options/getFallbackPlayerName.d.ts +4 -4
- package/dist/options/getFallbackPlayerName.js +9 -15
- package/dist/options/getFallbackPlayerName.js.map +1 -1
- package/dist/options/index.d.ts +13 -13
- package/dist/options/index.js +5 -29
- package/dist/options/index.js.map +1 -1
- package/dist/options/isWithPlayerIdOptions.d.ts +4 -4
- package/dist/options/isWithPlayerIdOptions.js +7 -10
- package/dist/options/isWithPlayerIdOptions.js.map +1 -1
- package/dist/options/providePlayerIds.d.ts +6 -6
- package/dist/options/providePlayerIds.js +22 -37
- package/dist/options/providePlayerIds.js.map +1 -1
- package/dist/utils/EnumUtils.d.ts +1 -1
- package/dist/utils/EnumUtils.js +3 -7
- package/dist/utils/EnumUtils.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -17
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -2
package/dist/Action.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { IncompleteInformation } from './index';
|
|
2
|
-
import Rules from './Rules';
|
|
3
|
-
|
|
4
|
-
id?: string;
|
|
5
|
-
playerId: PlayerId;
|
|
6
|
-
move: Move;
|
|
7
|
-
consequences: Move[];
|
|
8
|
-
};
|
|
9
|
-
export default Action;
|
|
10
|
-
export declare function playAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, move: Move, playerId: PlayerId, id?: string): Action<Move, PlayerId>;
|
|
11
|
-
export
|
|
12
|
-
action: Action<Move, PlayerId>;
|
|
13
|
-
views: ActionView<MoveView, PlayerId>[];
|
|
14
|
-
};
|
|
15
|
-
export
|
|
16
|
-
recipient?: PlayerId;
|
|
17
|
-
action: Action<MoveView, PlayerId>;
|
|
18
|
-
};
|
|
19
|
-
export declare function playActionWithViews<Game, View, Move, MoveView, PlayerId>(rules: Rules<Game, Move, PlayerId> & IncompleteInformation<View, Move, MoveView>, move: Move, playerId: PlayerId, recipients: PlayerId[], id?: string): ActionWithViews<Move, MoveView, PlayerId>;
|
|
20
|
-
export declare function replayAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, action: Action<Move, PlayerId>): void;
|
|
21
|
-
export declare function replayActions<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, actions: Action<Move, PlayerId>[]): void;
|
|
22
|
-
export
|
|
23
|
-
secrets: ActionView<MoveView, PlayerId>[];
|
|
24
|
-
};
|
|
25
|
-
export declare function isSecretAction(action: Action): action is SecretAction;
|
|
1
|
+
import { IncompleteInformation } from './index';
|
|
2
|
+
import Rules from './Rules';
|
|
3
|
+
type Action<Move = any, PlayerId = any> = {
|
|
4
|
+
id?: string;
|
|
5
|
+
playerId: PlayerId;
|
|
6
|
+
move: Move;
|
|
7
|
+
consequences: Move[];
|
|
8
|
+
};
|
|
9
|
+
export default Action;
|
|
10
|
+
export declare function playAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, move: Move, playerId: PlayerId, id?: string): Action<Move, PlayerId>;
|
|
11
|
+
export type ActionWithViews<Move = any, MoveView = Move, PlayerId = any> = {
|
|
12
|
+
action: Action<Move, PlayerId>;
|
|
13
|
+
views: ActionView<MoveView, PlayerId>[];
|
|
14
|
+
};
|
|
15
|
+
export type ActionView<MoveView = any, PlayerId = any> = {
|
|
16
|
+
recipient?: PlayerId;
|
|
17
|
+
action: Action<MoveView, PlayerId>;
|
|
18
|
+
};
|
|
19
|
+
export declare function playActionWithViews<Game, View, Move, MoveView, PlayerId>(rules: Rules<Game, Move, PlayerId> & IncompleteInformation<View, Move, MoveView>, move: Move, playerId: PlayerId, recipients: PlayerId[], id?: string): ActionWithViews<Move, MoveView, PlayerId>;
|
|
20
|
+
export declare function replayAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, action: Action<Move, PlayerId>): void;
|
|
21
|
+
export declare function replayActions<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, actions: Action<Move, PlayerId>[]): void;
|
|
22
|
+
export type SecretAction<Move = any, MoveView = Move, PlayerId = any> = Action<Move, PlayerId> & {
|
|
23
|
+
secrets: ActionView<MoveView, PlayerId>[];
|
|
24
|
+
};
|
|
25
|
+
export declare function isSecretAction(action: Action): action is SecretAction;
|
package/dist/Action.js
CHANGED
|
@@ -1,56 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
views: []
|
|
24
|
-
}
|
|
25
|
-
// Prepare action view for
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
exports.replayAction = replayAction;
|
|
48
|
-
function replayActions(rules, actions) {
|
|
49
|
-
actions.forEach(function (action) { return replayAction(rules, action); });
|
|
50
|
-
}
|
|
51
|
-
exports.replayActions = replayActions;
|
|
52
|
-
function isSecretAction(action) {
|
|
53
|
-
return Array.isArray(action.secrets);
|
|
54
|
-
}
|
|
55
|
-
exports.isSecretAction = isSecretAction;
|
|
1
|
+
import { getMoveView } from './index';
|
|
2
|
+
import { hasRandomMove } from './RandomMove';
|
|
3
|
+
import { applyAutomaticMoves } from './ApplyAutomaticMoves';
|
|
4
|
+
export function playAction(rules, move, playerId, id) {
|
|
5
|
+
if (hasRandomMove(rules)) {
|
|
6
|
+
move = rules.randomize(move);
|
|
7
|
+
}
|
|
8
|
+
const action = { id, playerId, move, consequences: [] };
|
|
9
|
+
const consequences = rules.play(JSON.parse(JSON.stringify(move)));
|
|
10
|
+
applyAutomaticMoves(rules, consequences, move => action.consequences.push(move));
|
|
11
|
+
return action;
|
|
12
|
+
}
|
|
13
|
+
export function playActionWithViews(rules, move, playerId, recipients, id) {
|
|
14
|
+
if (hasRandomMove(rules)) {
|
|
15
|
+
move = rules.randomize(move);
|
|
16
|
+
}
|
|
17
|
+
const actionWithView = {
|
|
18
|
+
action: { id, playerId, move, consequences: [] },
|
|
19
|
+
views: []
|
|
20
|
+
};
|
|
21
|
+
// Prepare action view for each player
|
|
22
|
+
for (const recipient of recipients) {
|
|
23
|
+
actionWithView.views.push({ recipient, action: { id, playerId, move: getMoveView(rules, move, recipient), consequences: [] } });
|
|
24
|
+
}
|
|
25
|
+
// Prepare action view for spectators
|
|
26
|
+
actionWithView.views.push({ action: { id, playerId, move: getMoveView(rules, move), consequences: [] } });
|
|
27
|
+
const consequences = rules.play(JSON.parse(JSON.stringify(move)));
|
|
28
|
+
applyAutomaticMoves(rules, consequences, move => {
|
|
29
|
+
actionWithView.action.consequences.push(move);
|
|
30
|
+
for (const view of actionWithView.views) {
|
|
31
|
+
view.action.consequences.push(getMoveView(rules, move, view.recipient));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return actionWithView;
|
|
35
|
+
}
|
|
36
|
+
export function replayAction(rules, action) {
|
|
37
|
+
rules.play(JSON.parse(JSON.stringify(action.move)));
|
|
38
|
+
action.consequences.forEach(move => rules.play(JSON.parse(JSON.stringify(move))));
|
|
39
|
+
}
|
|
40
|
+
export function replayActions(rules, actions) {
|
|
41
|
+
actions.forEach(action => replayAction(rules, action));
|
|
42
|
+
}
|
|
43
|
+
export function isSecretAction(action) {
|
|
44
|
+
return Array.isArray(action.secrets);
|
|
45
|
+
}
|
|
56
46
|
//# sourceMappingURL=Action.js.map
|
package/dist/Action.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../src/Action.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../src/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAwB,MAAM,SAAS,CAAA;AAC1D,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAA;AAE1C,OAAO,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAA;AAWzD,MAAM,UAAU,UAAU,CAAuB,KAAkC,EAAE,IAAU,EAAE,QAAkB,EAAE,EAAW;IAC9H,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED,MAAM,MAAM,GAA2B,EAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC,CAAA;IAE7E,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAEjE,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;IAEhF,OAAO,MAAM,CAAA;AACf,CAAC;AAYD,MAAM,UAAU,mBAAmB,CACjC,KAAgF,EAAE,IAAU,EAAE,QAAkB,EAAE,UAAsB,EAAE,EAAW;IAGrJ,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED,MAAM,cAAc,GAA8C;QAChE,MAAM,EAAE,EAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC;QAC9C,KAAK,EAAE,EAAE;KACV,CAAA;IAED,sCAAsC;IACtC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAC,SAAS,EAAE,MAAM,EAAE,EAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,YAAY,EAAE,EAAE,EAAC,EAAC,CAAC,CAAA;IAC7H,CAAC;IACD,qCAAqC;IACrC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,EAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,YAAY,EAAE,EAAE,EAAC,EAAC,CAAC,CAAA;IAErG,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAEjE,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE;QAC9C,cAAc,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC7C,KAAK,MAAM,IAAI,IAAI,cAAc,CAAC,KAAK,EAAE,CAAC;YACxC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;QACzE,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,cAAc,CAAA;AACvB,CAAC;AAED,MAAM,UAAU,YAAY,CAAuB,KAAkC,EAAE,MAA8B;IACnH,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnD,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AACnF,CAAC;AAED,MAAM,UAAU,aAAa,CAAuB,KAAkC,EAAE,OAAiC;IACvH,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;AACxD,CAAC;AAMD,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAE,MAAuB,CAAC,OAAO,CAAC,CAAA;AACxD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import Rules from './Rules';
|
|
2
|
-
export declare function applyAutomaticMoves<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, moves?: Move[], preprocessMove?: (move: Move) => void): void;
|
|
1
|
+
import Rules from './Rules';
|
|
2
|
+
export declare function applyAutomaticMoves<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, moves?: Move[], preprocessMove?: (move: Move) => void): void;
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var consequences = (_a = rules.play(JSON.parse(JSON.stringify(randomizedMove)))) !== null && _a !== void 0 ? _a : [];
|
|
20
|
-
moves.unshift.apply(moves, consequences);
|
|
21
|
-
return true;
|
|
22
|
-
}, { errorFn: function () { return new Error("Infinite loop detected while applying move consequences: ".concat(JSON.stringify(rules.getAutomaticMoves()), ")")); } });
|
|
23
|
-
}
|
|
24
|
-
exports.applyAutomaticMoves = applyAutomaticMoves;
|
|
1
|
+
import { hasRandomMove } from './RandomMove';
|
|
2
|
+
import { loopWithFuse } from './LoopWithFuse';
|
|
3
|
+
export function applyAutomaticMoves(rules, moves = [], preprocessMove) {
|
|
4
|
+
loopWithFuse(() => {
|
|
5
|
+
if (moves.length === 0 && rules.getAutomaticMoves) {
|
|
6
|
+
moves.push(...rules.getAutomaticMoves());
|
|
7
|
+
}
|
|
8
|
+
const move = moves.shift();
|
|
9
|
+
if (!move)
|
|
10
|
+
return false;
|
|
11
|
+
const randomizedMove = hasRandomMove(rules) ? rules.randomize(move) : move;
|
|
12
|
+
if (preprocessMove)
|
|
13
|
+
preprocessMove(randomizedMove);
|
|
14
|
+
const consequences = rules.play(JSON.parse(JSON.stringify(randomizedMove))) ?? [];
|
|
15
|
+
moves.unshift(...consequences);
|
|
16
|
+
return true;
|
|
17
|
+
}, { errorFn: () => new Error(`Infinite loop detected while applying move consequences: ${JSON.stringify(rules.getAutomaticMoves())})`) });
|
|
18
|
+
}
|
|
25
19
|
//# sourceMappingURL=ApplyAutomaticMoves.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplyAutomaticMoves.js","sourceRoot":"","sources":["../src/ApplyAutomaticMoves.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApplyAutomaticMoves.js","sourceRoot":"","sources":["../src/ApplyAutomaticMoves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAA;AAG3C,MAAM,UAAU,mBAAmB,CAAuB,KAAkC,EAAE,QAAgB,EAAE,EAAE,cAAqC;IACrJ,YAAY,CAAC,GAAG,EAAE;QAChB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAClD,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAA;QAC1C,CAAC;QACD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;QAC1B,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QACvB,MAAM,cAAc,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAC1E,IAAI,cAAc;YAAE,cAAc,CAAC,cAAc,CAAC,CAAA;QAClD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QACjF,KAAK,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC,EAAE,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,4DAA4D,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,iBAAkB,EAAE,CAAC,GAAG,CAAC,EAAC,CAAC,CAAA;AAC3I,CAAC"}
|
package/dist/Competitive.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Rules from './Rules';
|
|
2
|
-
export default interface Competitive<Game, Move = string, PlayerId = number> extends Rules<Game, Move, PlayerId> {
|
|
3
|
-
rankPlayers(playerA: PlayerId, playerB: PlayerId): number;
|
|
4
|
-
getScore?(playerId: PlayerId): number;
|
|
5
|
-
}
|
|
6
|
-
export declare function isCompetitive<Game, Move, PlayerId>(rules: Rules<any, any, PlayerId>): rules is Competitive<Game, Move, PlayerId>;
|
|
1
|
+
import Rules from './Rules';
|
|
2
|
+
export default interface Competitive<Game, Move = string, PlayerId = number> extends Rules<Game, Move, PlayerId> {
|
|
3
|
+
rankPlayers(playerA: PlayerId, playerB: PlayerId): number;
|
|
4
|
+
getScore?(playerId: PlayerId): number;
|
|
5
|
+
}
|
|
6
|
+
export declare function isCompetitive<Game, Move, PlayerId>(rules: Rules<any, any, PlayerId>): rules is Competitive<Game, Move, PlayerId>;
|
package/dist/Competitive.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function isCompetitive(rules) {
|
|
5
|
-
return rules.rankPlayers !== undefined;
|
|
6
|
-
}
|
|
7
|
-
exports.isCompetitive = isCompetitive;
|
|
1
|
+
export function isCompetitive(rules) {
|
|
2
|
+
return rules.rankPlayers !== undefined;
|
|
3
|
+
}
|
|
8
4
|
//# sourceMappingURL=Competitive.js.map
|
package/dist/Competitive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Competitive.js","sourceRoot":"","sources":["../src/Competitive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Competitive.js","sourceRoot":"","sources":["../src/Competitive.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,aAAa,CAAuB,KAAgC;IAClF,OAAQ,KAA2C,CAAC,WAAW,KAAK,SAAS,CAAA;AAC/E,CAAC"}
|
package/dist/Dummy.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import RulesCreator from './RulesCreator';
|
|
2
|
-
export default class Dummy<Game, Move = string, PlayerId = number> {
|
|
3
|
-
Rules: RulesCreator<Game, Move, PlayerId>;
|
|
4
|
-
constructor(Rules: RulesCreator<Game, Move, PlayerId>);
|
|
5
|
-
getRandomMove(state: Game, playerId: PlayerId): Promise<Move[]>;
|
|
6
|
-
getLegalMoves(state: Game, playerId: PlayerId): Move[];
|
|
7
|
-
}
|
|
1
|
+
import RulesCreator from './RulesCreator';
|
|
2
|
+
export default class Dummy<Game, Move = string, PlayerId = number> {
|
|
3
|
+
Rules: RulesCreator<Game, Move, PlayerId>;
|
|
4
|
+
constructor(Rules: RulesCreator<Game, Move, PlayerId>);
|
|
5
|
+
getRandomMove(state: Game, playerId: PlayerId): Promise<Move[]>;
|
|
6
|
+
getLegalMoves(state: Game, playerId: PlayerId): Move[];
|
|
7
|
+
}
|
package/dist/Dummy.js
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return Dummy;
|
|
24
|
-
}());
|
|
25
|
-
exports.default = Dummy;
|
|
1
|
+
export default class Dummy {
|
|
2
|
+
Rules;
|
|
3
|
+
constructor(Rules) {
|
|
4
|
+
this.Rules = Rules;
|
|
5
|
+
}
|
|
6
|
+
getRandomMove(state, playerId) {
|
|
7
|
+
let moves = this.getLegalMoves(state, playerId);
|
|
8
|
+
if (!moves.length)
|
|
9
|
+
return Promise.resolve([]);
|
|
10
|
+
return Promise.resolve([moves[Math.floor(Math.random() * moves.length)]]);
|
|
11
|
+
}
|
|
12
|
+
getLegalMoves(state, playerId) {
|
|
13
|
+
const rules = new this.Rules(state);
|
|
14
|
+
if (rules.getLegalMoves) {
|
|
15
|
+
return rules.getLegalMoves(playerId);
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
console.error('Dummy player cannot work if getLegalMoves is not implemented!');
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
26
23
|
//# sourceMappingURL=Dummy.js.map
|
package/dist/Dummy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dummy.js","sourceRoot":"","sources":["../src/Dummy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dummy.js","sourceRoot":"","sources":["../src/Dummy.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAO,KAAK;IAExB,KAAK,CAAoC;IAEzC,YAAY,KAAyC;QACnD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IAED,aAAa,CAAC,KAAW,EAAE,QAAkB;QAC3C,IAAI,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;QAC/C,IAAI,CAAC,KAAK,CAAC,MAAM;YAAE,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC7C,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IAC3E,CAAC;IAED,aAAa,CAAC,KAAW,EAAE,QAAkB;QAC3C,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACnC,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;QACtC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAA;YAC9E,OAAO,EAAE,CAAA;QACX,CAAC;IACH,CAAC;CACF"}
|
package/dist/Eliminations.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default interface Eliminations<Move = string, PlayerId = number> {
|
|
2
|
-
isEliminated(playerId: PlayerId): boolean;
|
|
3
|
-
giveUpMove?(playerId: PlayerId): Move | undefined;
|
|
4
|
-
}
|
|
5
|
-
export declare function hasEliminations<Move, PlayerId>(rules: Object): rules is Eliminations<Move, PlayerId>;
|
|
1
|
+
export default interface Eliminations<Move = string, PlayerId = number> {
|
|
2
|
+
isEliminated(playerId: PlayerId): boolean;
|
|
3
|
+
giveUpMove?(playerId: PlayerId): Move | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare function hasEliminations<Move, PlayerId>(rules: Object): rules is Eliminations<Move, PlayerId>;
|
package/dist/Eliminations.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var test = rules;
|
|
6
|
-
return typeof test.isEliminated === 'function';
|
|
7
|
-
}
|
|
8
|
-
exports.hasEliminations = hasEliminations;
|
|
1
|
+
export function hasEliminations(rules) {
|
|
2
|
+
const test = rules;
|
|
3
|
+
return typeof test.isEliminated === 'function';
|
|
4
|
+
}
|
|
9
5
|
//# sourceMappingURL=Eliminations.js.map
|
package/dist/Eliminations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Eliminations.js","sourceRoot":"","sources":["../src/Eliminations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Eliminations.js","sourceRoot":"","sources":["../src/Eliminations.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,eAAe,CAAiB,KAAa;IAC3D,MAAM,IAAI,GAAG,KAAqC,CAAA;IAClD,OAAO,OAAO,IAAI,CAAC,YAAY,KAAK,UAAU,CAAA;AAChD,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import Rules from './Rules';
|
|
2
|
-
export default interface IncompleteInformation<GameView = any, Move = any, MoveView = any> {
|
|
3
|
-
getView(): GameView;
|
|
4
|
-
getMoveView(move: Move): MoveView;
|
|
5
|
-
}
|
|
6
|
-
export declare function hasIncompleteInformation<GameView = any, Move = any, MoveView = any>(rules: Object): rules is IncompleteInformation<GameView, Move, MoveView>;
|
|
7
|
-
export interface SecretInformation<GameView = any, Move = any, MoveView = any, PlayerId = any> extends IncompleteInformation<GameView, Move, MoveView> {
|
|
8
|
-
getPlayerView(playerId: PlayerId): GameView;
|
|
9
|
-
getPlayerMoveView?(move: Move, playerId: PlayerId): MoveView;
|
|
10
|
-
keepMoveSecret?(move: Move, playerId: PlayerId): boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function hasSecretInformation<GameView = any, Move = any, MoveView = any, PlayerId = any>(rules: Object): rules is SecretInformation<GameView, Move, MoveView, PlayerId>;
|
|
13
|
-
export declare function getGameView<Game, GameView, PlayerId>(rules: Rules<Game, any, PlayerId>, playerId?: PlayerId): GameView;
|
|
14
|
-
export declare function getMoveView<GameView, Move, MoveView, PlayerId>(rules: Rules<any, Move, PlayerId>, move: Move, playerId?: PlayerId): MoveView;
|
|
1
|
+
import Rules from './Rules';
|
|
2
|
+
export default interface IncompleteInformation<GameView = any, Move = any, MoveView = any> {
|
|
3
|
+
getView(): GameView;
|
|
4
|
+
getMoveView(move: Move): MoveView;
|
|
5
|
+
}
|
|
6
|
+
export declare function hasIncompleteInformation<GameView = any, Move = any, MoveView = any>(rules: Object): rules is IncompleteInformation<GameView, Move, MoveView>;
|
|
7
|
+
export interface SecretInformation<GameView = any, Move = any, MoveView = any, PlayerId = any> extends IncompleteInformation<GameView, Move, MoveView> {
|
|
8
|
+
getPlayerView(playerId: PlayerId): GameView;
|
|
9
|
+
getPlayerMoveView?(move: Move, playerId: PlayerId): MoveView;
|
|
10
|
+
keepMoveSecret?(move: Move, playerId: PlayerId): boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function hasSecretInformation<GameView = any, Move = any, MoveView = any, PlayerId = any>(rules: Object): rules is SecretInformation<GameView, Move, MoveView, PlayerId>;
|
|
13
|
+
export declare function getGameView<Game, GameView, PlayerId>(rules: Rules<Game, any, PlayerId>, playerId?: PlayerId): GameView;
|
|
14
|
+
export declare function getMoveView<GameView, Move, MoveView, PlayerId>(rules: Rules<any, Move, PlayerId>, move: Move, playerId?: PlayerId): MoveView;
|
|
@@ -1,38 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return rules.
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return JSON.parse(JSON.stringify(rules.getMoveView(move)));
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return move;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.getMoveView = getMoveView;
|
|
1
|
+
export function hasIncompleteInformation(rules) {
|
|
2
|
+
const test = rules;
|
|
3
|
+
return typeof test.getView === 'function' && typeof test.getMoveView === 'function';
|
|
4
|
+
}
|
|
5
|
+
export function hasSecretInformation(rules) {
|
|
6
|
+
const test = rules;
|
|
7
|
+
return typeof test.getPlayerView === 'function';
|
|
8
|
+
}
|
|
9
|
+
export function getGameView(rules, playerId) {
|
|
10
|
+
if (hasSecretInformation(rules) && playerId !== undefined) {
|
|
11
|
+
return rules.getPlayerView(playerId);
|
|
12
|
+
}
|
|
13
|
+
else if (hasIncompleteInformation(rules)) {
|
|
14
|
+
return rules.getView();
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return rules.game;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function getMoveView(rules, move, playerId) {
|
|
21
|
+
if (hasSecretInformation(rules) && rules.getPlayerMoveView && playerId !== undefined) {
|
|
22
|
+
return JSON.parse(JSON.stringify(rules.getPlayerMoveView(move, playerId)));
|
|
23
|
+
}
|
|
24
|
+
else if (hasIncompleteInformation(rules)) {
|
|
25
|
+
return JSON.parse(JSON.stringify(rules.getMoveView(move)));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return move;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
38
31
|
//# sourceMappingURL=IncompleteInformation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncompleteInformation.js","sourceRoot":"","sources":["../src/IncompleteInformation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IncompleteInformation.js","sourceRoot":"","sources":["../src/IncompleteInformation.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,wBAAwB,CAA6C,KAAa;IAChG,MAAM,IAAI,GAAG,KAAwD,CAAA;IACrE,OAAO,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,UAAU,CAAA;AACrF,CAAC;AAUD,MAAM,UAAU,oBAAoB,CAA6D,KAAa;IAC5G,MAAM,IAAI,GAAG,KAA8D,CAAA;IAC3E,OAAO,OAAO,IAAI,CAAC,aAAa,KAAK,UAAU,CAAA;AACjD,CAAC;AAED,MAAM,UAAU,WAAW,CAA2B,KAAiC,EAAE,QAAmB;IAC1G,IAAI,oBAAoB,CAA+B,KAAK,CAAC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACxF,OAAO,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;IACtC,CAAC;SAAM,IAAI,wBAAwB,CAAW,KAAK,CAAC,EAAE,CAAC;QACrD,OAAO,KAAK,CAAC,OAAO,EAAE,CAAA;IACxB,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAC,IAAuB,CAAA;IACtC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAqC,KAAiC,EAAE,IAAU,EAAE,QAAmB;IAChI,IAAI,oBAAoB,CAAqC,KAAK,CAAC,IAAI,KAAK,CAAC,iBAAiB,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACzH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC5E,CAAC;SAAM,IAAI,wBAAwB,CAA2B,KAAK,CAAC,EAAE,CAAC;QACrE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC5D,CAAC;SAAM,CAAC;QACN,OAAO,IAAuB,CAAA;IAChC,CAAC;AACH,CAAC"}
|
package/dist/LoopWithFuse.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function loopWithFuse(repeat: () => boolean, options?: {
|
|
2
|
-
attempts?: number;
|
|
3
|
-
errorFn?: () => Error;
|
|
4
|
-
}): void;
|
|
1
|
+
export declare function loopWithFuse(repeat: () => boolean, options?: {
|
|
2
|
+
attempts?: number;
|
|
3
|
+
errorFn?: () => Error;
|
|
4
|
+
}): void;
|
package/dist/LoopWithFuse.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
attempts--;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.loopWithFuse = loopWithFuse;
|
|
1
|
+
export function loopWithFuse(repeat, options) {
|
|
2
|
+
let attempts = options?.attempts || (process.env.NODE_ENV === 'development' ? 100 : 1000);
|
|
3
|
+
const errorFn = options?.errorFn || (() => new Error('Infinite loop detected'));
|
|
4
|
+
while (repeat()) {
|
|
5
|
+
if (attempts == 0) {
|
|
6
|
+
throw errorFn();
|
|
7
|
+
}
|
|
8
|
+
attempts--;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
15
11
|
//# sourceMappingURL=LoopWithFuse.js.map
|
package/dist/LoopWithFuse.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoopWithFuse.js","sourceRoot":"","sources":["../src/LoopWithFuse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LoopWithFuse.js","sourceRoot":"","sources":["../src/LoopWithFuse.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,MAAqB,EAAE,OAAsD;IACxG,IAAI,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACzF,MAAM,OAAO,GAAG,OAAO,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAA;IAC/E,OAAO,MAAM,EAAE,EAAE,CAAC;QAChB,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;YAClB,MAAM,OAAO,EAAE,CAAA;QACjB,CAAC;QACD,QAAQ,EAAE,CAAA;IACZ,CAAC;AACH,CAAC"}
|
package/dist/RandomMove.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Rules from './Rules';
|
|
2
|
-
export default interface RandomMove<Move = string, RandomizedMove = string> {
|
|
3
|
-
randomize(move: Move): Move & RandomizedMove;
|
|
4
|
-
play(move: Move & RandomizedMove): Move[];
|
|
5
|
-
}
|
|
6
|
-
export declare function hasRandomMove<Game, Move, RandomizedMove>(rules: Rules<Game, Move>): rules is Rules<Game, Move> & RandomMove<Move, RandomizedMove>;
|
|
7
|
-
export declare function randomizeMoves<Game, Move, RandomizedMove = Move>(rules: Rules<Game, Move>, moves: Move[]): (Move & RandomizedMove)[];
|
|
1
|
+
import Rules from './Rules';
|
|
2
|
+
export default interface RandomMove<Move = string, RandomizedMove = string> {
|
|
3
|
+
randomize(move: Move): Move & RandomizedMove;
|
|
4
|
+
play(move: Move & RandomizedMove): Move[];
|
|
5
|
+
}
|
|
6
|
+
export declare function hasRandomMove<Game, Move, RandomizedMove>(rules: Rules<Game, Move>): rules is Rules<Game, Move> & RandomMove<Move, RandomizedMove>;
|
|
7
|
+
export declare function randomizeMoves<Game, Move, RandomizedMove = Move>(rules: Rules<Game, Move>, moves: Move[]): (Move & RandomizedMove)[];
|
package/dist/RandomMove.js
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
}
|
|
8
|
-
exports.hasRandomMove = hasRandomMove;
|
|
9
|
-
function randomizeMoves(rules, moves) {
|
|
10
|
-
return hasRandomMove(rules) ? moves.map(function (move) { return rules.randomize(move); }) : moves;
|
|
11
|
-
}
|
|
12
|
-
exports.randomizeMoves = randomizeMoves;
|
|
1
|
+
export function hasRandomMove(rules) {
|
|
2
|
+
const test = rules;
|
|
3
|
+
return typeof test.randomize === 'function';
|
|
4
|
+
}
|
|
5
|
+
export function randomizeMoves(rules, moves) {
|
|
6
|
+
return hasRandomMove(rules) ? moves.map(move => rules.randomize(move)) : moves;
|
|
7
|
+
}
|
|
13
8
|
//# sourceMappingURL=RandomMove.js.map
|
package/dist/RandomMove.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RandomMove.js","sourceRoot":"","sources":["../src/RandomMove.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RandomMove.js","sourceRoot":"","sources":["../src/RandomMove.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,aAAa,CAA6B,KAAwB;IAChF,MAAM,IAAI,GAAG,KAA6D,CAAA;IAC1E,OAAO,OAAO,IAAI,CAAC,SAAS,KAAK,UAAU,CAAA;AAC7C,CAAC;AAED,MAAM,UAAU,cAAc,CAAoC,KAAwB,EAAE,KAAa;IACvG,OAAO,aAAa,CAA6B,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAE,KAAmC,CAAA;AAC3I,CAAC"}
|
package/dist/Robot.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export default Robot;
|
|
1
|
+
type Robot<Game, Move = string, PlayerId = number> = (state: Game, playerId: PlayerId) => Promise<Move[]>;
|
|
2
|
+
export default Robot;
|
package/dist/Robot.js
CHANGED