@gamepark/react-client 6.22.0 → 6.22.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.
@@ -0,0 +1,8 @@
1
+ import { Rules } from '@gamepark/rules-api';
2
+ import { ReactElement } from 'react';
3
+ export type ScoringValue = string | number | ReactElement;
4
+ export interface ScoringDescription<Player extends number = number, GameRule extends Rules = Rules, Key = any> {
5
+ getScoringKeys(rules: GameRule): Key[];
6
+ getScoringHeader(key: Key, rules: GameRule): ScoringValue;
7
+ getScoringPlayerData(key: Key, player: Player, rules: GameRule): ScoringValue | null;
8
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ScoringDescription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScoringDescription.js","sourceRoot":"","sources":["../../src/Scoring/ScoringDescription.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ export { ScoringDescription } from './ScoringDescription';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Scoring/index.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"Animations.js","sourceRoot":"","sources":["../../src/animations/Animations.ts"],"names":[],"mappings":";;;AAAA,iDAA+C;AAG/C;IAAA;IAsBA,CAAC;IApBC,gCAAW,GAAX,UAAY,IAAU,EAAE,OAA+C;QACrE,QAAQ,OAAO,CAAC,IAAI,EAAE;YACpB,KAAK,6BAAa,CAAC,WAAW;gBAC5B,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;YACrE,KAAK,6BAAa,CAAC,UAAU;gBAC3B,OAAO,I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C3B,OAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;SAChF;IACH,CAAC;IASH,iBAAC;AAAD,CAAC,AAtBD,IAsBC;AAtBY,gCAAU"}
@@ -1,5 +1,6 @@
1
1
  import { GameSetupCreator, Robot, RulesCreator } from '@gamepark/rules-api';
2
2
  import { PropsWithChildren } from 'react';
3
+ import { ScoringDescription } from '../../Scoring/ScoringDescription';
3
4
  import { GameReducerContext } from '../../Store/gameReducer';
4
5
  import { TutorialDescription } from '../../Tutorial';
5
6
  import { GameAI } from '../../Types';
@@ -11,6 +12,7 @@ export type LocalGameProviderProps<Game = any, GameView = any, Move = any, MoveV
11
12
  optionsSpec?: any;
12
13
  dummy?: Robot<Game, Move, PlayerId>;
13
14
  tutorial?: TutorialDescription<Game, Move, PlayerId>;
15
+ scoring?: ScoringDescription;
14
16
  ai?: GameAI<Game, Move, PlayerId>;
15
17
  } & GameReducerContext<GameView, MoveView, PlayerId>;
16
18
  export declare function LocalGameProvider<Game = any, GameView = any, Move = any, MoveView = any, PlayerId = any>({ children, ...props }: PropsWithChildren<LocalGameProviderProps<Game, GameView, Move, MoveView, PlayerId>>): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"LocalGameProvider.js","sourceRoot":"","sources":["../../../src/api/Local/LocalGameProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAkD;AAClD,2CAAsC;AACtC,+BAAoD;AACpD,+CAA2D;AAC3D,6DAA2D;AAC3D,uDAAyE;AACzE,qFAAmF;AAGnF,+CAA6C;AAC7C,+CAA6C;AAa7C,SAAgB,iBAAiB,CAC/B,EAA2G;IAAzG,IAAA,QAAQ,cAAA,EAAK,KAAK,cAApB,YAAsB,CAAF;IAEpB,IAAM,KAAK,GAAG,IAAA,eAAO,EAAC,cAAM,OAAA,mBAAmB,CAAC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,cAAA,EAAK,KAAK,cAApB,YAAsB,CAAF;IAEpB,IAAM,KAAK,GAAG,IAAA,eAAO,EAAC,cAAM,OAAA,mBAAmB,CAAC,KAAK,CAAC,EAA1B,CAA0B,EAAE,EAAE,CAAC,CAAA;IAC3D,OAAO,CACL,uBAAC,sBAAQ,aAAC,KAAK,EAAE,KAAK,gBACnB,QAAQ,IACA,CACZ,CAAA;AACH,CAAC;AATD,8CASC;AAED,SAAS,mBAAmB,CAAC,OAA+B;IAC1D,IAAM,GAAG,GAAG,IAAI,2BAAY,CAAC,OAAO,CAAC,CAAA;IACrC,IAAM,OAAO,GAAG,IAAA,yBAAW,EAAC,OAAO,CAAC,CAAA;IACpC,IAAM,KAAK,GAAI,OAAO,CAAC,KAAa,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,mBAAW,EAAC,OAAO,CAAC;QAC/D,CAAC,CAAC,IAAA,mBAAW,EAAC,OAAO,EAAE,IAAA,uBAAe,EAAC,IAAA,uDAA0B,EAAC,OAAO,CAAC,EAAE,IAAA,+BAAc,EAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IACnG,KAAK,CAAC,SAAS,CAAC,IAAA,qCAAwB,EAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;IAC/D,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE;QAC1C,MAAM,CAAC,IAAI,GAAG,IAAA,2BAAY,EAAC,GAAG,EAAE,KAAK,CAAC,CAAA;KACvC;IACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;IACxB,OAAO,KAAK,CAAA;AACd,CAAC"}
package/dist/index.d.ts CHANGED
@@ -15,3 +15,4 @@ export * from './Store';
15
15
  export * from './Tutorial';
16
16
  export * from './Types';
17
17
  export * from './User';
18
+ export * from './Scoring';
package/dist/index.js CHANGED
@@ -33,4 +33,5 @@ __exportStar(require("./Store"), exports);
33
33
  __exportStar(require("./Tutorial"), exports);
34
34
  __exportStar(require("./Types"), exports);
35
35
  __exportStar(require("./User"), exports);
36
+ __exportStar(require("./Scoring"), exports);
36
37
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAa,QAAA,YAAY,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,sBAAsB,mCAAI,uBAAuB,CAAA;AACzF,4CAAyB;AACzB,+CAA4B;AAC5B,wCAAqB;AACrB,yCAAsB;AACtB,iDAA8B;AAC9B,gDAA6B;AAC7B,4CAAyB;AACzB,2CAAwB;AACxB,0CAAuB;AACvB,+CAA4B;AAC5B,4CAAyB;AACzB,0CAAuB;AACvB,0CAAuB;AACvB,6CAA0B;AAC1B,0CAAuB;AACvB,yCAAsB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAa,QAAA,YAAY,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,sBAAsB,mCAAI,uBAAuB,CAAA;AACzF,4CAAyB;AACzB,+CAA4B;AAC5B,wCAAqB;AACrB,yCAAsB;AACtB,iDAA8B;AAC9B,gDAA6B;AAC7B,4CAAyB;AACzB,2CAAwB;AACxB,0CAAuB;AACvB,+CAA4B;AAC5B,4CAAyB;AACzB,0CAAuB;AACvB,0CAAuB;AACvB,6CAA0B;AAC1B,0CAAuB;AACvB,yCAAsB;AACtB,4CAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamepark/react-client",
3
- "version": "6.22.0",
3
+ "version": "6.22.1",
4
4
  "description": "Library to interact with Game Park server in a React application for a board game",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",