@thegraid/hexlib 1.2.11 → 1.2.13
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/game-play.d.ts +1 -1
- package/dist/game-play.js +1 -1
- package/dist/game-setup.d.ts.map +1 -1
- package/dist/game-setup.js +5 -4
- package/dist/game-setup.js.map +1 -1
- package/dist/game-state.d.ts.map +1 -1
- package/dist/game-state.js +11 -2
- package/dist/game-state.js.map +1 -1
- package/dist/hex.d.ts +62 -7
- package/dist/hex.d.ts.map +1 -1
- package/dist/hex.js +82 -35
- package/dist/hex.js.map +1 -1
- package/dist/meeple.d.ts.map +1 -1
- package/dist/meeple.js +2 -2
- package/dist/meeple.js.map +1 -1
- package/dist/player-panel.d.ts +6 -7
- package/dist/player-panel.d.ts.map +1 -1
- package/dist/player-panel.js +6 -7
- package/dist/player-panel.js.map +1 -1
- package/dist/player.js +1 -1
- package/dist/player.js.map +1 -1
- package/dist/shapes.d.ts +2 -62
- package/dist/shapes.d.ts.map +1 -1
- package/dist/shapes.js +3 -91
- package/dist/shapes.js.map +1 -1
- package/dist/table-params.d.ts +3 -0
- package/dist/table-params.d.ts.map +1 -1
- package/dist/table-params.js +3 -0
- package/dist/table-params.js.map +1 -1
- package/dist/table.d.ts +105 -45
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +65 -27
- package/dist/table.js.map +1 -1
- package/dist/tile.d.ts +12 -3
- package/dist/tile.d.ts.map +1 -1
- package/dist/tile.js +17 -2
- package/dist/tile.js.map +1 -1
- package/package.json +3 -3
package/dist/table.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="easeljs" />
|
|
2
2
|
/// <reference types="@thegraid/easeljs-lib/dist/createjs-functions" />
|
|
3
3
|
import { Constructor, XY, XYWH } from "@thegraid/common-lib";
|
|
4
|
-
import { Dispatcher, Dragger, DragInfo, DropdownStyle, NamedContainer, NamedObject, ParamGUI, RectShape, ScaleableContainer } from "@thegraid/easeljs-lib";
|
|
4
|
+
import { Dispatcher, Dragger, DragInfo, DropdownStyle, NamedContainer, NamedObject, ParamGUI, RectShape, ScaleableContainer, UtilButton } from "@thegraid/easeljs-lib";
|
|
5
5
|
import { Container, DisplayObject, Shape, Stage, Text } from "@thegraid/easeljs-module";
|
|
6
6
|
import { type GamePlay } from "./game-play";
|
|
7
7
|
import { Scenario } from "./game-setup";
|
|
@@ -9,7 +9,7 @@ import type { GameState } from "./game-state";
|
|
|
9
9
|
import { Hex, HexM, IdHex, IHex2, RecycleHex } from "./hex";
|
|
10
10
|
import { Player } from "./player";
|
|
11
11
|
import { PlayerPanel } from "./player-panel";
|
|
12
|
-
import { HexShape
|
|
12
|
+
import { HexShape } from "./shapes";
|
|
13
13
|
import { Tile } from "./tile";
|
|
14
14
|
import { TileSource } from "./tile-source";
|
|
15
15
|
export interface Dragable {
|
|
@@ -83,7 +83,21 @@ export declare class Table extends Dispatcher {
|
|
|
83
83
|
logText(line: string, from?: string, toConsole?: boolean): void;
|
|
84
84
|
logCurPlayer(plyr: Player): void;
|
|
85
85
|
logTurnPlayer(line: string): void;
|
|
86
|
-
|
|
86
|
+
/**
|
|
87
|
+
* also: enableHexInspector(this.undoCont)
|
|
88
|
+
*
|
|
89
|
+
* @param bgr bgRect
|
|
90
|
+
* @param row placement of UndoCont [8]
|
|
91
|
+
* @param col placement of UndoCont [-7]
|
|
92
|
+
*
|
|
93
|
+
* @param undoButtons [false] build the undo/redo buttons:
|
|
94
|
+
* @param xOffs offset to Red & Green arrows [55]
|
|
95
|
+
* @param bSize size of Red & Green arrows [60]
|
|
96
|
+
* @param skipRad size of Skip button/square [45]
|
|
97
|
+
*
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
setupUndoButtons(bgr: XYWH, row?: number, col?: number, undoButtons?: boolean, xOffs?: number, bSize?: number, skipRad?: number): void;
|
|
87
101
|
showWinText(msg?: string, color?: string): void;
|
|
88
102
|
enableHexInspector(qY?: number, cont?: Container): HexShape;
|
|
89
103
|
downClick: boolean;
|
|
@@ -117,7 +131,7 @@ export declare class Table extends Dispatcher {
|
|
|
117
131
|
distColor: string;
|
|
118
132
|
distText: Text;
|
|
119
133
|
rcText: Text;
|
|
120
|
-
setUnit: (unit: Tile,
|
|
134
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
121
135
|
tile: Tile | undefined;
|
|
122
136
|
meep: import("./meeple").Meeple | undefined;
|
|
123
137
|
constructorCode: (map: HexM<{
|
|
@@ -135,12 +149,14 @@ export declare class Table extends Dispatcher {
|
|
|
135
149
|
distColor: string;
|
|
136
150
|
distText: Text;
|
|
137
151
|
rcText: Text;
|
|
138
|
-
setUnit: (unit: Tile,
|
|
152
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
139
153
|
tile: Tile | undefined;
|
|
140
154
|
meep: import("./meeple").Meeple | undefined;
|
|
141
155
|
constructorCode: any;
|
|
156
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
157
|
+
setDistText: (name?: string, size?: number) => void;
|
|
142
158
|
showText: (vis?: boolean) => void;
|
|
143
|
-
readonly legalMark: import("./
|
|
159
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
144
160
|
isLegal: boolean;
|
|
145
161
|
initCont: (row: number, col: number) => void;
|
|
146
162
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -195,9 +211,11 @@ export declare class Table extends Dispatcher {
|
|
|
195
211
|
nextHex: (dir: import("./hex-intfs").HexDir, ns?: number) => import("./hex").Hex2 | undefined;
|
|
196
212
|
lastHex: (ds: import("./hex-intfs").HexDir) => import("./hex").Hex2;
|
|
197
213
|
radialDist: (hex: Hex) => number;
|
|
198
|
-
}>, row: number, col: number, name?: string
|
|
214
|
+
}>, row: number, col: number, name?: string) => void;
|
|
215
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
216
|
+
setDistText: (name?: string, size?: number) => void;
|
|
199
217
|
showText: (vis?: boolean) => void;
|
|
200
|
-
readonly legalMark: import("./
|
|
218
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
201
219
|
isLegal: boolean;
|
|
202
220
|
initCont: (row: number, col: number) => void;
|
|
203
221
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -271,7 +289,7 @@ export declare class Table extends Dispatcher {
|
|
|
271
289
|
distColor: string;
|
|
272
290
|
distText: Text;
|
|
273
291
|
rcText: Text;
|
|
274
|
-
setUnit: (unit: Tile,
|
|
292
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
275
293
|
tile: Tile | undefined;
|
|
276
294
|
meep: import("./meeple").Meeple | undefined;
|
|
277
295
|
constructorCode: (map: HexM<{
|
|
@@ -289,12 +307,14 @@ export declare class Table extends Dispatcher {
|
|
|
289
307
|
distColor: string;
|
|
290
308
|
distText: Text;
|
|
291
309
|
rcText: Text;
|
|
292
|
-
setUnit: (unit: Tile,
|
|
310
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
293
311
|
tile: Tile | undefined;
|
|
294
312
|
meep: import("./meeple").Meeple | undefined;
|
|
295
313
|
constructorCode: any;
|
|
314
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
315
|
+
setDistText: (name?: string, size?: number) => void;
|
|
296
316
|
showText: (vis?: boolean) => void;
|
|
297
|
-
readonly legalMark: import("./
|
|
317
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
298
318
|
isLegal: boolean;
|
|
299
319
|
initCont: (row: number, col: number) => void;
|
|
300
320
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -349,9 +369,11 @@ export declare class Table extends Dispatcher {
|
|
|
349
369
|
nextHex: (dir: import("./hex-intfs").HexDir, ns?: number) => import("./hex").Hex2 | undefined;
|
|
350
370
|
lastHex: (ds: import("./hex-intfs").HexDir) => import("./hex").Hex2;
|
|
351
371
|
radialDist: (hex: Hex) => number;
|
|
352
|
-
}>, row: number, col: number, name?: string
|
|
372
|
+
}>, row: number, col: number, name?: string) => void;
|
|
373
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
374
|
+
setDistText: (name?: string, size?: number) => void;
|
|
353
375
|
showText: (vis?: boolean) => void;
|
|
354
|
-
readonly legalMark: import("./
|
|
376
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
355
377
|
isLegal: boolean;
|
|
356
378
|
initCont: (row: number, col: number) => void;
|
|
357
379
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -456,10 +478,12 @@ export declare class Table extends Dispatcher {
|
|
|
456
478
|
* makeParamGUI2(parent) -> gui2.ymax
|
|
457
479
|
*/
|
|
458
480
|
makeGUIs(scale?: number, cx?: number, cy?: number, dy?: number): void;
|
|
481
|
+
/** height allocated for PlayerPanel scaled in hex height [map.rows/3-.2] */
|
|
459
482
|
get panelHeight(): number;
|
|
460
|
-
|
|
483
|
+
/** width of PlayerPanel, scaled in hex width [4.5] */
|
|
484
|
+
get panelWidth(): number;
|
|
461
485
|
/**
|
|
462
|
-
*
|
|
486
|
+
* Center of each Panel location: [row, col, dir][].
|
|
463
487
|
*
|
|
464
488
|
* col==0 is on left edge of hexMap; The *center* hex is col == (nHexes-1)
|
|
465
489
|
* @example
|
|
@@ -467,9 +491,9 @@ export declare class Table extends Dispatcher {
|
|
|
467
491
|
* P1 --C-- P4
|
|
468
492
|
* P2 --- P5
|
|
469
493
|
*/
|
|
470
|
-
getPanelLocs(): number
|
|
494
|
+
getPanelLocs(): [row: number, col: number, dir: 1 | -1][];
|
|
471
495
|
/**
|
|
472
|
-
* Which PanelLocs to use for a given number of Players
|
|
496
|
+
* Which PanelLocs to use (in order) for a given number of Players
|
|
473
497
|
* @param np number of Players
|
|
474
498
|
* @returns array of indices into PanelLocs (one for each Player)
|
|
475
499
|
*/
|
|
@@ -481,15 +505,31 @@ export declare class Table extends Dispatcher {
|
|
|
481
505
|
* @param panelLocs [getPanelLocs] potential panel locations
|
|
482
506
|
* @return panelLocs[panelLocsForNp(nPlayers)][pIndex]
|
|
483
507
|
*/
|
|
484
|
-
panelLoc(pIndex: number, nPlayers?: number, panelLocs?: number
|
|
508
|
+
panelLoc(pIndex: number, nPlayers?: number, panelLocs?: [row: number, col: number, dir: 1 | -1][]): [row: number, col: number, dir: 1 | -1];
|
|
509
|
+
/**
|
|
510
|
+
*
|
|
511
|
+
* @param table
|
|
512
|
+
* @param player
|
|
513
|
+
* @param high panelHeight
|
|
514
|
+
* @param wide adjust to suit
|
|
515
|
+
* @param row from panelLoc
|
|
516
|
+
* @param col from panelLoc
|
|
517
|
+
* @param dir from panelLoc
|
|
518
|
+
* @returns new PlayerPanel(table, player, high, wide, row - high / 2, col - wide / 2, dir)
|
|
519
|
+
*/
|
|
520
|
+
makePlayerPanel(table: Table, player: Player, high: number, wide: number, row: number, col: number, dir?: number): PlayerPanel;
|
|
485
521
|
readonly allPlayerPanels: PlayerPanel[];
|
|
486
522
|
/** make player panels, placed at panelLoc... */
|
|
487
523
|
makePerPlayer(): void;
|
|
488
524
|
/** move cont to nominal [row, col] of hexCont */
|
|
489
525
|
setToRowCol(cont: Container, row?: number, col?: number, hexCont?: Container): void;
|
|
526
|
+
/** display source [and legalMark] on given hex [Ankh] */
|
|
490
527
|
sourceOnHex(source: TileSource<Tile>, hex: IHex2): void;
|
|
528
|
+
/** @deprecated use UtilButton (change cgf on RectShape) [legacy from Ankh] */
|
|
491
529
|
makeCircleButton(color?: string, rad?: number, c?: string, fs?: number): Container;
|
|
530
|
+
/** @deprecated use UtilButton [from Ankh] */
|
|
492
531
|
makeSquareButton(color: string | undefined, xywh: XYWH, c?: string, fs?: number): Container;
|
|
532
|
+
/** @deprecated [legacy from hextowns] */
|
|
493
533
|
makeRecycleHex(row?: number, col?: number, claz?: typeof RecycleHex): {
|
|
494
534
|
implementsIHex2: boolean;
|
|
495
535
|
readonly cont: import("./hex").HexCont;
|
|
@@ -505,7 +545,7 @@ export declare class Table extends Dispatcher {
|
|
|
505
545
|
distColor: string;
|
|
506
546
|
distText: Text;
|
|
507
547
|
rcText: Text;
|
|
508
|
-
setUnit: (unit: Tile,
|
|
548
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
509
549
|
tile: Tile | undefined;
|
|
510
550
|
meep: import("./meeple").Meeple | undefined;
|
|
511
551
|
constructorCode: (map: HexM<{
|
|
@@ -523,12 +563,14 @@ export declare class Table extends Dispatcher {
|
|
|
523
563
|
distColor: string;
|
|
524
564
|
distText: Text;
|
|
525
565
|
rcText: Text;
|
|
526
|
-
setUnit: (unit: Tile,
|
|
566
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
527
567
|
tile: Tile | undefined;
|
|
528
568
|
meep: import("./meeple").Meeple | undefined;
|
|
529
569
|
constructorCode: any;
|
|
570
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
571
|
+
setDistText: (name?: string, size?: number) => void;
|
|
530
572
|
showText: (vis?: boolean) => void;
|
|
531
|
-
readonly legalMark: import("./
|
|
573
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
532
574
|
isLegal: boolean;
|
|
533
575
|
initCont: (row: number, col: number) => void;
|
|
534
576
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -583,9 +625,11 @@ export declare class Table extends Dispatcher {
|
|
|
583
625
|
nextHex: (dir: import("./hex-intfs").HexDir, ns?: number) => import("./hex").Hex2 | undefined;
|
|
584
626
|
lastHex: (ds: import("./hex-intfs").HexDir) => import("./hex").Hex2;
|
|
585
627
|
radialDist: (hex: Hex) => number;
|
|
586
|
-
}>, row: number, col: number, name?: string
|
|
628
|
+
}>, row: number, col: number, name?: string) => void;
|
|
629
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
630
|
+
setDistText: (name?: string, size?: number) => void;
|
|
587
631
|
showText: (vis?: boolean) => void;
|
|
588
|
-
readonly legalMark: import("./
|
|
632
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
589
633
|
isLegal: boolean;
|
|
590
634
|
initCont: (row: number, col: number) => void;
|
|
591
635
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -667,7 +711,7 @@ export declare class Table extends Dispatcher {
|
|
|
667
711
|
*/
|
|
668
712
|
addDoneButton(cont?: Container, cx?: number, cy?: number, align?: string): Container;
|
|
669
713
|
/** show player player score on table */
|
|
670
|
-
setPlayerScore(plyr: Player, score
|
|
714
|
+
setPlayerScore(plyr: Player, score?: number, rank?: number): void;
|
|
671
715
|
/** update table when a new Game is started.
|
|
672
716
|
*
|
|
673
717
|
* default: [allTiles.makeDragable(); setNextPlayer(gamePlay.turnNumber)]
|
|
@@ -691,7 +735,7 @@ export declare class Table extends Dispatcher {
|
|
|
691
735
|
distColor: string;
|
|
692
736
|
distText: Text;
|
|
693
737
|
rcText: Text;
|
|
694
|
-
setUnit: (unit: Tile,
|
|
738
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
695
739
|
tile: Tile | undefined;
|
|
696
740
|
meep: import("./meeple").Meeple | undefined;
|
|
697
741
|
constructorCode: (map: HexM<{
|
|
@@ -709,12 +753,14 @@ export declare class Table extends Dispatcher {
|
|
|
709
753
|
distColor: string;
|
|
710
754
|
distText: Text;
|
|
711
755
|
rcText: Text;
|
|
712
|
-
setUnit: (unit: Tile,
|
|
756
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
713
757
|
tile: Tile | undefined;
|
|
714
758
|
meep: import("./meeple").Meeple | undefined;
|
|
715
759
|
constructorCode: any;
|
|
760
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
761
|
+
setDistText: (name?: string, size?: number) => void;
|
|
716
762
|
showText: (vis?: boolean) => void;
|
|
717
|
-
readonly legalMark: import("./
|
|
763
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
718
764
|
isLegal: boolean;
|
|
719
765
|
initCont: (row: number, col: number) => void;
|
|
720
766
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -769,9 +815,11 @@ export declare class Table extends Dispatcher {
|
|
|
769
815
|
nextHex: (dir: import("./hex-intfs").HexDir, ns?: number) => import("./hex").Hex2 | undefined;
|
|
770
816
|
lastHex: (ds: import("./hex-intfs").HexDir) => import("./hex").Hex2;
|
|
771
817
|
radialDist: (hex: Hex) => number;
|
|
772
|
-
}>, row: number, col: number, name?: string
|
|
818
|
+
}>, row: number, col: number, name?: string) => void;
|
|
819
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
820
|
+
setDistText: (name?: string, size?: number) => void;
|
|
773
821
|
showText: (vis?: boolean) => void;
|
|
774
|
-
readonly legalMark: import("./
|
|
822
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
775
823
|
isLegal: boolean;
|
|
776
824
|
initCont: (row: number, col: number) => void;
|
|
777
825
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -854,7 +902,7 @@ export declare class Table extends Dispatcher {
|
|
|
854
902
|
distColor: string;
|
|
855
903
|
distText: Text;
|
|
856
904
|
rcText: Text;
|
|
857
|
-
setUnit: (unit: Tile,
|
|
905
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
858
906
|
tile: Tile | undefined;
|
|
859
907
|
meep: import("./meeple").Meeple | undefined;
|
|
860
908
|
constructorCode: (map: HexM<{
|
|
@@ -872,12 +920,14 @@ export declare class Table extends Dispatcher {
|
|
|
872
920
|
distColor: string;
|
|
873
921
|
distText: Text;
|
|
874
922
|
rcText: Text;
|
|
875
|
-
setUnit: (unit: Tile,
|
|
923
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
876
924
|
tile: Tile | undefined;
|
|
877
925
|
meep: import("./meeple").Meeple | undefined;
|
|
878
926
|
constructorCode: any;
|
|
927
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
928
|
+
setDistText: (name?: string, size?: number) => void;
|
|
879
929
|
showText: (vis?: boolean) => void;
|
|
880
|
-
readonly legalMark: import("./
|
|
930
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
881
931
|
isLegal: boolean;
|
|
882
932
|
initCont: (row: number, col: number) => void;
|
|
883
933
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -932,9 +982,11 @@ export declare class Table extends Dispatcher {
|
|
|
932
982
|
nextHex: (dir: import("./hex-intfs").HexDir, ns?: number) => import("./hex").Hex2 | undefined;
|
|
933
983
|
lastHex: (ds: import("./hex-intfs").HexDir) => import("./hex").Hex2;
|
|
934
984
|
radialDist: (hex: Hex) => number;
|
|
935
|
-
}>, row: number, col: number, name?: string
|
|
985
|
+
}>, row: number, col: number, name?: string) => void;
|
|
986
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
987
|
+
setDistText: (name?: string, size?: number) => void;
|
|
936
988
|
showText: (vis?: boolean) => void;
|
|
937
|
-
readonly legalMark: import("./
|
|
989
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
938
990
|
isLegal: boolean;
|
|
939
991
|
initCont: (row: number, col: number) => void;
|
|
940
992
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -1026,7 +1078,7 @@ export declare class Table extends Dispatcher {
|
|
|
1026
1078
|
distColor: string;
|
|
1027
1079
|
distText: Text;
|
|
1028
1080
|
rcText: Text;
|
|
1029
|
-
setUnit: (unit: Tile,
|
|
1081
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
1030
1082
|
tile: Tile | undefined;
|
|
1031
1083
|
meep: import("./meeple").Meeple | undefined;
|
|
1032
1084
|
constructorCode: (map: HexM<{
|
|
@@ -1044,12 +1096,14 @@ export declare class Table extends Dispatcher {
|
|
|
1044
1096
|
distColor: string;
|
|
1045
1097
|
distText: Text;
|
|
1046
1098
|
rcText: Text;
|
|
1047
|
-
setUnit: (unit: Tile,
|
|
1099
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
1048
1100
|
tile: Tile | undefined;
|
|
1049
1101
|
meep: import("./meeple").Meeple | undefined;
|
|
1050
1102
|
constructorCode: any;
|
|
1103
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
1104
|
+
setDistText: (name?: string, size?: number) => void;
|
|
1051
1105
|
showText: (vis?: boolean) => void;
|
|
1052
|
-
readonly legalMark: import("./
|
|
1106
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
1053
1107
|
isLegal: boolean;
|
|
1054
1108
|
initCont: (row: number, col: number) => void;
|
|
1055
1109
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -1104,9 +1158,11 @@ export declare class Table extends Dispatcher {
|
|
|
1104
1158
|
nextHex: (dir: import("./hex-intfs").HexDir, ns?: number) => import("./hex").Hex2 | undefined;
|
|
1105
1159
|
lastHex: (ds: import("./hex-intfs").HexDir) => import("./hex").Hex2;
|
|
1106
1160
|
radialDist: (hex: Hex) => number;
|
|
1107
|
-
}>, row: number, col: number, name?: string
|
|
1161
|
+
}>, row: number, col: number, name?: string) => void;
|
|
1162
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
1163
|
+
setDistText: (name?: string, size?: number) => void;
|
|
1108
1164
|
showText: (vis?: boolean) => void;
|
|
1109
|
-
readonly legalMark: import("./
|
|
1165
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
1110
1166
|
isLegal: boolean;
|
|
1111
1167
|
initCont: (row: number, col: number) => void;
|
|
1112
1168
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -1186,7 +1242,7 @@ export declare class Table extends Dispatcher {
|
|
|
1186
1242
|
distColor: string;
|
|
1187
1243
|
distText: Text;
|
|
1188
1244
|
rcText: Text;
|
|
1189
|
-
setUnit: (unit: Tile,
|
|
1245
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
1190
1246
|
tile: Tile | undefined;
|
|
1191
1247
|
meep: import("./meeple").Meeple | undefined;
|
|
1192
1248
|
constructorCode: (map: HexM<{
|
|
@@ -1204,12 +1260,14 @@ export declare class Table extends Dispatcher {
|
|
|
1204
1260
|
distColor: string;
|
|
1205
1261
|
distText: Text;
|
|
1206
1262
|
rcText: Text;
|
|
1207
|
-
setUnit: (unit: Tile,
|
|
1263
|
+
setUnit: (unit: Tile, isMeep?: boolean) => void;
|
|
1208
1264
|
tile: Tile | undefined;
|
|
1209
1265
|
meep: import("./meeple").Meeple | undefined;
|
|
1210
1266
|
constructorCode: any;
|
|
1267
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
1268
|
+
setDistText: (name?: string, size?: number) => void;
|
|
1211
1269
|
showText: (vis?: boolean) => void;
|
|
1212
|
-
readonly legalMark: import("./
|
|
1270
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
1213
1271
|
isLegal: boolean;
|
|
1214
1272
|
initCont: (row: number, col: number) => void;
|
|
1215
1273
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -1264,9 +1322,11 @@ export declare class Table extends Dispatcher {
|
|
|
1264
1322
|
nextHex: (dir: import("./hex-intfs").HexDir, ns?: number) => import("./hex").Hex2 | undefined;
|
|
1265
1323
|
lastHex: (ds: import("./hex-intfs").HexDir) => import("./hex").Hex2;
|
|
1266
1324
|
radialDist: (hex: Hex) => number;
|
|
1267
|
-
}>, row: number, col: number, name?: string
|
|
1325
|
+
}>, row: number, col: number, name?: string) => void;
|
|
1326
|
+
setRcText: (row: number, col: number, rcf?: number) => void;
|
|
1327
|
+
setDistText: (name?: string, size?: number) => void;
|
|
1268
1328
|
showText: (vis?: boolean) => void;
|
|
1269
|
-
readonly legalMark: import("./
|
|
1329
|
+
readonly legalMark: import("./hex").LegalMark;
|
|
1270
1330
|
isLegal: boolean;
|
|
1271
1331
|
initCont: (row: number, col: number) => void;
|
|
1272
1332
|
makeHexShape: (shape?: Constructor<HexShape>) => HexShape;
|
|
@@ -1339,7 +1399,7 @@ export declare class Table extends Dispatcher {
|
|
|
1339
1399
|
*
|
|
1340
1400
|
* TablePlanner.logMove(); then dispatchEvent() --> gamePlay.doPlayerMove()
|
|
1341
1401
|
*
|
|
1342
|
-
* New: let
|
|
1402
|
+
* New: let Meeple (Drag & Drop) do this.
|
|
1343
1403
|
*/
|
|
1344
1404
|
doTableMove(ihex: IdHex): void;
|
|
1345
1405
|
/** All moves (GUI & plannerMove) feed through here:
|
package/dist/table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAS,WAAW,EAAe,EAAE,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAwC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAa,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAa,SAAS,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../src/table.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAS,WAAW,EAAe,EAAE,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAwC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAa,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAa,SAAS,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnO,OAAO,EAAE,SAAS,EAAE,aAAa,EAAY,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAElG,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAU,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;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C;IAClD,KAAK,EAAE,IAAI,CAAwD;IACnE;;;;;;;;;;OAUG;IACH,eAAe,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE;IAuB5D,kEAAkE;IAClE,UAAU,CAAC,EAAE,SAAM,EAAE,EAAE,GAAE,EAAmB,GAAG,MAAM;IAMrD,YAAY,CAAC,EAAE,SAAM,EAAE,EAAE;;;KAAiB;IAU1C,IAAI,CAAC,CAAC,SAAM;IAQZ,GAAG,CAAC,EAAE,EAAE,EAAE;IAKV;;;;;;OAMG;IACH,aAAa;CAWd;AACD,KAAK,IAAI,GAAG,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
package/dist/table.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AT, C, F, S, stime } from "@thegraid/common-lib";
|
|
2
|
-
import { afterUpdate, CenterText, CircleShape, Dispatcher, Dragger, KeyBinder, NamedContainer, ParamGUI, RectShape, ScaleableContainer } from "@thegraid/easeljs-lib";
|
|
2
|
+
import { afterUpdate, CenterText, CircleShape, Dispatcher, Dragger, KeyBinder, NamedContainer, ParamGUI, RectShape, ScaleableContainer, UtilButton } from "@thegraid/easeljs-lib";
|
|
3
3
|
import { Container, Graphics, Shape, Text } from "@thegraid/easeljs-module";
|
|
4
4
|
import { EBC, PidChoice } from "./choosers";
|
|
5
5
|
import { TileEvent } from "./game-play";
|
|
6
6
|
import { RecycleHex } from "./hex";
|
|
7
7
|
import { PlayerPanel } from "./player-panel";
|
|
8
|
-
import { HexShape
|
|
8
|
+
import { HexShape } from "./shapes";
|
|
9
9
|
import { playerColor0, playerColor1, TP } from "./table-params";
|
|
10
10
|
import { Tile } from "./tile";
|
|
11
11
|
/** to own file... */
|
|
@@ -128,7 +128,21 @@ export class Table extends Dispatcher {
|
|
|
128
128
|
logTurnPlayer(line) {
|
|
129
129
|
this.turnLog.log(line, 'table.logTurn', false); // in top two lines
|
|
130
130
|
}
|
|
131
|
-
|
|
131
|
+
/**
|
|
132
|
+
* also: enableHexInspector(this.undoCont)
|
|
133
|
+
*
|
|
134
|
+
* @param bgr bgRect
|
|
135
|
+
* @param row placement of UndoCont [8]
|
|
136
|
+
* @param col placement of UndoCont [-7]
|
|
137
|
+
*
|
|
138
|
+
* @param undoButtons [false] build the undo/redo buttons:
|
|
139
|
+
* @param xOffs offset to Red & Green arrows [55]
|
|
140
|
+
* @param bSize size of Red & Green arrows [60]
|
|
141
|
+
* @param skipRad size of Skip button/square [45]
|
|
142
|
+
*
|
|
143
|
+
* @returns
|
|
144
|
+
*/
|
|
145
|
+
setupUndoButtons(bgr, row = 8, col = -7, undoButtons = false, xOffs = 55, bSize = 60, skipRad = 45) {
|
|
132
146
|
const undoC = this.undoCont; // holds the undo buttons.
|
|
133
147
|
this.setToRowCol(undoC, row, col);
|
|
134
148
|
const progressBg = new Shape(), bgw = 200, bgym = 140, y0 = 0; // bgym = 240
|
|
@@ -137,7 +151,7 @@ export class Table extends Dispatcher {
|
|
|
137
151
|
undoC.addChildAt(progressBg, 0);
|
|
138
152
|
this.enableHexInspector();
|
|
139
153
|
this.dragger.makeDragable(undoC);
|
|
140
|
-
if (
|
|
154
|
+
if (!undoButtons)
|
|
141
155
|
return;
|
|
142
156
|
this.skipShape.graphics.f("white").dp(0, 0, 40, 4, 0, skipRad);
|
|
143
157
|
this.undoShape.graphics.f("red").dp(-xOffs, 0, bSize, 3, 0, 180);
|
|
@@ -333,7 +347,7 @@ export class Table extends Dispatcher {
|
|
|
333
347
|
hexCont.cache(x, y, width, height); // cache hexCont (bounded by bgr)
|
|
334
348
|
this.layoutTable2(); // supply args (mapCont?) if necessary;
|
|
335
349
|
this.makePerPlayer();
|
|
336
|
-
this.setupUndoButtons(
|
|
350
|
+
this.setupUndoButtons(xywh); // & enableHexInspector()
|
|
337
351
|
this.layoutTurnlog();
|
|
338
352
|
this.namedOn("playerMoveEvent", S.add, this.gamePlay.playerMoveEvent, this.gamePlay);
|
|
339
353
|
}
|
|
@@ -403,10 +417,12 @@ export class Table extends Dispatcher {
|
|
|
403
417
|
// TODO: dropdown to use given 'top' container!
|
|
404
418
|
scaleCont.stage.update();
|
|
405
419
|
}
|
|
420
|
+
/** height allocated for PlayerPanel scaled in hex height [map.rows/3-.2] */
|
|
406
421
|
get panelHeight() { return (2 * TP.nHexes - 1) / 3 - .2; }
|
|
407
|
-
|
|
422
|
+
/** width of PlayerPanel, scaled in hex width [4.5] */
|
|
423
|
+
get panelWidth() { return 4.5; }
|
|
408
424
|
/**
|
|
409
|
-
*
|
|
425
|
+
* Center of each Panel location: [row, col, dir][].
|
|
410
426
|
*
|
|
411
427
|
* col==0 is on left edge of hexMap; The *center* hex is col == (nHexes-1)
|
|
412
428
|
* @example
|
|
@@ -415,17 +431,18 @@ export class Table extends Dispatcher {
|
|
|
415
431
|
* P2 --- P5
|
|
416
432
|
*/
|
|
417
433
|
getPanelLocs() {
|
|
418
|
-
const
|
|
419
|
-
const cc = this.hexMap.centerHex.col, coff = this.
|
|
420
|
-
|
|
434
|
+
const rC = this.hexMap.centerHex.row, ph = this.panelHeight + .2;
|
|
435
|
+
const cc = this.hexMap.centerHex.col, coff = TP.nHexes + (this.panelWidth / 2);
|
|
436
|
+
// Left of map (dir: +1), Right of map (dir: -1)
|
|
437
|
+
const cL = cc - coff, cR = cc + coff;
|
|
421
438
|
const locs = [
|
|
422
|
-
[
|
|
423
|
-
[
|
|
439
|
+
[rC - ph, cL, +1], [rC, cL, +1], [rC + ph, cL, +1],
|
|
440
|
+
[rC - ph, cR, -1], [rC, cR, -1], [rC + ph, cR, -1]
|
|
424
441
|
];
|
|
425
442
|
return locs;
|
|
426
443
|
}
|
|
427
444
|
/**
|
|
428
|
-
* Which PanelLocs to use for a given number of Players
|
|
445
|
+
* Which PanelLocs to use (in order) for a given number of Players
|
|
429
446
|
* @param np number of Players
|
|
430
447
|
* @returns array of indices into PanelLocs (one for each Player)
|
|
431
448
|
*/
|
|
@@ -439,22 +456,38 @@ export class Table extends Dispatcher {
|
|
|
439
456
|
* @param panelLocs [getPanelLocs] potential panel locations
|
|
440
457
|
* @return panelLocs[panelLocsForNp(nPlayers)][pIndex]
|
|
441
458
|
*/
|
|
442
|
-
panelLoc(pIndex, nPlayers =
|
|
443
|
-
const
|
|
444
|
-
const
|
|
459
|
+
panelLoc(pIndex, nPlayers = TP.numPlayers, panelLocs = this.getPanelLocs()) {
|
|
460
|
+
const np = Math.min(nPlayers, TP.maxPlayers, panelLocs.length);
|
|
461
|
+
const locs = this.panelLocsForNp(np);
|
|
462
|
+
const ndx = locs[Math.min(pIndex, np - 1)];
|
|
445
463
|
return panelLocs[ndx];
|
|
446
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
*
|
|
467
|
+
* @param table
|
|
468
|
+
* @param player
|
|
469
|
+
* @param high panelHeight
|
|
470
|
+
* @param wide adjust to suit
|
|
471
|
+
* @param row from panelLoc
|
|
472
|
+
* @param col from panelLoc
|
|
473
|
+
* @param dir from panelLoc
|
|
474
|
+
* @returns new PlayerPanel(table, player, high, wide, row - high / 2, col - wide / 2, dir)
|
|
475
|
+
*/
|
|
476
|
+
makePlayerPanel(table, player, high, wide, row, col, dir = -1) {
|
|
477
|
+
return new PlayerPanel(table, player, high, wide, row - high / 2, col - wide / 2, dir);
|
|
478
|
+
}
|
|
447
479
|
allPlayerPanels = [];
|
|
448
480
|
/** make player panels, placed at panelLoc... */
|
|
449
481
|
makePerPlayer() {
|
|
450
482
|
this.allPlayerPanels.length = 0; // TODO: maybe deconstruct
|
|
451
|
-
const high = this.panelHeight, wide =
|
|
452
|
-
const
|
|
483
|
+
const high = this.panelHeight, wide = this.panelWidth;
|
|
484
|
+
const locs = this.getPanelLocs();
|
|
453
485
|
this.gamePlay.forEachPlayer((player, pIndex) => {
|
|
454
|
-
const [row, col, dir] = this.panelLoc(pIndex,
|
|
455
|
-
|
|
486
|
+
const [row, col, dir] = this.panelLoc(pIndex, TP.numPlayers, locs);
|
|
487
|
+
const panel = this.makePlayerPanel(this, player, high, wide, row, col, dir);
|
|
488
|
+
this.allPlayerPanels[pIndex] = player.panel = panel;
|
|
456
489
|
player.makePlayerBits();
|
|
457
|
-
this.setPlayerScore(player
|
|
490
|
+
this.setPlayerScore(player);
|
|
458
491
|
});
|
|
459
492
|
}
|
|
460
493
|
/** move cont to nominal [row, col] of hexCont */
|
|
@@ -472,12 +505,14 @@ export class Table extends Dispatcher {
|
|
|
472
505
|
cont.y = yy;
|
|
473
506
|
}
|
|
474
507
|
}
|
|
508
|
+
/** display source [and legalMark] on given hex [Ankh] */
|
|
475
509
|
sourceOnHex(source, hex) {
|
|
476
510
|
if (source?.counter)
|
|
477
511
|
source.counter.mouseEnabled = false;
|
|
478
512
|
hex.legalMark.setOnHex(hex);
|
|
479
513
|
hex.cont.visible = false;
|
|
480
514
|
}
|
|
515
|
+
/** @deprecated use UtilButton (change cgf on RectShape) [legacy from Ankh] */
|
|
481
516
|
makeCircleButton(color = C.WHITE, rad = TP.hexRad / 3, c, fs = rad * 3 / 2) {
|
|
482
517
|
const button = new Container();
|
|
483
518
|
button.name = 'circle';
|
|
@@ -492,6 +527,7 @@ export class Table extends Dispatcher {
|
|
|
492
527
|
button.mouseEnabled = false;
|
|
493
528
|
return button;
|
|
494
529
|
}
|
|
530
|
+
/** @deprecated use UtilButton [from Ankh] */
|
|
495
531
|
makeSquareButton(color = C.WHITE, xywh, c, fs = TP.hexRad / 2) {
|
|
496
532
|
const button = new Container();
|
|
497
533
|
button.name = 'square';
|
|
@@ -505,6 +541,7 @@ export class Table extends Dispatcher {
|
|
|
505
541
|
shape.mouseEnabled = false;
|
|
506
542
|
return button;
|
|
507
543
|
}
|
|
544
|
+
/** @deprecated [legacy from hextowns] */
|
|
508
545
|
makeRecycleHex(row = TP.nHexes + 3.2, col = 0, claz = RecycleHex) {
|
|
509
546
|
const name = 'Recycle';
|
|
510
547
|
const image = new Tile(name).addImageBitmap(name); // ignore Tile, get image.
|
|
@@ -570,7 +607,8 @@ export class Table extends Dispatcher {
|
|
|
570
607
|
TP.networkGroup;
|
|
571
608
|
gui.spec("Network").onChange = (item) => {
|
|
572
609
|
if (['new', 'join', 'ref'].includes(item.value)) {
|
|
573
|
-
const
|
|
610
|
+
const chooser = gui.findLine('networkGroup').chooser;
|
|
611
|
+
const group = chooser.editBox.innerText;
|
|
574
612
|
// this.gamePlay.closeNetwork()
|
|
575
613
|
// this.gamePlay.network(item.value, gui, group)
|
|
576
614
|
}
|
|
@@ -578,8 +616,8 @@ export class Table extends Dispatcher {
|
|
|
578
616
|
};
|
|
579
617
|
this.stage.canvas?.parentElement?.addEventListener('paste', (ev) => {
|
|
580
618
|
const text = ev.clipboardData?.getData('Text');
|
|
581
|
-
;
|
|
582
|
-
|
|
619
|
+
const chooser = gui.findLine('networkGroup').chooser;
|
|
620
|
+
chooser.setValue(text);
|
|
583
621
|
});
|
|
584
622
|
this.showNetworkGroup();
|
|
585
623
|
parent.addChild(gui);
|
|
@@ -614,7 +652,7 @@ export class Table extends Dispatcher {
|
|
|
614
652
|
doneButton.name = 'doneButton';
|
|
615
653
|
doneButton.x = cx - 0; // XY is the top-right corner, align extends to left
|
|
616
654
|
doneButton.y = cy - y; // XY is the top-right corner, align extends to left
|
|
617
|
-
doneButton.on(S.click, this.doneClicked, this);
|
|
655
|
+
doneButton.on(S.click, (evt) => this.doneClicked(evt), this);
|
|
618
656
|
cont.addChild(doneButton);
|
|
619
657
|
// prefix advice: set text color to contrast with RectShape color
|
|
620
658
|
// TODO: add as option to UtilButton
|
|
@@ -628,7 +666,7 @@ export class Table extends Dispatcher {
|
|
|
628
666
|
return cont;
|
|
629
667
|
}
|
|
630
668
|
/** show player player score on table */
|
|
631
|
-
setPlayerScore(plyr, score, rank) {
|
|
669
|
+
setPlayerScore(plyr, score = 0, rank) {
|
|
632
670
|
}
|
|
633
671
|
/** update table when a new Game is started.
|
|
634
672
|
*
|
|
@@ -832,7 +870,7 @@ export class Table extends Dispatcher {
|
|
|
832
870
|
*
|
|
833
871
|
* TablePlanner.logMove(); then dispatchEvent() --> gamePlay.doPlayerMove()
|
|
834
872
|
*
|
|
835
|
-
* New: let
|
|
873
|
+
* New: let Meeple (Drag & Drop) do this.
|
|
836
874
|
*/
|
|
837
875
|
doTableMove(ihex) {
|
|
838
876
|
}
|