@gamepark/rules-api 6.19.0 → 6.20.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 +61 -61
- package/dist/Action.js.map +1 -1
- package/dist/ApplyAutomaticMoves.d.ts +2 -2
- package/dist/ApplyAutomaticMoves.js +24 -24
- package/dist/ApplyAutomaticMoves.js.map +1 -1
- package/dist/Competitive.d.ts +13 -13
- package/dist/Competitive.js +45 -45
- package/dist/Competitive.js.map +1 -1
- package/dist/DefaultGameSetup.d.ts +7 -7
- package/dist/DefaultGameSetup.js +14 -14
- package/dist/Dummy.d.ts +7 -7
- package/dist/Dummy.js +26 -26
- package/dist/Dummy.js.map +1 -1
- package/dist/Eliminations.d.ts +5 -5
- package/dist/Eliminations.js +8 -8
- package/dist/GameSetup.d.ts +3 -3
- package/dist/GameSetup.js +2 -2
- package/dist/GameSetupCreator.d.ts +4 -4
- package/dist/GameSetupCreator.js +2 -2
- package/dist/IncompleteInformation.d.ts +14 -14
- package/dist/IncompleteInformation.js +37 -37
- package/dist/IncompleteInformation.js.map +1 -1
- package/dist/LocalMovePreview.d.ts +4 -0
- package/dist/LocalMovePreview.js +8 -0
- package/dist/LocalMovePreview.js.map +1 -0
- package/dist/LoopWithFuse.d.ts +4 -4
- package/dist/LoopWithFuse.js +14 -14
- package/dist/LoopWithFuse.js.map +1 -1
- package/dist/RandomMove.d.ts +7 -7
- package/dist/RandomMove.js +14 -14
- package/dist/Robot.d.ts +1 -1
- package/dist/Robot.js +2 -2
- package/dist/Rules.d.ts +18 -17
- package/dist/Rules.js +78 -78
- package/dist/Rules.js.map +1 -1
- package/dist/RulesCreator.d.ts +7 -7
- package/dist/RulesCreator.js +2 -2
- package/dist/TimeLimit.d.ts +10 -10
- package/dist/TimeLimit.js +12 -12
- package/dist/TimeLimit.js.map +1 -1
- package/dist/Undo.d.ts +6 -6
- package/dist/Undo.js +8 -8
- package/dist/UnpredictableMove.d.ts +5 -5
- package/dist/UnpredictableMove.js +5 -5
- package/dist/index.d.ts +21 -20
- package/dist/index.js +37 -36
- package/dist/index.js.map +1 -1
- package/dist/material/HiddenMaterialRules.d.ts +36 -35
- package/dist/material/HiddenMaterialRules.js +245 -245
- package/dist/material/HiddenMaterialRules.js.map +1 -1
- package/dist/material/MaterialGame.d.ts +15 -15
- package/dist/material/MaterialGame.js +2 -2
- package/dist/material/MaterialGameSetup.d.ts +21 -21
- package/dist/material/MaterialGameSetup.js +75 -75
- package/dist/material/MaterialGameSetup.js.map +1 -1
- package/dist/material/MaterialRules.d.ts +44 -44
- package/dist/material/MaterialRules.js +242 -242
- package/dist/material/MaterialRules.js.map +1 -1
- package/dist/material/SecretMaterialRules.d.ts +13 -13
- package/dist/material/SecretMaterialRules.js +37 -37
- package/dist/material/index.d.ts +10 -10
- package/dist/material/index.js +26 -26
- package/dist/material/items/Material.d.ts +59 -60
- package/dist/material/items/Material.js +406 -405
- package/dist/material/items/Material.js.map +1 -1
- package/dist/material/items/MaterialItem.d.ts +7 -7
- package/dist/material/items/MaterialItem.js +2 -2
- package/dist/material/items/MaterialMutator.d.ts +31 -31
- package/dist/material/items/MaterialMutator.js +277 -277
- package/dist/material/items/MaterialMutator.js.map +1 -1
- package/dist/material/items/index.d.ts +3 -3
- package/dist/material/items/index.js +19 -19
- package/dist/material/location/Location.d.ts +11 -11
- package/dist/material/location/Location.js +2 -2
- package/dist/material/location/LocationBuilder.d.ts +12 -12
- package/dist/material/location/LocationBuilder.js +40 -40
- package/dist/material/location/index.d.ts +3 -3
- package/dist/material/location/index.js +19 -19
- package/dist/material/location/strategy/FillGapStrategy.d.ts +7 -7
- package/dist/material/location/strategy/FillGapStrategy.js +23 -23
- package/dist/material/location/strategy/FillGapStrategy.js.map +1 -1
- package/dist/material/location/strategy/LocationStrategy.d.ts +6 -6
- package/dist/material/location/strategy/LocationStrategy.js +2 -2
- package/dist/material/location/strategy/PositiveSequenceStrategy.d.ts +9 -9
- package/dist/material/location/strategy/PositiveSequenceStrategy.js +65 -65
- package/dist/material/location/strategy/PositiveSequenceStrategy.js.map +1 -1
- package/dist/material/location/strategy/index.d.ts +3 -3
- package/dist/material/location/strategy/index.js +19 -19
- package/dist/material/memory/GameMemory.d.ts +8 -8
- package/dist/material/memory/GameMemory.js +27 -27
- package/dist/material/memory/GameMemory.js.map +1 -1
- package/dist/material/memory/PlayerMemory.d.ts +9 -9
- package/dist/material/memory/PlayerMemory.js +32 -32
- package/dist/material/memory/PlayerMemory.js.map +1 -1
- package/dist/material/memory/index.d.ts +2 -2
- package/dist/material/memory/index.js +18 -18
- package/dist/material/moves/CustomMove.d.ts +9 -9
- package/dist/material/moves/CustomMove.js +10 -10
- package/dist/material/moves/MaterialMove.d.ts +7 -7
- package/dist/material/moves/MaterialMove.js +2 -2
- package/dist/material/moves/MoveKind.d.ts +6 -6
- package/dist/material/moves/MoveKind.js +10 -10
- package/dist/material/moves/MoveKind.js.map +1 -1
- package/dist/material/moves/index.d.ts +6 -6
- package/dist/material/moves/index.js +22 -22
- package/dist/material/moves/items/CreateItem.d.ts +10 -10
- package/dist/material/moves/items/CreateItem.js +15 -15
- package/dist/material/moves/items/CreateItemsAtOnce.d.ts +10 -10
- package/dist/material/moves/items/CreateItemsAtOnce.js +15 -15
- package/dist/material/moves/items/DeleteItem.d.ts +10 -10
- package/dist/material/moves/items/DeleteItem.js +15 -15
- package/dist/material/moves/items/DeleteItemsAtOnce.d.ts +9 -9
- package/dist/material/moves/items/DeleteItemsAtOnce.js +15 -15
- package/dist/material/moves/items/ItemMove.d.ts +17 -17
- package/dist/material/moves/items/ItemMove.js +2 -2
- package/dist/material/moves/items/ItemMoveType.d.ts +11 -11
- package/dist/material/moves/items/ItemMoveType.js +15 -15
- package/dist/material/moves/items/ItemMoveType.js.map +1 -1
- package/dist/material/moves/items/ItemMovesBuilder.d.ts +8 -8
- package/dist/material/moves/items/ItemMovesBuilder.js +33 -33
- package/dist/material/moves/items/ItemMovesBuilder.js.map +1 -1
- package/dist/material/moves/items/MoveItem.d.ts +14 -14
- package/dist/material/moves/items/MoveItem.js +15 -15
- package/dist/material/moves/items/MoveItemsAtOnce.d.ts +13 -13
- package/dist/material/moves/items/MoveItemsAtOnce.js +15 -15
- package/dist/material/moves/items/RollItem.d.ts +11 -11
- package/dist/material/moves/items/RollItem.js +15 -15
- package/dist/material/moves/items/SelectItem.d.ts +11 -11
- package/dist/material/moves/items/SelectItem.js +15 -15
- package/dist/material/moves/items/Shuffle.d.ts +13 -13
- package/dist/material/moves/items/Shuffle.js +19 -19
- package/dist/material/moves/items/index.d.ts +12 -12
- package/dist/material/moves/items/index.js +28 -28
- package/dist/material/moves/local/CloseTutorialPopup.d.ts +8 -8
- package/dist/material/moves/local/CloseTutorialPopup.js +9 -9
- package/dist/material/moves/local/DisplayHelp.d.ts +39 -39
- package/dist/material/moves/local/DisplayHelp.js +29 -29
- package/dist/material/moves/local/DisplayHelp.js.map +1 -1
- package/dist/material/moves/local/DropItem.d.ts +13 -13
- package/dist/material/moves/local/DropItem.js +9 -9
- package/dist/material/moves/local/LocalMove.d.ts +12 -12
- package/dist/material/moves/local/LocalMove.js +11 -11
- package/dist/material/moves/local/LocalMove.js.map +1 -1
- package/dist/material/moves/local/SetTutorialStep.d.ts +9 -9
- package/dist/material/moves/local/SetTutorialStep.js +9 -9
- package/dist/material/moves/local/index.d.ts +5 -5
- package/dist/material/moves/local/index.js +21 -21
- package/dist/material/moves/rules/EndGame.d.ts +6 -6
- package/dist/material/moves/rules/EndGame.js +9 -9
- package/dist/material/moves/rules/EndPlayerTurn.d.ts +7 -7
- package/dist/material/moves/rules/EndPlayerTurn.js +9 -9
- package/dist/material/moves/rules/RuleMove.d.ts +18 -18
- package/dist/material/moves/rules/RuleMove.js +18 -18
- package/dist/material/moves/rules/RuleMove.js.map +1 -1
- package/dist/material/moves/rules/StartPlayerTurn.d.ts +8 -8
- package/dist/material/moves/rules/StartPlayerTurn.js +9 -9
- package/dist/material/moves/rules/StartRule.d.ts +7 -7
- package/dist/material/moves/rules/StartRule.js +9 -9
- package/dist/material/moves/rules/StartSimultaneousRule.d.ts +8 -8
- package/dist/material/moves/rules/StartSimultaneousRule.js +9 -9
- package/dist/material/moves/rules/index.d.ts +6 -6
- package/dist/material/moves/rules/index.js +22 -22
- package/dist/material/rules/MaterialRulesMovesBuilder.d.ts +12 -12
- package/dist/material/rules/MaterialRulesMovesBuilder.js +35 -35
- package/dist/material/rules/MaterialRulesPart.d.ts +23 -23
- package/dist/material/rules/MaterialRulesPart.js +64 -64
- package/dist/material/rules/MaterialRulesPart.js.map +1 -1
- package/dist/material/rules/PlayerTurnRule.d.ts +9 -9
- package/dist/material/rules/PlayerTurnRule.js +52 -52
- package/dist/material/rules/RuleStep.d.ts +5 -5
- package/dist/material/rules/RuleStep.js +2 -2
- package/dist/material/rules/SimultaneousRule.d.ts +9 -9
- package/dist/material/rules/SimultaneousRule.js +41 -41
- package/dist/material/rules/SimultaneousRule.js.map +1 -1
- package/dist/material/rules/index.d.ts +5 -5
- package/dist/material/rules/index.js +21 -21
- package/dist/options/EnumOption.d.ts +6 -6
- package/dist/options/EnumOption.js +7 -7
- package/dist/options/Option.d.ts +8 -8
- package/dist/options/Option.js +2 -2
- package/dist/options/OptionSpecOf.d.ts +5 -5
- package/dist/options/OptionSpecOf.js +2 -2
- package/dist/options/OptionsSpec.d.ts +9 -9
- package/dist/options/OptionsSpec.js +2 -2
- package/dist/options/OptionsValidationError.d.ts +4 -4
- package/dist/options/OptionsValidationError.js +29 -29
- package/dist/options/OptionsValidationError.js.map +1 -1
- package/dist/options/PlayerEnumOption.d.ts +14 -14
- package/dist/options/PlayerEnumOption.js +66 -66
- package/dist/options/PlayerEnumOption.js.map +1 -1
- package/dist/options/PlayersOptionsSpec.d.ts +7 -7
- package/dist/options/PlayersOptionsSpec.js +2 -2
- package/dist/options/WithIdOption.d.ts +3 -3
- package/dist/options/WithIdOption.js +2 -2
- package/dist/options/WithPlayerOptionsSpec.d.ts +6 -6
- package/dist/options/WithPlayerOptionsSpec.js +7 -7
- package/dist/options/WithPlayersOptions.d.ts +3 -3
- package/dist/options/WithPlayersOptions.js +2 -2
- package/dist/options/index.d.ts +11 -11
- package/dist/options/index.js +27 -27
- package/dist/options/isWithPlayerIdOptions.d.ts +4 -4
- package/dist/options/isWithPlayerIdOptions.js +11 -11
- package/dist/utils/EnumUtils.d.ts +1 -1
- package/dist/utils/EnumUtils.js +7 -7
- package/dist/utils/grid.squares.util.d.ts +11 -11
- package/dist/utils/grid.squares.util.js +30 -30
- package/dist/utils/grid.squares.util.js.map +1 -1
- package/dist/utils/grid.util.d.ts +5 -5
- package/dist/utils/grid.util.js +7 -7
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.js +21 -21
- package/dist/utils/isDeadEndMove.util.d.ts +2 -2
- package/dist/utils/isDeadEndMove.util.js +18 -18
- package/dist/utils/listing.util.d.ts +2 -2
- package/dist/utils/listing.util.js +23 -23
- package/dist/utils/listing.util.js.map +1 -1
- package/package.json +34 -33
- package/dist/material/items/MaterialDeck.d.ts +0 -7
- package/dist/material/items/MaterialDeck.js +0 -35
- package/dist/material/items/MaterialDeck.js.map +0 -1
- package/dist/material/moves/items/MoveAtOnce.d.ts +0 -13
- package/dist/material/moves/items/MoveAtOnce.js +0 -16
- package/dist/material/moves/items/MoveAtOnce.js.map +0 -1
- package/dist/material/moves/items/Roll.d.ts +0 -11
- package/dist/material/moves/items/Roll.js +0 -16
- package/dist/material/moves/items/Roll.js.map +0 -1
- package/dist/material/moves/local/DisplayRules.d.ts +0 -32
- package/dist/material/moves/local/DisplayRules.js +0 -25
- package/dist/material/moves/local/DisplayRules.js.map +0 -1
- package/dist/material/moves/rules/StartSimultanousRule.d.ts +0 -10
- package/dist/material/moves/rules/StartSimultanousRule.js +0 -10
- package/dist/material/moves/rules/StartSimultanousRule.js.map +0 -1
- package/dist/options/PlayerIdSpec.d.ts +0 -7
- package/dist/options/PlayerIdSpec.js +0 -18
- package/dist/options/PlayerIdSpec.js.map +0 -1
- package/dist/options/getFallbackPlayerName.d.ts +0 -4
- package/dist/options/getFallbackPlayerName.js +0 -14
- package/dist/options/getFallbackPlayerName.js.map +0 -1
- package/dist/options/providePlayerIds.d.ts +0 -6
- package/dist/options/providePlayerIds.js +0 -36
- package/dist/options/providePlayerIds.js.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Material"), exports);
|
|
18
|
-
__exportStar(require("./MaterialItem"), exports);
|
|
19
|
-
__exportStar(require("./MaterialMutator"), exports);
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Material"), exports);
|
|
18
|
+
__exportStar(require("./MaterialItem"), exports);
|
|
19
|
+
__exportStar(require("./MaterialMutator"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { XYCoordinates } from '../../utils';
|
|
2
|
-
export type Location<Player = number, LocationType = number, Id = any, Rotation = any> = {
|
|
3
|
-
type: LocationType;
|
|
4
|
-
id?: Id;
|
|
5
|
-
player?: Player;
|
|
6
|
-
parent?: number;
|
|
7
|
-
rotation?: Rotation;
|
|
8
|
-
} & Partial<Coordinates>;
|
|
9
|
-
export type Coordinates = XYCoordinates & {
|
|
10
|
-
z: number;
|
|
11
|
-
};
|
|
1
|
+
import { XYCoordinates } from '../../utils';
|
|
2
|
+
export type Location<Player = number, LocationType = number, Id = any, Rotation = any> = {
|
|
3
|
+
type: LocationType;
|
|
4
|
+
id?: Id;
|
|
5
|
+
player?: Player;
|
|
6
|
+
parent?: number;
|
|
7
|
+
rotation?: Rotation;
|
|
8
|
+
} & Partial<Coordinates>;
|
|
9
|
+
export type Coordinates = XYCoordinates & {
|
|
10
|
+
z: number;
|
|
11
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=Location.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Location } from './Location';
|
|
2
|
-
import { Material } from '../items';
|
|
3
|
-
export declare class LocationBuilder<P extends number = number, L extends number = number, Id = any> {
|
|
4
|
-
readonly location: Location<P, L, Id>;
|
|
5
|
-
constructor(location: Location<P, L, Id>);
|
|
6
|
-
id(id: Id): LocationBuilder<P, L, Id>;
|
|
7
|
-
player(player: P): LocationBuilder<P, L, Id>;
|
|
8
|
-
parent(arg: number | Material<P, number, L>): LocationBuilder<P, L, Id>;
|
|
9
|
-
x(x: number): LocationBuilder<P, L, Id>;
|
|
10
|
-
y(y: number): LocationBuilder<P, L, Id>;
|
|
11
|
-
z(z: number): LocationBuilder<P, L, Id>;
|
|
12
|
-
}
|
|
1
|
+
import { Location } from './Location';
|
|
2
|
+
import { Material } from '../items';
|
|
3
|
+
export declare class LocationBuilder<P extends number = number, L extends number = number, Id = any> {
|
|
4
|
+
readonly location: Location<P, L, Id>;
|
|
5
|
+
constructor(location: Location<P, L, Id>);
|
|
6
|
+
id(id: Id): LocationBuilder<P, L, Id>;
|
|
7
|
+
player(player: P): LocationBuilder<P, L, Id>;
|
|
8
|
+
parent(arg: number | Material<P, number, L>): LocationBuilder<P, L, Id>;
|
|
9
|
+
x(x: number): LocationBuilder<P, L, Id>;
|
|
10
|
+
y(y: number): LocationBuilder<P, L, Id>;
|
|
11
|
+
z(z: number): LocationBuilder<P, L, Id>;
|
|
12
|
+
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.LocationBuilder = void 0;
|
|
15
|
-
var LocationBuilder = (function () {
|
|
16
|
-
function LocationBuilder(location) {
|
|
17
|
-
this.location = location;
|
|
18
|
-
}
|
|
19
|
-
LocationBuilder.prototype.id = function (id) {
|
|
20
|
-
return new LocationBuilder(__assign(__assign({}, this.location), { id: id }));
|
|
21
|
-
};
|
|
22
|
-
LocationBuilder.prototype.player = function (player) {
|
|
23
|
-
return new LocationBuilder(__assign(__assign({}, this.location), { player: player }));
|
|
24
|
-
};
|
|
25
|
-
LocationBuilder.prototype.parent = function (arg) {
|
|
26
|
-
var parent = typeof arg === 'number' ? arg : arg.entries[0][0];
|
|
27
|
-
return new LocationBuilder(__assign(__assign({}, this.location), { parent: parent }));
|
|
28
|
-
};
|
|
29
|
-
LocationBuilder.prototype.x = function (x) {
|
|
30
|
-
return new LocationBuilder(__assign(__assign({}, this.location), { x: x }));
|
|
31
|
-
};
|
|
32
|
-
LocationBuilder.prototype.y = function (y) {
|
|
33
|
-
return new LocationBuilder(__assign(__assign({}, this.location), { y: y }));
|
|
34
|
-
};
|
|
35
|
-
LocationBuilder.prototype.z = function (z) {
|
|
36
|
-
return new LocationBuilder(__assign(__assign({}, this.location), { z: z }));
|
|
37
|
-
};
|
|
38
|
-
return LocationBuilder;
|
|
39
|
-
}());
|
|
40
|
-
exports.LocationBuilder = LocationBuilder;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.LocationBuilder = void 0;
|
|
15
|
+
var LocationBuilder = (function () {
|
|
16
|
+
function LocationBuilder(location) {
|
|
17
|
+
this.location = location;
|
|
18
|
+
}
|
|
19
|
+
LocationBuilder.prototype.id = function (id) {
|
|
20
|
+
return new LocationBuilder(__assign(__assign({}, this.location), { id: id }));
|
|
21
|
+
};
|
|
22
|
+
LocationBuilder.prototype.player = function (player) {
|
|
23
|
+
return new LocationBuilder(__assign(__assign({}, this.location), { player: player }));
|
|
24
|
+
};
|
|
25
|
+
LocationBuilder.prototype.parent = function (arg) {
|
|
26
|
+
var parent = typeof arg === 'number' ? arg : arg.entries[0][0];
|
|
27
|
+
return new LocationBuilder(__assign(__assign({}, this.location), { parent: parent }));
|
|
28
|
+
};
|
|
29
|
+
LocationBuilder.prototype.x = function (x) {
|
|
30
|
+
return new LocationBuilder(__assign(__assign({}, this.location), { x: x }));
|
|
31
|
+
};
|
|
32
|
+
LocationBuilder.prototype.y = function (y) {
|
|
33
|
+
return new LocationBuilder(__assign(__assign({}, this.location), { y: y }));
|
|
34
|
+
};
|
|
35
|
+
LocationBuilder.prototype.z = function (z) {
|
|
36
|
+
return new LocationBuilder(__assign(__assign({}, this.location), { z: z }));
|
|
37
|
+
};
|
|
38
|
+
return LocationBuilder;
|
|
39
|
+
}());
|
|
40
|
+
exports.LocationBuilder = LocationBuilder;
|
|
41
41
|
//# sourceMappingURL=LocationBuilder.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './strategy';
|
|
2
|
-
export * from './Location';
|
|
3
|
-
export * from './LocationBuilder';
|
|
1
|
+
export * from './strategy';
|
|
2
|
+
export * from './Location';
|
|
3
|
+
export * from './LocationBuilder';
|
|
@@ -1,20 +1,20 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./strategy"), exports);
|
|
18
|
-
__exportStar(require("./Location"), exports);
|
|
19
|
-
__exportStar(require("./LocationBuilder"), exports);
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./strategy"), exports);
|
|
18
|
+
__exportStar(require("./Location"), exports);
|
|
19
|
+
__exportStar(require("./LocationBuilder"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Material, MaterialItem } from '../../items';
|
|
2
|
-
import { LocationStrategy } from './LocationStrategy';
|
|
3
|
-
export declare class FillGapStrategy<P extends number = number, M extends number = number, L extends number = number> implements LocationStrategy<P, M, L> {
|
|
4
|
-
axis: 'x' | 'y' | 'z';
|
|
5
|
-
constructor(axis?: 'x' | 'y' | 'z');
|
|
6
|
-
addItem(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
7
|
-
}
|
|
1
|
+
import { Material, MaterialItem } from '../../items';
|
|
2
|
+
import { LocationStrategy } from './LocationStrategy';
|
|
3
|
+
export declare class FillGapStrategy<P extends number = number, M extends number = number, L extends number = number> implements LocationStrategy<P, M, L> {
|
|
4
|
+
axis: 'x' | 'y' | 'z';
|
|
5
|
+
constructor(axis?: 'x' | 'y' | 'z');
|
|
6
|
+
addItem(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
7
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FillGapStrategy = void 0;
|
|
4
|
-
var FillGapStrategy = (function () {
|
|
5
|
-
function FillGapStrategy(axis) {
|
|
6
|
-
if (axis === void 0) { axis = 'x'; }
|
|
7
|
-
this.axis = axis;
|
|
8
|
-
}
|
|
9
|
-
FillGapStrategy.prototype.addItem = function (material, item) {
|
|
10
|
-
var _this = this;
|
|
11
|
-
var _a;
|
|
12
|
-
if (item.location[this.axis] === undefined) {
|
|
13
|
-
var items = material.sort(function (item) { return item.location[_this.axis]; }).getItems();
|
|
14
|
-
var position = 0;
|
|
15
|
-
while (((_a = items[position]) === null || _a === void 0 ? void 0 : _a.location[this.axis]) === position) {
|
|
16
|
-
position++;
|
|
17
|
-
}
|
|
18
|
-
item.location[this.axis] = position;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
return FillGapStrategy;
|
|
22
|
-
}());
|
|
23
|
-
exports.FillGapStrategy = FillGapStrategy;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FillGapStrategy = void 0;
|
|
4
|
+
var FillGapStrategy = (function () {
|
|
5
|
+
function FillGapStrategy(axis) {
|
|
6
|
+
if (axis === void 0) { axis = 'x'; }
|
|
7
|
+
this.axis = axis;
|
|
8
|
+
}
|
|
9
|
+
FillGapStrategy.prototype.addItem = function (material, item) {
|
|
10
|
+
var _this = this;
|
|
11
|
+
var _a;
|
|
12
|
+
if (item.location[this.axis] === undefined) {
|
|
13
|
+
var items = material.sort(function (item) { return item.location[_this.axis]; }).getItems();
|
|
14
|
+
var position = 0;
|
|
15
|
+
while (((_a = items[position]) === null || _a === void 0 ? void 0 : _a.location[this.axis]) === position) {
|
|
16
|
+
position++;
|
|
17
|
+
}
|
|
18
|
+
item.location[this.axis] = position;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return FillGapStrategy;
|
|
22
|
+
}());
|
|
23
|
+
exports.FillGapStrategy = FillGapStrategy;
|
|
24
24
|
//# sourceMappingURL=FillGapStrategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FillGapStrategy.js","sourceRoot":"","sources":["../../../../src/material/location/strategy/FillGapStrategy.ts"],"names":[],"mappings":";;;AAMA;IAGE,yBAAY,IAA2B;QAA3B,qBAAA,EAAA,UAA2B;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,iCAAO,GAAP,UAAQ,QAA2B,EAAE,IAAwB;QAA7D,iBASC;;QARC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"FillGapStrategy.js","sourceRoot":"","sources":["../../../../src/material/location/strategy/FillGapStrategy.ts"],"names":[],"mappings":";;;AAMA;IAGE,yBAAY,IAA2B;QAA3B,qBAAA,EAAA,UAA2B;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,iCAAO,GAAP,UAAQ,QAA2B,EAAE,IAAwB;QAA7D,iBASC;;QARC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YAC3C,IAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,QAAQ,CAAC,KAAI,CAAC,IAAI,CAAE,EAAzB,CAAyB,CAAC,CAAC,QAAQ,EAAE,CAAA;YACzE,IAAI,QAAQ,GAAG,CAAC,CAAA;YAChB,OAAO,CAAA,MAAA,KAAK,CAAC,QAAQ,CAAC,0CAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAK,QAAQ,EAAE,CAAC;gBACzD,QAAQ,EAAE,CAAA;YACZ,CAAC;YACD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAA;QACrC,CAAC;IACH,CAAC;IACH,sBAAC;AAAD,CAAC,AAjBD,IAiBC;AAjBY,0CAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Material, MaterialItem } from '../../items';
|
|
2
|
-
export type LocationStrategy<P extends number = number, M extends number = number, L extends number = number> = {
|
|
3
|
-
addItem?(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
4
|
-
moveItem?(material: Material<P, M, L>, item: MaterialItem<P, L>, index: number): void;
|
|
5
|
-
removeItem?(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
6
|
-
};
|
|
1
|
+
import { Material, MaterialItem } from '../../items';
|
|
2
|
+
export type LocationStrategy<P extends number = number, M extends number = number, L extends number = number> = {
|
|
3
|
+
addItem?(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
4
|
+
moveItem?(material: Material<P, M, L>, item: MaterialItem<P, L>, index: number): void;
|
|
5
|
+
removeItem?(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
6
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=LocationStrategy.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Material, MaterialItem } from '../../items';
|
|
2
|
-
import { LocationStrategy } from './LocationStrategy';
|
|
3
|
-
export declare class PositiveSequenceStrategy<P extends number = number, M extends number = number, L extends number = number> implements LocationStrategy<P, M, L> {
|
|
4
|
-
axis: 'x' | 'y' | 'z';
|
|
5
|
-
constructor(axis?: 'x' | 'y' | 'z');
|
|
6
|
-
addItem(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
7
|
-
moveItem(material: Material<P, M, L>, item: MaterialItem<P, L>, index: number): void;
|
|
8
|
-
removeItem(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
9
|
-
}
|
|
1
|
+
import { Material, MaterialItem } from '../../items';
|
|
2
|
+
import { LocationStrategy } from './LocationStrategy';
|
|
3
|
+
export declare class PositiveSequenceStrategy<P extends number = number, M extends number = number, L extends number = number> implements LocationStrategy<P, M, L> {
|
|
4
|
+
axis: 'x' | 'y' | 'z';
|
|
5
|
+
constructor(axis?: 'x' | 'y' | 'z');
|
|
6
|
+
addItem(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
7
|
+
moveItem(material: Material<P, M, L>, item: MaterialItem<P, L>, index: number): void;
|
|
8
|
+
removeItem(material: Material<P, M, L>, item: MaterialItem<P, L>): void;
|
|
9
|
+
}
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PositiveSequenceStrategy = void 0;
|
|
4
|
-
var PositiveSequenceStrategy = (function () {
|
|
5
|
-
function PositiveSequenceStrategy(axis) {
|
|
6
|
-
if (axis === void 0) { axis = 'x'; }
|
|
7
|
-
this.axis = axis;
|
|
8
|
-
}
|
|
9
|
-
PositiveSequenceStrategy.prototype.addItem = function (material, item) {
|
|
10
|
-
var x = item.location[this.axis];
|
|
11
|
-
if (x === undefined) {
|
|
12
|
-
item.location[this.axis] = material.length;
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
for (var _i = 0, _a = material.getItems(); _i < _a.length; _i++) {
|
|
16
|
-
var item_1 = _a[_i];
|
|
17
|
-
var itemX = item_1.location[this.axis];
|
|
18
|
-
if (itemX !== undefined && itemX >= x) {
|
|
19
|
-
item_1.location[this.axis]++;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
PositiveSequenceStrategy.prototype.moveItem = function (material, item, index) {
|
|
25
|
-
if (item.location[this.axis] === undefined) {
|
|
26
|
-
item.location[this.axis] = material.length - 1;
|
|
27
|
-
}
|
|
28
|
-
var x = material.getItem(index).location[this.axis];
|
|
29
|
-
if (x === undefined)
|
|
30
|
-
return;
|
|
31
|
-
var newX = item.location[this.axis];
|
|
32
|
-
if (x < newX) {
|
|
33
|
-
for (var _i = 0, _a = material.getItems(); _i < _a.length; _i++) {
|
|
34
|
-
var item_2 = _a[_i];
|
|
35
|
-
var itemX = item_2.location[this.axis];
|
|
36
|
-
if (itemX !== undefined && itemX > x && itemX <= newX) {
|
|
37
|
-
item_2.location[this.axis]--;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
else if (newX < x) {
|
|
42
|
-
for (var _b = 0, _c = material.getItems(); _b < _c.length; _b++) {
|
|
43
|
-
var item_3 = _c[_b];
|
|
44
|
-
var itemX = item_3.location[this.axis];
|
|
45
|
-
if (itemX !== undefined && itemX >= newX && itemX < x) {
|
|
46
|
-
item_3.location[this.axis]++;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
PositiveSequenceStrategy.prototype.removeItem = function (material, item) {
|
|
52
|
-
var x = item.location[this.axis];
|
|
53
|
-
if (x === undefined)
|
|
54
|
-
return;
|
|
55
|
-
for (var _i = 0, _a = material.getItems(); _i < _a.length; _i++) {
|
|
56
|
-
var item_4 = _a[_i];
|
|
57
|
-
var itemX = item_4.location[this.axis];
|
|
58
|
-
if (itemX !== undefined && itemX > x) {
|
|
59
|
-
item_4.location[this.axis]--;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
return PositiveSequenceStrategy;
|
|
64
|
-
}());
|
|
65
|
-
exports.PositiveSequenceStrategy = PositiveSequenceStrategy;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PositiveSequenceStrategy = void 0;
|
|
4
|
+
var PositiveSequenceStrategy = (function () {
|
|
5
|
+
function PositiveSequenceStrategy(axis) {
|
|
6
|
+
if (axis === void 0) { axis = 'x'; }
|
|
7
|
+
this.axis = axis;
|
|
8
|
+
}
|
|
9
|
+
PositiveSequenceStrategy.prototype.addItem = function (material, item) {
|
|
10
|
+
var x = item.location[this.axis];
|
|
11
|
+
if (x === undefined) {
|
|
12
|
+
item.location[this.axis] = material.length;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
for (var _i = 0, _a = material.getItems(); _i < _a.length; _i++) {
|
|
16
|
+
var item_1 = _a[_i];
|
|
17
|
+
var itemX = item_1.location[this.axis];
|
|
18
|
+
if (itemX !== undefined && itemX >= x) {
|
|
19
|
+
item_1.location[this.axis]++;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
PositiveSequenceStrategy.prototype.moveItem = function (material, item, index) {
|
|
25
|
+
if (item.location[this.axis] === undefined) {
|
|
26
|
+
item.location[this.axis] = material.length - 1;
|
|
27
|
+
}
|
|
28
|
+
var x = material.getItem(index).location[this.axis];
|
|
29
|
+
if (x === undefined)
|
|
30
|
+
return;
|
|
31
|
+
var newX = item.location[this.axis];
|
|
32
|
+
if (x < newX) {
|
|
33
|
+
for (var _i = 0, _a = material.getItems(); _i < _a.length; _i++) {
|
|
34
|
+
var item_2 = _a[_i];
|
|
35
|
+
var itemX = item_2.location[this.axis];
|
|
36
|
+
if (itemX !== undefined && itemX > x && itemX <= newX) {
|
|
37
|
+
item_2.location[this.axis]--;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (newX < x) {
|
|
42
|
+
for (var _b = 0, _c = material.getItems(); _b < _c.length; _b++) {
|
|
43
|
+
var item_3 = _c[_b];
|
|
44
|
+
var itemX = item_3.location[this.axis];
|
|
45
|
+
if (itemX !== undefined && itemX >= newX && itemX < x) {
|
|
46
|
+
item_3.location[this.axis]++;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
PositiveSequenceStrategy.prototype.removeItem = function (material, item) {
|
|
52
|
+
var x = item.location[this.axis];
|
|
53
|
+
if (x === undefined)
|
|
54
|
+
return;
|
|
55
|
+
for (var _i = 0, _a = material.getItems(); _i < _a.length; _i++) {
|
|
56
|
+
var item_4 = _a[_i];
|
|
57
|
+
var itemX = item_4.location[this.axis];
|
|
58
|
+
if (itemX !== undefined && itemX > x) {
|
|
59
|
+
item_4.location[this.axis]--;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return PositiveSequenceStrategy;
|
|
64
|
+
}());
|
|
65
|
+
exports.PositiveSequenceStrategy = PositiveSequenceStrategy;
|
|
66
66
|
//# sourceMappingURL=PositiveSequenceStrategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PositiveSequenceStrategy.js","sourceRoot":"","sources":["../../../../src/material/location/strategy/PositiveSequenceStrategy.ts"],"names":[],"mappings":";;;AAMA;IAGE,kCAAY,IAA2B;QAA3B,qBAAA,EAAA,UAA2B;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,0CAAO,GAAP,UAAQ,QAA2B,EAAE,IAAwB;QAC3D,IAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClC,IAAI,CAAC,KAAK,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"PositiveSequenceStrategy.js","sourceRoot":"","sources":["../../../../src/material/location/strategy/PositiveSequenceStrategy.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './FillGapStrategy';
|
|
2
|
-
export * from './LocationStrategy';
|
|
3
|
-
export * from './PositiveSequenceStrategy';
|
|
1
|
+
export * from './FillGapStrategy';
|
|
2
|
+
export * from './LocationStrategy';
|
|
3
|
+
export * from './PositiveSequenceStrategy';
|
|
@@ -1,20 +1,20 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./FillGapStrategy"), exports);
|
|
18
|
-
__exportStar(require("./LocationStrategy"), exports);
|
|
19
|
-
__exportStar(require("./PositiveSequenceStrategy"), exports);
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./FillGapStrategy"), exports);
|
|
18
|
+
__exportStar(require("./LocationStrategy"), exports);
|
|
19
|
+
__exportStar(require("./PositiveSequenceStrategy"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { MaterialGame } from '../MaterialGame';
|
|
2
|
-
export declare class GameMemory<Player extends number = number> {
|
|
3
|
-
private game;
|
|
4
|
-
constructor(game: MaterialGame<Player>);
|
|
5
|
-
memorize<T = any>(key: keyof any, value: T | ((lastValue: T) => T)): void;
|
|
6
|
-
remind<T = any>(key: keyof any): T;
|
|
7
|
-
forget(key: keyof any): void;
|
|
8
|
-
}
|
|
1
|
+
import { MaterialGame } from '../MaterialGame';
|
|
2
|
+
export declare class GameMemory<Player extends number = number> {
|
|
3
|
+
private game;
|
|
4
|
+
constructor(game: MaterialGame<Player>);
|
|
5
|
+
memorize<T = any>(key: keyof any, value: T | ((lastValue: T) => T)): void;
|
|
6
|
+
remind<T = any>(key: keyof any): T;
|
|
7
|
+
forget(key: keyof any): void;
|
|
8
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GameMemory = void 0;
|
|
4
|
-
var GameMemory = (function () {
|
|
5
|
-
function GameMemory(game) {
|
|
6
|
-
this.game = game;
|
|
7
|
-
}
|
|
8
|
-
GameMemory.prototype.memorize = function (key, value) {
|
|
9
|
-
if (typeof value === 'function') {
|
|
10
|
-
this.game.memory[key] = value(this.game.memory[key]);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
this.game.memory[key] = value;
|
|
14
|
-
}
|
|
15
|
-
if (typeof this.game.memory[key] === 'object') {
|
|
16
|
-
this.game.memory[key] = JSON.parse(JSON.stringify(this.game.memory[key]));
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
GameMemory.prototype.remind = function (key) {
|
|
20
|
-
return this.game.memory[key];
|
|
21
|
-
};
|
|
22
|
-
GameMemory.prototype.forget = function (key) {
|
|
23
|
-
delete this.game.memory[key];
|
|
24
|
-
};
|
|
25
|
-
return GameMemory;
|
|
26
|
-
}());
|
|
27
|
-
exports.GameMemory = GameMemory;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GameMemory = void 0;
|
|
4
|
+
var GameMemory = (function () {
|
|
5
|
+
function GameMemory(game) {
|
|
6
|
+
this.game = game;
|
|
7
|
+
}
|
|
8
|
+
GameMemory.prototype.memorize = function (key, value) {
|
|
9
|
+
if (typeof value === 'function') {
|
|
10
|
+
this.game.memory[key] = value(this.game.memory[key]);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
this.game.memory[key] = value;
|
|
14
|
+
}
|
|
15
|
+
if (typeof this.game.memory[key] === 'object') {
|
|
16
|
+
this.game.memory[key] = JSON.parse(JSON.stringify(this.game.memory[key]));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
GameMemory.prototype.remind = function (key) {
|
|
20
|
+
return this.game.memory[key];
|
|
21
|
+
};
|
|
22
|
+
GameMemory.prototype.forget = function (key) {
|
|
23
|
+
delete this.game.memory[key];
|
|
24
|
+
};
|
|
25
|
+
return GameMemory;
|
|
26
|
+
}());
|
|
27
|
+
exports.GameMemory = GameMemory;
|
|
28
28
|
//# sourceMappingURL=GameMemory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameMemory.js","sourceRoot":"","sources":["../../../src/material/memory/GameMemory.ts"],"names":[],"mappings":";;;AAEA;IACE,oBAAoB,IAA0B;QAA1B,SAAI,GAAJ,IAAI,CAAsB;IAC9C,CAAC;IAED,6BAAQ,GAAR,UAAkB,GAAc,EAAE,KAAgC;QAChE,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"GameMemory.js","sourceRoot":"","sources":["../../../src/material/memory/GameMemory.ts"],"names":[],"mappings":";;;AAEA;IACE,oBAAoB,IAA0B;QAA1B,SAAI,GAAJ,IAAI,CAAsB;IAC9C,CAAC;IAED,6BAAQ,GAAR,UAAkB,GAAc,EAAE,KAAgC;QAChE,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;YAChC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAI,KAA6B,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;QAC/E,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QAC/B,CAAC;QACD,IAAI,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE,CAAC;YAC9C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAC3E,CAAC;IACH,CAAC;IAED,2BAAM,GAAN,UAAgB,GAAc;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC9B,CAAC;IAED,2BAAM,GAAN,UAAO,GAAc;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC9B,CAAC;IACH,iBAAC;AAAD,CAAC,AAtBD,IAsBC;AAtBY,gCAAU"}
|