@gamepark/rules-api 6.10.0 → 6.10.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/Action.d.ts +4 -4
- package/dist/Competitive.d.ts +1 -1
- package/dist/Robot.d.ts +1 -1
- package/dist/UnpredictableMove.d.ts +1 -1
- package/dist/material/HiddenMaterialRules.d.ts +2 -1
- package/dist/material/HiddenMaterialRules.js +3 -1
- package/dist/material/HiddenMaterialRules.js.map +1 -1
- package/dist/material/MaterialGame.d.ts +1 -1
- package/dist/material/SecretMaterialRules.d.ts +4 -3
- package/dist/material/SecretMaterialRules.js +3 -1
- package/dist/material/SecretMaterialRules.js.map +1 -1
- package/dist/material/items/Material.d.ts +1 -1
- package/dist/material/items/MaterialItem.d.ts +2 -2
- package/dist/material/location/Location.d.ts +2 -2
- package/dist/material/location/strategy/LocationStrategy.d.ts +1 -1
- package/dist/material/moves/CustomMove.d.ts +1 -1
- package/dist/material/moves/MaterialMove.d.ts +3 -3
- package/dist/material/moves/items/CreateItem.d.ts +1 -1
- package/dist/material/moves/items/DeleteItem.d.ts +1 -1
- package/dist/material/moves/items/ItemMove.d.ts +4 -4
- package/dist/material/moves/items/MoveItem.d.ts +2 -2
- package/dist/material/moves/items/Roll.d.ts +11 -0
- package/dist/material/moves/items/Roll.js +16 -0
- package/dist/material/moves/items/Roll.js.map +1 -0
- package/dist/material/moves/items/RollItem.d.ts +11 -0
- package/dist/material/moves/items/RollItem.js +16 -0
- package/dist/material/moves/items/RollItem.js.map +1 -0
- package/dist/material/moves/items/Shuffle.d.ts +2 -2
- package/dist/material/moves/local/CloseTutorialPopup.d.ts +1 -1
- package/dist/material/moves/local/DisplayRules.d.ts +6 -6
- package/dist/material/moves/local/DropItem.d.ts +2 -2
- package/dist/material/moves/local/LocalMove.d.ts +1 -1
- package/dist/material/moves/local/SetTutorialStep.d.ts +1 -1
- package/dist/material/moves/rules/EndGame.d.ts +1 -1
- package/dist/material/moves/rules/EndPlayerTurn.d.ts +1 -1
- package/dist/material/moves/rules/RuleMove.d.ts +2 -2
- package/dist/material/moves/rules/StartPlayerTurn.d.ts +1 -1
- package/dist/material/moves/rules/StartRule.d.ts +1 -1
- package/dist/material/moves/rules/StartSimultaneousRule.d.ts +1 -1
- package/dist/material/rules/MaterialRulesMovesBuilder.js +1 -1
- package/dist/material/rules/MaterialRulesMovesBuilder.js.map +1 -1
- package/dist/material/rules/RuleStep.d.ts +1 -1
- package/dist/options/EnumOption.d.ts +1 -1
- package/dist/options/Option.d.ts +1 -1
- package/dist/options/OptionSpecOf.d.ts +2 -2
- package/dist/options/OptionsSpec.d.ts +1 -1
- package/dist/options/PlayerEnumOption.d.ts +2 -2
- package/dist/options/PlayersOptionsSpec.d.ts +1 -1
- package/dist/options/WithIdOption.d.ts +1 -1
- package/dist/options/WithPlayerOptionsSpec.d.ts +1 -1
- package/dist/options/WithPlayersOptions.d.ts +1 -1
- package/dist/utils/grid.util.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/listing.util.d.ts +1 -0
- package/dist/utils/listing.util.js +15 -0
- package/dist/utils/listing.util.js.map +1 -0
- package/package.json +2 -2
package/dist/Action.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Rules } from './Rules';
|
|
2
2
|
import { IncompleteInformation } from './IncompleteInformation';
|
|
3
|
-
export
|
|
3
|
+
export type Action<Move = any, PlayerId = any> = {
|
|
4
4
|
id?: string;
|
|
5
5
|
playerId: PlayerId;
|
|
6
6
|
move: Move;
|
|
@@ -8,18 +8,18 @@ export declare type Action<Move = any, PlayerId = any> = {
|
|
|
8
8
|
};
|
|
9
9
|
export declare function playMove<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, move: Move): void;
|
|
10
10
|
export declare function playAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, move: Move, playerId: PlayerId): Action<Move, PlayerId>;
|
|
11
|
-
export
|
|
11
|
+
export type ActionWithViews<Move = any, MoveView = Move, PlayerId = any> = {
|
|
12
12
|
action: Action<Move, PlayerId>;
|
|
13
13
|
views: ActionView<MoveView, PlayerId>[];
|
|
14
14
|
};
|
|
15
|
-
export
|
|
15
|
+
export type ActionView<MoveView = any, PlayerId = any> = {
|
|
16
16
|
recipient?: PlayerId;
|
|
17
17
|
action: Action<MoveView, PlayerId>;
|
|
18
18
|
};
|
|
19
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
20
|
export declare function replayAction<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, action: Action<Move, PlayerId>): void;
|
|
21
21
|
export declare function replayActions<Game, Move, PlayerId>(rules: Rules<Game, Move, PlayerId>, actions: Action<Move, PlayerId>[]): void;
|
|
22
|
-
export
|
|
22
|
+
export type SecretAction<Move = any, MoveView = Move, PlayerId = any> = Action<Move, PlayerId> & {
|
|
23
23
|
secrets: ActionView<MoveView, PlayerId>[];
|
|
24
24
|
};
|
|
25
25
|
export declare function isSecretAction(action: Action): action is SecretAction;
|
package/dist/Competitive.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Rules } from './Rules';
|
|
2
|
-
export
|
|
2
|
+
export type Competitive<Game = any, Move = any, PlayerId = any> = CompetitiveScore<Game, Move, PlayerId> | CompetitiveRank<Game, Move, PlayerId>;
|
|
3
3
|
export interface CompetitiveScore<Game = any, Move = any, PlayerId = any> extends Rules<Game, Move, PlayerId> {
|
|
4
4
|
getScore(playerId: PlayerId): number;
|
|
5
5
|
getTieBreaker?(tieBreaker: number, playerId: PlayerId): number | undefined;
|
package/dist/Robot.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Robot<Game, Move = string, PlayerId = number> = (state: Game, playerId: PlayerId) => Promise<Move[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Rules } from './Rules';
|
|
2
|
-
export
|
|
2
|
+
export type RulesWithUnpredictableMoves<G = any, M = any, P = any> = Rules<G, M, P> & {
|
|
3
3
|
isUnpredictableMove(move: M): boolean;
|
|
4
4
|
};
|
|
5
5
|
export declare const hasUnpredictableMoves: <G = any, M = any, P = any>(rules: Rules<G, M, P>) => rules is RulesWithUnpredictableMoves<G, M, P>;
|
|
@@ -25,5 +25,6 @@ export declare abstract class HiddenMaterialRules<P extends number = number, M e
|
|
|
25
25
|
private canSeeShuffleResult;
|
|
26
26
|
play(move: MaterialMoveRandomized<P, M, L> | MaterialMoveView<P, M, L>): MaterialMove<P, M, L>[];
|
|
27
27
|
}
|
|
28
|
-
export
|
|
28
|
+
export type HidingStrategy<P extends number = number, L extends number = number> = (item: ItemPosition<P, L>) => string[];
|
|
29
29
|
export declare const hideItemId: HidingStrategy;
|
|
30
|
+
export declare const hideFront: HidingStrategy;
|
|
@@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
40
40
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
41
|
};
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.hideItemId = exports.HiddenMaterialRules = void 0;
|
|
43
|
+
exports.hideFront = exports.hideItemId = exports.HiddenMaterialRules = void 0;
|
|
44
44
|
var fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
45
45
|
var difference_1 = __importDefault(require("lodash/difference"));
|
|
46
46
|
var get_1 = __importDefault(require("lodash/get"));
|
|
@@ -180,4 +180,6 @@ var HiddenMaterialRules = (function (_super) {
|
|
|
180
180
|
exports.HiddenMaterialRules = HiddenMaterialRules;
|
|
181
181
|
var hideItemId = function () { return ['id']; };
|
|
182
182
|
exports.hideItemId = hideItemId;
|
|
183
|
+
var hideFront = function () { return ['id.front']; };
|
|
184
|
+
exports.hideFront = hideFront;
|
|
183
185
|
//# sourceMappingURL=HiddenMaterialRules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenMaterialRules.js","sourceRoot":"","sources":["../../src/material/HiddenMaterialRules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAmC;AACnC,iEAA0C;AAC1C,mDAA4B;AAC5B,+DAAwC;AACxC,mDAA4B;AAC5B,uDAAgC;AAEhC,iCAA8D;AAE9D,iDAA+C;AAC/C,iCAWgB;AAGhB;IACU,uCAAsB;IAG9B,6BAAY,IAA2B,EAAmB,MAAuB;QAAjF,YACE,kBAAM,IAAI,CAAC,SACZ;QAFyD,YAAM,GAAN,MAAM,CAAiB;;IAEjF,CAAC;IAIQ,sCAAQ,GAAjB,UAAkB,IAAO;QAAzB,iBAQC;;QAPC,OAAO,IAAI,gBAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,MAAA,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,CAAC,EAAvB,CAAuB,CAAC,EACpH,UAAA,IAAI;YACF,IAAI,IAAA,kBAAU,EAAC,IAAI,CAAC,IAAI,KAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAA,MAAM,IAAI,OAAA,KAAI,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,CAAC,EAA9C,CAA8C,CAAC,EAAE;gBACxG,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;aACjB;QACH,CAAC,CACF,CAAA;IACH,CAAC;IAED,2CAAa,GAAb,UAAc,IAAO;QACnB,OAAO,CAAC,IAAI,CAAC,gBA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CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;YACjE,IAAI,IAAI,EAAE;gBACR,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;aACzG;SACF;QACD,OAAO,MAAM,CAAA;IACf,CAAC;IACH,0BAAC;AAAD,CAAC,AAzID,CACU,6BAAa,GAwItB;AAzIqB,kDAAmB;AA6IlC,IAAM,UAAU,GAAmB,cAAM,OAAA,CAAC,IAAI,CAAC,EAAN,CAAM,CAAA;AAAzC,QAAA,UAAU,cAA+B;AAC/C,IAAM,SAAS,GAAmB,cAAM,OAAA,CAAC,UAAU,CAAC,EAAZ,CAAY,CAAA;AAA9C,QAAA,SAAS,aAAqC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaterialItem } from './items';
|
|
2
2
|
import { RuleStep } from './rules';
|
|
3
3
|
import { DisplayedItem, RulesDisplay } from './moves';
|
|
4
|
-
export
|
|
4
|
+
export type MaterialGame<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = {
|
|
5
5
|
players: Player[];
|
|
6
6
|
items: Partial<Record<MaterialType, MaterialItem<Player, LocationType>[]>>;
|
|
7
7
|
rule?: RuleStep<Player>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { SecretInformation } from '../IncompleteInformation';
|
|
2
|
-
import { HiddenMaterialRules } from './HiddenMaterialRules';
|
|
2
|
+
import { HiddenMaterialRules, HidingStrategy } from './HiddenMaterialRules';
|
|
3
|
+
import { MaterialItem } from './items';
|
|
3
4
|
import { MaterialGame } from './MaterialGame';
|
|
4
5
|
import { MaterialMove, MaterialMoveRandomized } from './moves';
|
|
5
|
-
import { MaterialItem } from './items';
|
|
6
6
|
export declare abstract class SecretMaterialRules<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> extends HiddenMaterialRules<Player, MaterialType, LocationType> implements SecretInformation<MaterialGame, MaterialMove<Player, MaterialType, LocationType>, MaterialMove<Player, MaterialType, LocationType>, Player> {
|
|
7
7
|
abstract hidingStrategies: Partial<Record<MaterialType, Partial<Record<LocationType, HidingSecretsStrategy<Player, LocationType>>>>>;
|
|
8
8
|
getPlayerView(player: Player): MaterialGame<Player, MaterialType, LocationType>;
|
|
9
9
|
getPlayerMoveView(move: MaterialMoveRandomized<Player, MaterialType, LocationType>, player: Player): MaterialMove<Player, MaterialType, LocationType>;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type HidingSecretsStrategy<P extends number = number, L extends number = number> = (item: MaterialItem<P, L>, player?: P) => string[];
|
|
12
12
|
export declare const hideItemIdToOthers: <P extends number = number, L extends number = number>(item: MaterialItem<P, L, any>, player?: P | undefined) => string[];
|
|
13
|
+
export declare const hideFrontToOthers: HidingStrategy;
|
|
@@ -15,7 +15,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.hideItemIdToOthers = exports.SecretMaterialRules = void 0;
|
|
18
|
+
exports.hideFrontToOthers = exports.hideItemIdToOthers = exports.SecretMaterialRules = void 0;
|
|
19
19
|
var HiddenMaterialRules_1 = require("./HiddenMaterialRules");
|
|
20
20
|
var SecretMaterialRules = (function (_super) {
|
|
21
21
|
__extends(SecretMaterialRules, _super);
|
|
@@ -33,4 +33,6 @@ var SecretMaterialRules = (function (_super) {
|
|
|
33
33
|
exports.SecretMaterialRules = SecretMaterialRules;
|
|
34
34
|
var hideItemIdToOthers = function (item, player) { return item.location.player === player ? [] : ['id']; };
|
|
35
35
|
exports.hideItemIdToOthers = hideItemIdToOthers;
|
|
36
|
+
var hideFrontToOthers = function (item, player) { return item.location.player === player ? [] : ['id.front']; };
|
|
37
|
+
exports.hideFrontToOthers = hideFrontToOthers;
|
|
36
38
|
//# sourceMappingURL=SecretMaterialRules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecretMaterialRules.js","sourceRoot":"","sources":["../../src/material/SecretMaterialRules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"SecretMaterialRules.js","sourceRoot":"","sources":["../../src/material/SecretMaterialRules.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,6DAA2E;AAK3E;IACU,uCAAuD;IADjE;;IAaA,CAAC;IAPC,2CAAa,GAAb,UAAc,MAAc;QAC1B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IAED,+CAAiB,GAAjB,UAAkB,IAAgE,EAAE,MAAc;QAChG,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACvC,CAAC;IACH,0BAAC;AAAD,CAAC,AAbD,CACU,yCAAmB,GAY5B;AAbqB,kDAAmB;AAiBlC,IAAM,kBAAkB,GAAG,UAChC,IAAwB,EAAE,MAAU,IACvB,OAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAA7C,CAA6C,CAAA;AAF/C,QAAA,kBAAkB,sBAE6B;AAErD,IAAM,iBAAiB,GAAmB,UAC/C,IAAwB,EAAE,MAAU,IACvB,OAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,EAAnD,CAAmD,CAAA;AAFrD,QAAA,iBAAiB,qBAEoC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Coordinates, Location } from '../location';
|
|
2
2
|
import { CreateItem, DeleteItem, ItemMove, MoveItem, Shuffle } from '../moves';
|
|
3
3
|
import { ItemPosition, MaterialItem } from './MaterialItem';
|
|
4
|
-
|
|
4
|
+
type ItemEntry<P extends number = number, L extends number = number> = [number, MaterialItem<P, L>];
|
|
5
5
|
export declare class Material<P extends number = number, M extends number = number, L extends number = number> {
|
|
6
6
|
readonly type: M;
|
|
7
7
|
readonly entries: ItemEntry<P, L>[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Coordinates, Location } from '../location';
|
|
2
|
-
export
|
|
2
|
+
export type MaterialItem<P extends number = number, L extends number = number, Id = any> = {
|
|
3
3
|
id?: Id;
|
|
4
4
|
quantity?: number;
|
|
5
5
|
} & ItemPosition<P, L>;
|
|
6
|
-
export
|
|
6
|
+
export type ItemPosition<P extends number = number, L extends number = number> = {
|
|
7
7
|
location: Location<P, L>;
|
|
8
8
|
rotation?: Partial<Coordinates>;
|
|
9
9
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { XYCoordinates } from '../../utils';
|
|
2
|
-
export
|
|
2
|
+
export type Location<Player = number, LocationType = number, Id = any> = {
|
|
3
3
|
type: LocationType;
|
|
4
4
|
id?: Id;
|
|
5
5
|
player?: Player;
|
|
6
6
|
parent?: number;
|
|
7
7
|
} & Partial<Coordinates>;
|
|
8
|
-
export
|
|
8
|
+
export type Coordinates = XYCoordinates & {
|
|
9
9
|
z: number;
|
|
10
10
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Material, MaterialItem } from '../../items';
|
|
2
|
-
export
|
|
2
|
+
export type LocationStrategy<P extends number = number, M extends number = number, L extends number = number> = {
|
|
3
3
|
addItem?(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
4
4
|
removeItem?(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MoveKind } from './MoveKind';
|
|
2
2
|
import { MaterialMove } from './MaterialMove';
|
|
3
|
-
export
|
|
3
|
+
export type CustomMove<Type extends number = number> = {
|
|
4
4
|
kind: typeof MoveKind.CustomMove;
|
|
5
5
|
type: Type;
|
|
6
6
|
data?: any;
|
|
@@ -2,6 +2,6 @@ import { RuleMove } from './rules';
|
|
|
2
2
|
import { CustomMove } from './CustomMove';
|
|
3
3
|
import { ItemMove, ItemMoveRandomized, ItemMoveView } from './items';
|
|
4
4
|
import { LocalMove } from './local';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
5
|
+
export type MaterialMove<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = ItemMove<Player, MaterialType, LocationType> | RuleMove<Player> | CustomMove | LocalMove<Player, MaterialType, LocationType>;
|
|
6
|
+
export type MaterialMoveRandomized<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = ItemMoveRandomized<Player, MaterialType, LocationType> | RuleMove<Player> | CustomMove | LocalMove<Player, MaterialType, LocationType>;
|
|
7
|
+
export type MaterialMoveView<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = ItemMoveView<Player, MaterialType, LocationType> | RuleMove<Player> | CustomMove | LocalMove<Player, MaterialType, LocationType>;
|
|
@@ -2,7 +2,7 @@ import { MaterialItem } from '../../items';
|
|
|
2
2
|
import { ItemMoveType } from './ItemMoveType';
|
|
3
3
|
import { MaterialMoveCommon } from './ItemMove';
|
|
4
4
|
import { MaterialMove } from '../MaterialMove';
|
|
5
|
-
export
|
|
5
|
+
export type CreateItem<P extends number = number, M extends number = number, L extends number = number> = MaterialMoveCommon<M> & {
|
|
6
6
|
type: typeof ItemMoveType.Create;
|
|
7
7
|
item: MaterialItem<P, L>;
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ItemMoveType } from './ItemMoveType';
|
|
2
2
|
import { MaterialMoveCommon } from './ItemMove';
|
|
3
3
|
import { MaterialMove } from '../MaterialMove';
|
|
4
|
-
export
|
|
4
|
+
export type DeleteItem<MaterialType extends number = number> = MaterialMoveCommon<MaterialType> & {
|
|
5
5
|
type: typeof ItemMoveType.Delete;
|
|
6
6
|
itemIndex: number;
|
|
7
7
|
quantity?: number;
|
|
@@ -3,10 +3,10 @@ import { MoveItem } from './MoveItem';
|
|
|
3
3
|
import { Shuffle, ShuffleRandomized } from './Shuffle';
|
|
4
4
|
import { CreateItem } from './CreateItem';
|
|
5
5
|
import { DeleteItem } from './DeleteItem';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type ItemMove<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = CreateItem<Player, MaterialType, LocationType> | DeleteItem<MaterialType> | MoveItem<Player, MaterialType, LocationType> | Shuffle<MaterialType>;
|
|
7
|
+
export type MaterialMoveCommon<MaterialType extends number = number> = {
|
|
8
8
|
kind: typeof MoveKind.ItemMove;
|
|
9
9
|
itemType: MaterialType;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type ItemMoveRandomized<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = Exclude<ItemMove<Player, MaterialType, LocationType>, Shuffle<MaterialType>> | ShuffleRandomized<MaterialType>;
|
|
12
|
+
export type ItemMoveView<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = Exclude<ItemMoveRandomized<Player, MaterialType, LocationType>, ShuffleRandomized<MaterialType>> | Shuffle<MaterialType>;
|
|
@@ -2,14 +2,14 @@ import { ItemMoveType } from './ItemMoveType';
|
|
|
2
2
|
import { MaterialMove } from '../MaterialMove';
|
|
3
3
|
import { MaterialMoveCommon } from './ItemMove';
|
|
4
4
|
import { ItemPosition, MaterialItem } from '../../items';
|
|
5
|
-
export
|
|
5
|
+
export type MoveItem<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = MaterialMoveCommon<MaterialType> & {
|
|
6
6
|
type: typeof ItemMoveType.Move;
|
|
7
7
|
itemIndex: number;
|
|
8
8
|
position: Partial<ItemPosition<Player, LocationType>>;
|
|
9
9
|
quantity?: number;
|
|
10
10
|
reveal?: Omit<MaterialItem<Player, LocationType>, 'location'>;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type MoveItemLocation<P extends number, M extends number, L extends number> = MoveItem<P, M, L> & {
|
|
13
13
|
position: ItemPosition<P, L>;
|
|
14
14
|
};
|
|
15
15
|
export declare function isMoveItem<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is MoveItem<P, M, L>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Location } from '../../location';
|
|
2
|
+
import { MaterialMove } from '../MaterialMove';
|
|
3
|
+
import { MaterialMoveCommon } from './ItemMove';
|
|
4
|
+
import { ItemMoveType } from './ItemMoveType';
|
|
5
|
+
export type Roll<P extends number = number, M extends number = number, L extends number = number> = MaterialMoveCommon<M> & {
|
|
6
|
+
type: typeof ItemMoveType.Roll;
|
|
7
|
+
itemIndex: number;
|
|
8
|
+
location: Location<P, L>;
|
|
9
|
+
};
|
|
10
|
+
export declare function isRoll<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is Roll<P, M, L>;
|
|
11
|
+
export declare function isRollItemType<P extends number, M extends number, L extends number>(type: M): (move: MaterialMove<P, M, L>) => move is Roll<P, M, L>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRollItemType = exports.isRoll = void 0;
|
|
4
|
+
var MoveKind_1 = require("../MoveKind");
|
|
5
|
+
var ItemMoveType_1 = require("./ItemMoveType");
|
|
6
|
+
function isRoll(move) {
|
|
7
|
+
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.Roll;
|
|
8
|
+
}
|
|
9
|
+
exports.isRoll = isRoll;
|
|
10
|
+
function isRollItemType(type) {
|
|
11
|
+
return function (move) {
|
|
12
|
+
return isRoll(move) && move.itemType === type;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.isRollItemType = isRollItemType;
|
|
16
|
+
//# sourceMappingURL=Roll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Roll.js","sourceRoot":"","sources":["../../../../src/material/moves/items/Roll.ts"],"names":[],"mappings":";;;AAEA,wCAAsC;AAEtC,+CAA6C;AAQ7C,SAAgB,MAAM,CAAuD,IAA2B;IACtG,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,IAAI,CAAA;AAC3E,CAAC;AAFD,wBAEC;AAED,SAAgB,cAAc,CAC5B,IAAO;IAEP,OAAO,UAAC,IAA2B;QACjC,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;IAAtC,CAAsC,CAAA;AAC1C,CAAC;AALD,wCAKC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Location } from '../../location';
|
|
2
|
+
import { MaterialMove } from '../MaterialMove';
|
|
3
|
+
import { MaterialMoveCommon } from './ItemMove';
|
|
4
|
+
import { ItemMoveType } from './ItemMoveType';
|
|
5
|
+
export type RollItem<P extends number = number, M extends number = number, L extends number = number> = MaterialMoveCommon<M> & {
|
|
6
|
+
type: typeof ItemMoveType.Roll;
|
|
7
|
+
itemIndex: number;
|
|
8
|
+
location: Location<P, L>;
|
|
9
|
+
};
|
|
10
|
+
export declare function isRoll<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is RollItem<P, M, L>;
|
|
11
|
+
export declare function isRollItemType<P extends number, M extends number, L extends number>(type: M): (move: MaterialMove<P, M, L>) => move is RollItem<P, M, L>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRollItemType = exports.isRoll = void 0;
|
|
4
|
+
var MoveKind_1 = require("../MoveKind");
|
|
5
|
+
var ItemMoveType_1 = require("./ItemMoveType");
|
|
6
|
+
function isRoll(move) {
|
|
7
|
+
return move.kind === MoveKind_1.MoveKind.ItemMove && move.type === ItemMoveType_1.ItemMoveType.Roll;
|
|
8
|
+
}
|
|
9
|
+
exports.isRoll = isRoll;
|
|
10
|
+
function isRollItemType(type) {
|
|
11
|
+
return function (move) {
|
|
12
|
+
return isRoll(move) && move.itemType === type;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
exports.isRollItemType = isRollItemType;
|
|
16
|
+
//# sourceMappingURL=RollItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RollItem.js","sourceRoot":"","sources":["../../../../src/material/moves/items/RollItem.ts"],"names":[],"mappings":";;;AAEA,wCAAsC;AAEtC,+CAA6C;AAQ7C,SAAgB,MAAM,CAAuD,IAA2B;IACtG,OAAO,IAAI,CAAC,IAAI,KAAK,mBAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,2BAAY,CAAC,IAAI,CAAA;AAC3E,CAAC;AAFD,wBAEC;AAED,SAAgB,cAAc,CAC5B,IAAO;IAEP,OAAO,UAAC,IAA2B;QACjC,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;IAAtC,CAAsC,CAAA;AAC1C,CAAC;AALD,wCAKC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ItemMoveType } from './ItemMoveType';
|
|
2
2
|
import { MaterialMoveCommon } from './ItemMove';
|
|
3
3
|
import { MaterialMove } from '../MaterialMove';
|
|
4
|
-
export
|
|
4
|
+
export type Shuffle<MaterialType extends number = number> = MaterialMoveCommon<MaterialType> & {
|
|
5
5
|
type: typeof ItemMoveType.Shuffle;
|
|
6
6
|
indexes: number[];
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type ShuffleRandomized<MaterialType extends number = number> = Shuffle<MaterialType> & {
|
|
9
9
|
newIndexes: number[];
|
|
10
10
|
};
|
|
11
11
|
export declare function isShuffle<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is Shuffle<M>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MoveKind } from '../MoveKind';
|
|
2
2
|
import { LocalMoveType } from './LocalMove';
|
|
3
3
|
import { MaterialMove } from '../MaterialMove';
|
|
4
|
-
export
|
|
4
|
+
export type CloseTutorialPopup = {
|
|
5
5
|
kind: MoveKind.LocalMove;
|
|
6
6
|
type: LocalMoveType.CloseTutorialPopup;
|
|
7
7
|
};
|
|
@@ -2,30 +2,30 @@ import { LocalMoveType } from './LocalMove';
|
|
|
2
2
|
import { MoveKind } from '../MoveKind';
|
|
3
3
|
import { MaterialItem } from '../../items';
|
|
4
4
|
import { Location } from '../../location';
|
|
5
|
-
export
|
|
5
|
+
export type RulesDisplay<P extends number = number, M extends number = number, L extends number = number> = MaterialRulesDisplay<P, M, L> | LocationRulesDisplay<P, L>;
|
|
6
6
|
export declare enum RulesDisplayType {
|
|
7
7
|
Material = 1,
|
|
8
8
|
Location = 2
|
|
9
9
|
}
|
|
10
|
-
export
|
|
10
|
+
export type MaterialRulesDisplay<P extends number = number, M extends number = number, L extends number = number> = {
|
|
11
11
|
type: typeof RulesDisplayType.Material;
|
|
12
12
|
itemType: M;
|
|
13
13
|
itemIndex?: number;
|
|
14
14
|
item: Partial<MaterialItem<P, L>>;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type LocationRulesDisplay<P extends number = number, L extends number = number> = {
|
|
17
17
|
type: typeof RulesDisplayType.Location;
|
|
18
18
|
location: Location<P, L>;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type DisplayRules<P extends number = number, M extends number = number, L extends number = number> = {
|
|
21
21
|
kind: MoveKind.LocalMove;
|
|
22
22
|
type: typeof LocalMoveType.DisplayRules;
|
|
23
23
|
rulesDisplay: RulesDisplay<P, M, L>;
|
|
24
24
|
};
|
|
25
25
|
export declare const displayRules: <P extends number = number, M extends number = number, L extends number = number>(rulesDisplay: RulesDisplay<P, M, L>) => DisplayRules<P, M, L>;
|
|
26
|
-
export declare const displayMaterialRules: <P extends number = number, M extends number = number, L extends number = number>(itemType: M, item?: Partial<MaterialItem<P, L, any>>, itemIndex?: number
|
|
26
|
+
export declare const displayMaterialRules: <P extends number = number, M extends number = number, L extends number = number>(itemType: M, item?: Partial<MaterialItem<P, L, any>>, itemIndex?: number) => DisplayRules<P, M, L>;
|
|
27
27
|
export declare const displayLocationRules: <P extends number = number, M extends number = number, L extends number = number>(location: Location<P, L, any>) => DisplayRules<P, M, L>;
|
|
28
|
-
export
|
|
28
|
+
export type CloseRulesDisplay = {
|
|
29
29
|
kind: MoveKind.LocalMove;
|
|
30
30
|
type: typeof LocalMoveType.CloseRulesDisplay;
|
|
31
31
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MoveKind } from '../MoveKind';
|
|
2
2
|
import { LocalMoveType } from './LocalMove';
|
|
3
|
-
export
|
|
3
|
+
export type DropItem<M extends number = number> = {
|
|
4
4
|
kind: MoveKind.LocalMove;
|
|
5
5
|
type: typeof LocalMoveType.DropItem;
|
|
6
6
|
item: DisplayedItem<M>;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type DisplayedItem<M extends number = number> = {
|
|
9
9
|
type: M;
|
|
10
10
|
index: number;
|
|
11
11
|
displayIndex: number;
|
|
@@ -2,7 +2,7 @@ import { CloseRulesDisplay, DisplayRules } from './DisplayRules';
|
|
|
2
2
|
import { DropItem } from './DropItem';
|
|
3
3
|
import { SetTutorialStep } from './SetTutorialStep';
|
|
4
4
|
import { CloseTutorialPopup } from './CloseTutorialPopup';
|
|
5
|
-
export
|
|
5
|
+
export type LocalMove<Player extends number = number, MaterialType extends number = number, LocationType extends number = number> = DisplayRules<Player, MaterialType, LocationType> | CloseRulesDisplay | DropItem<MaterialType> | SetTutorialStep | CloseTutorialPopup;
|
|
6
6
|
export declare enum LocalMoveType {
|
|
7
7
|
DisplayRules = 0,
|
|
8
8
|
CloseRulesDisplay = 1,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MoveKind } from '../MoveKind';
|
|
2
2
|
import { LocalMoveType } from './LocalMove';
|
|
3
3
|
import { MaterialMove } from '../MaterialMove';
|
|
4
|
-
export
|
|
4
|
+
export type SetTutorialStep = {
|
|
5
5
|
kind: MoveKind.LocalMove;
|
|
6
6
|
type: LocalMoveType.SetTutorialStep;
|
|
7
7
|
step: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RuleMoveCommon, RuleMoveType } from './RuleMove';
|
|
2
2
|
import { MaterialMove } from '../MaterialMove';
|
|
3
|
-
export
|
|
3
|
+
export type EndGame = RuleMoveCommon & {
|
|
4
4
|
type: typeof RuleMoveType.EndGame;
|
|
5
5
|
};
|
|
6
6
|
export declare function isEndGame<P extends number, M extends number, L extends number>(move: MaterialMove<P, M, L>): move is EndGame;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RuleMoveCommon, RuleMoveType } from './RuleMove';
|
|
2
2
|
import { MaterialMove } from '../MaterialMove';
|
|
3
|
-
export
|
|
3
|
+
export type EndPlayerTurn<Player extends number = number> = RuleMoveCommon & {
|
|
4
4
|
type: typeof RuleMoveType.EndPlayerTurn;
|
|
5
5
|
player: Player;
|
|
6
6
|
};
|
|
@@ -4,7 +4,7 @@ import { StartPlayerTurn } from './StartPlayerTurn';
|
|
|
4
4
|
import { EndGame } from './EndGame';
|
|
5
5
|
import { StartSimultaneousRule } from './StartSimultaneousRule';
|
|
6
6
|
import { EndPlayerTurn } from './EndPlayerTurn';
|
|
7
|
-
export
|
|
7
|
+
export type RuleMove<Player extends number = number, RuleId extends number = number> = StartPlayerTurn<Player, RuleId> | StartSimultaneousRule<Player, RuleId> | StartRule<RuleId> | EndGame | EndPlayerTurn<Player>;
|
|
8
8
|
export declare enum RuleMoveType {
|
|
9
9
|
StartPlayerTurn = 0,
|
|
10
10
|
StartSimultaneousRule = 1,
|
|
@@ -12,7 +12,7 @@ export declare enum RuleMoveType {
|
|
|
12
12
|
StartRule = 3,
|
|
13
13
|
EndGame = 4
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type RuleMoveCommon = {
|
|
16
16
|
kind: typeof MoveKind.RulesMove;
|
|
17
17
|
};
|
|
18
18
|
export declare const isRuleChange: <P extends number = number, R extends number = number>(move: RuleMove<P, R>) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RuleMoveCommon, RuleMoveType } from './RuleMove';
|
|
2
2
|
import { MaterialMove } from '../MaterialMove';
|
|
3
|
-
export
|
|
3
|
+
export type StartPlayerTurn<Player extends number = number, RuleId extends number = number> = RuleMoveCommon & {
|
|
4
4
|
type: typeof RuleMoveType.StartPlayerTurn;
|
|
5
5
|
id: RuleId;
|
|
6
6
|
player?: Player;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RuleMoveCommon, RuleMoveType } from './RuleMove';
|
|
2
2
|
import { MaterialMove } from '../MaterialMove';
|
|
3
|
-
export
|
|
3
|
+
export type StartRule<RuleId extends number = number> = RuleMoveCommon & {
|
|
4
4
|
type: typeof RuleMoveType.StartRule;
|
|
5
5
|
id: RuleId;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RuleMoveCommon, RuleMoveType } from './RuleMove';
|
|
2
2
|
import { MaterialMove } from '../MaterialMove';
|
|
3
|
-
export
|
|
3
|
+
export type StartSimultaneousRule<Player extends number = number, RuleId extends number = number> = RuleMoveCommon & {
|
|
4
4
|
type: typeof RuleMoveType.StartSimultaneousRule;
|
|
5
5
|
id: RuleId;
|
|
6
6
|
players?: Player[];
|
|
@@ -23,7 +23,7 @@ var MaterialRulesMovesBuilder = (function () {
|
|
|
23
23
|
};
|
|
24
24
|
MaterialRulesMovesBuilder.prototype.customMove = function (type, data) {
|
|
25
25
|
var move = { kind: moves_1.MoveKind.CustomMove, type: type };
|
|
26
|
-
if (data)
|
|
26
|
+
if (data !== undefined)
|
|
27
27
|
move.data = data;
|
|
28
28
|
return move;
|
|
29
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialRulesMovesBuilder.js","sourceRoot":"","sources":["../../../src/material/rules/MaterialRulesMovesBuilder.ts"],"names":[],"mappings":";;;AACA,kCAAwI;AAExI;IAKE,mCAAY,IAAsD;QAChE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,mDAAe,GAAf,UAAgD,EAAU,EAAE,MAAc;QACxE,OAAO,EAAE,IAAI,EAAE,gBAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAY,CAAC,eAAe,EAAE,EAAE,IAAA,EAAE,MAAM,QAAA,EAAE,CAAA;IACrF,CAAC;IAED,yDAAqB,GAArB,UAAsD,EAAU,EAAE,OAAkB;QAClF,IAAM,IAAI,GAA0C,EAAE,IAAI,EAAE,gBAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAY,CAAC,qBAAqB,EAAE,EAAE,IAAA,EAAE,CAAA;QAC9H,IAAI,OAAO;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACnC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,iDAAa,GAAb,UAAc,MAAc;QAC1B,OAAO,EAAE,IAAI,EAAE,gBAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAY,CAAC,aAAa,EAAE,MAAM,QAAA,EAAE,CAAA;IAC/E,CAAC;IAED,6CAAS,GAAT,UAA0C,EAAU;QAClD,OAAO,EAAE,IAAI,EAAE,gBAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAY,CAAC,SAAS,EAAE,EAAE,IAAA,EAAE,CAAA;IACvE,CAAC;IAED,8CAAU,GAAV,UAAyC,IAAU,EAAE,IAAU;QAC7D,IAAM,IAAI,GAAe,EAAE,IAAI,EAAE,gBAAQ,CAAC,UAAU,EAAE,IAAI,MAAA,EAAE,CAAA;QAC5D,IAAI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IAAI,GAAG,IAAI,CAAA;QACxC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,2CAAO,GAAP;QACE,OAAO,EAAE,IAAI,EAAE,gBAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAY,CAAC,OAAO,EAAE,CAAA;IACjE,CAAC;IACH,gCAAC;AAAD,CAAC,AApCD,IAoCC;AApCY,8DAAyB"}
|
package/dist/options/Option.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnumOption } from './EnumOption';
|
|
2
2
|
import { Option } from './Option';
|
|
3
3
|
import { PlayerEnumOption } from './PlayerEnumOption';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type OptionSpecOf<T> = [T] extends [boolean] ? Option : EnumOption<T>;
|
|
5
|
+
export type PlayerOptionSpecOf<T> = [T] extends [boolean] ? Option : PlayerEnumOption<T>;
|
|
@@ -2,7 +2,7 @@ import { TFunction } from 'i18next';
|
|
|
2
2
|
import { OptionSpecOf } from './OptionSpecOf';
|
|
3
3
|
import { WithPlayerOptionsSpec } from './WithPlayerOptionsSpec';
|
|
4
4
|
import { WithPlayersOptions } from './WithPlayersOptions';
|
|
5
|
-
export
|
|
5
|
+
export type OptionsSpec<Options> = (Options extends WithPlayersOptions<infer P> ? WithPlayerOptionsSpec<P> : {}) & {
|
|
6
6
|
[key in keyof Omit<Options, 'players'>]: OptionSpecOf<Options[key]>;
|
|
7
7
|
} & {
|
|
8
8
|
validate?: (options: Partial<Options>, t: TFunction) => void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EnumOption } from './EnumOption';
|
|
2
|
-
export
|
|
2
|
+
export type PlayerEnumOption<T = any> = EnumOption<T> & {
|
|
3
3
|
mandatory?: (players: number) => T[];
|
|
4
4
|
unavailable?: (players: number) => T[];
|
|
5
5
|
share?: boolean;
|
|
6
6
|
optional?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type PlayerIdOption<T = any> = PlayerEnumOption<T> & {
|
|
9
9
|
share?: false;
|
|
10
10
|
optional?: false;
|
|
11
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PlayerEnumOption } from './PlayerEnumOption';
|
|
2
2
|
import { WithIdOption } from './WithIdOption';
|
|
3
|
-
export
|
|
3
|
+
export type PlayersOptionsSpec<Options> = (Options extends WithIdOption<infer Id> ? {
|
|
4
4
|
id: PlayerEnumOption<Id>;
|
|
5
5
|
} : {}) & {
|
|
6
6
|
[key in keyof Omit<Options, 'id'>]: PlayerEnumOption<Options[key]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PlayersOptionsSpec } from './PlayersOptionsSpec';
|
|
2
2
|
import { OptionsSpec } from './OptionsSpec';
|
|
3
|
-
export
|
|
3
|
+
export type WithPlayerOptionsSpec<P> = {
|
|
4
4
|
players: PlayersOptionsSpec<P>;
|
|
5
5
|
};
|
|
6
6
|
export declare function isWithPlayerOptions<P, Options>(optionsSpec: OptionsSpec<Options>): optionsSpec is OptionsSpec<Options> & WithPlayerOptionsSpec<P>;
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -18,4 +18,5 @@ __exportStar(require("./EnumUtils"), exports);
|
|
|
18
18
|
__exportStar(require("./grid.util"), exports);
|
|
19
19
|
__exportStar(require("./grid.squares.util"), exports);
|
|
20
20
|
__exportStar(require("./isDeadEndMove.util"), exports);
|
|
21
|
+
__exportStar(require("./listing.util"), exports);
|
|
21
22
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,8CAA2B;AAC3B,sDAAmC;AACnC,uDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,8CAA2B;AAC3B,sDAAmC;AACnC,uDAAoC;AACpC,iDAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function listingToList<T extends number>(listing: Partial<Record<T, number>>): T[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listingToList = void 0;
|
|
4
|
+
function listingToList(listing) {
|
|
5
|
+
var list = [];
|
|
6
|
+
for (var key in listing) {
|
|
7
|
+
var intKey = parseInt(key);
|
|
8
|
+
for (var i = 0; i < listing[key]; i++) {
|
|
9
|
+
list.push(intKey);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return list;
|
|
13
|
+
}
|
|
14
|
+
exports.listingToList = listingToList;
|
|
15
|
+
//# sourceMappingURL=listing.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listing.util.js","sourceRoot":"","sources":["../../src/utils/listing.util.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAmB,OAAmC;IACjF,IAAM,IAAI,GAAQ,EAAE,CAAA;IACpB,KAAK,IAAM,GAAG,IAAI,OAAO,EAAE;QACzB,IAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAM,CAAA;QACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAE,EAAE,CAAC,EAAE,EAAE;YACtC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;SAClB;KACF;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AATD,sCASC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gamepark/rules-api",
|
|
3
|
-
"version": "6.10.
|
|
3
|
+
"version": "6.10.1",
|
|
4
4
|
"description": "API to implement the rules of a board game",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"@types/lodash": "^4.14.195",
|
|
30
30
|
"i18next": ">=21.3.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "b40e78ee555c3cf3afffe9c18fbc71bffeb11158"
|
|
33
33
|
}
|