@civ-clone/base-unit-action-goto 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civ-clone/base-unit-action-goto",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "main": "index.js",
5
5
  "repository": "git@github.com:civ-clone/base-unit-action-goto.git",
6
6
  "keywords": [
@@ -24,6 +24,7 @@
24
24
  "dependencies": {
25
25
  "@civ-clone/base-unit-action-move": "^0.1.1",
26
26
  "@civ-clone/base-unit-action-no-orders": "^0.1.0",
27
+ "@civ-clone/core-game": "^0.1.1",
27
28
  "@civ-clone/core-player": "^0.1.0",
28
29
  "@civ-clone/core-rule": "^0.1.2",
29
30
  "@civ-clone/core-strategy": "^0.1.0",
@@ -1 +1,3 @@
1
- export {};
1
+ import { Game } from '@civ-clone/core-game';
2
+ export declare const register: (game: Game) => void;
3
+ export default register;
package/registerRules.js CHANGED
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const RuleRegistry_1 = require("@civ-clone/core-rule/RuleRegistry");
3
+ exports.register = void 0;
4
4
  const turn_start_1 = require("./Rules/Player/turn-start");
5
- RuleRegistry_1.instance.register(...(0, turn_start_1.default)());
5
+ const core_game_1 = require("@civ-clone/core-game");
6
+ const register = (game) => game.rules.register(...(0, turn_start_1.default)(game.strategyNotes, game.units));
7
+ exports.register = register;
8
+ // The plugin loader imports each package for this side effect. Until it passes
9
+ // a `Game` of its own, dropping it would produce a game with silently absent
10
+ // rules — no error, just wrong behaviour.
11
+ (0, exports.register)(core_game_1.defaultGame);
12
+ exports.default = exports.register;
6
13
  //# sourceMappingURL=registerRules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registerRules.js","sourceRoot":"","sources":["registerRules.ts"],"names":[],"mappings":";;AAAA,oEAAqF;AACrF,0DAAkD;AAElD,uBAAoB,CAAC,QAAQ,CAAC,GAAG,IAAA,oBAAS,GAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"registerRules.js","sourceRoot":"","sources":["registerRules.ts"],"names":[],"mappings":";;;AAAA,0DAAkD;AAClD,oDAAyD;AAElD,MAAM,QAAQ,GAAG,CAAC,IAAU,EAAQ,EAAE,CAC3C,IAAI,CAAC,KAAK,CAAC,QAAQ,CACjB,GAAG,IAAA,oBAAS,EAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,CAC7C,CAAC;AAHS,QAAA,QAAQ,YAGjB;AAEJ,+EAA+E;AAC/E,6EAA6E;AAC7E,0CAA0C;AAC1C,IAAA,gBAAQ,EAAC,uBAAW,CAAC,CAAC;AAEtB,kBAAe,gBAAQ,CAAA"}
package/registerRules.ts CHANGED
@@ -1,4 +1,12 @@
1
- import { instance as ruleRegistryInstance } from '@civ-clone/core-rule/RuleRegistry';
2
1
  import turnStart from './Rules/Player/turn-start';
2
+ import { Game, defaultGame } from '@civ-clone/core-game';
3
3
 
4
- ruleRegistryInstance.register(...turnStart());
4
+ export const register = (game: Game): void =>
5
+ game.rules.register(...turnStart(game.strategyNotes, game.units));
6
+
7
+ // The plugin loader imports each package for this side effect. Until it passes
8
+ // a `Game` of its own, dropping it would produce a game with silently absent
9
+ // rules — no error, just wrong behaviour.
10
+ register(defaultGame);
11
+
12
+ export default register;
package/tsconfig.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "declaration": true,
4
4
  "lib": [
5
- "es2019"
5
+ "es2020"
6
6
  ],
7
7
  "module": "commonjs",
8
8
  "sourceMap": true,
@@ -13,4 +13,4 @@
13
13
  "node_modules",
14
14
  "tests/*.test.ts"
15
15
  ]
16
- }
16
+ }