Skip to content

Commit a0b3483

Browse files
committed
Merge branch 'develop'
2 parents cac8bba + d5a0b2d commit a0b3483

9 files changed

Lines changed: 566 additions & 12 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ to keep eslint happy.
3838
To test any new code (before you deploy to the dev server) you can use the playground:
3939
From the gameslib\playground folder:
4040
- `npm run dist-dev`
41-
- `cp ..\dist\APGames.js .`
41+
- `cp ..\dist\APGames.min.js .`
4242
- Also run `npm run dist-dev` in the renderer folder.
43-
- `cp ..\..\renderer\dist\APRender.js .`
43+
- `cp ..\..\renderer\dist\APRender.min.js .`
4444
Now simply double click 'index.html'.

docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The AI code in this library is for testing only. It is not ready for release and
88

99
## Usage
1010

11-
In the browser, simply load `APGames.js` via a `<script>` tag. From within Node, simply import the variables and functions you need. Both methods give you access to the same API.
11+
In the browser, simply load `APGames.min.js` via a `<script>` tag. From within Node, simply import the variables and functions you need. Both methods give you access to the same API.
1212

1313
## API
1414

locales/en/apgames.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
"rootbound": "In Root Bound, two groups of ‘plants’ spread in lifelike ways and vie for control of territory as space for new growth rapidly dwindles.",
180180
"saltire": "Connect your two opposite sides of the board by placing stones and swapping pairs of orthogonally or diagonally adjacent stones. A swap must decrease either the number of crosscuts or the number of supercuts on the board, and it must not increase the number of crosscuts.",
181181
"scaffold": "Scaffold is a drawless connection game played on the intersections of a square grid using stones (as in Go). Black is trying to connect N-S edges of the board, White E-W with an orthogonally connected group. On your turn, place a stone of your color on an empty point. Then, if possible, place a stone of your color on an empty point that is orthogonally adjacent to two groups of your color, and keep making such placements until no more are possible.",
182+
"sentinel": "A vigil game using a sowing mechanism with stacks. A vigil game is one where some board position must always be on line-of-sight with some or all of the player's pieces. In Sentinel, players are required to see the board center at the end of each one of their turns.",
182183
"shifty": "A connection game where you either place a piece orthogonally adjacent to a friendly piece, or move one of your pieces orthogonally adjacent to a friendly piece, by a chess queen's move, to a location not orthogonally adjacent to any other friendly pieces. Crosscuts are illegal. The player that forms an orthogonal or diagonal path connecting their two sides wins.",
183184
"siegeofj": "Place cards, representing armies, to exert pressure on segments of the wall around the city of Jacynth. Exert the most pressure on the most segments to win.",
184185
"slither": "Square-board connection game with updated rules from 2018. Optionally move a piece and then place a piece, such that no two pieces of a colour are diagonally adjacent to each other unless they are orthogonally connected by a like-coloured stone. In Advanced Slither, a piece may only move if it is part of a contiguous orthogonal group consisting of pieces of both colours.",
@@ -2320,6 +2321,11 @@
23202321
"name": "Larger 25x25 board"
23212322
}
23222323
},
2324+
"sentinel": {
2325+
"#board": {
2326+
"name": "9x9 board"
2327+
}
2328+
},
23232329
"shifty": {
23242330
"#board": {
23252331
"name": "9x9 board"
@@ -5546,6 +5552,15 @@
55465552
"INITIAL_INSTRUCTIONS": "Select a point to place a piece.",
55475553
"INVALID_MOVES": "This sequence of moves {{moves}} is invalid."
55485554
},
5555+
"sentinel": {
5556+
"INITIAL_INSTRUCTIONS": "Move a piece forward or sow a stack on any direction. The center cannot be crossed over. Captures are by replacement.",
5557+
"EDGE_INSTRUCTIONS": "Move the piece one step forward (orthogonally or diagonally). The piece can be moved out of the board by clicking at the center.",
5558+
"PIECE_INSTRUCTIONS": "Move the piece one step forward (orthogonally or diagonally).",
5559+
"STACK_INSTRUCTIONS": "Sow the stack in any direction provided there's space to place all of its pieces (plus one). It is illegal to create un-sowable stacks. Captures are by replacement.",
5560+
"INVALID_CENTER": "It is illegal to move or sow over the board center!",
5561+
"NO_STACK_TURN_3": "Notice that the first player cannot make a stack in his second move.",
5562+
"MOVE_INSTRUCTIONS": "First, click on a friendly piece."
5563+
},
55495564
"shifty": {
55505565
"INITIAL_INSTRUCTIONS": "Select an intersection to place a piece next to one of your own pieces, or select a piece to move.",
55515566
"INITIAL_INSTRUCTIONS_OPENING": "Select an intersection to place your first piece.",

playground/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
To use this in your own environment, build the `APRender.js` and `APGames.js` bundles
2+
To use this in your own environment, build the `APRender.js` and `APGames.min.js` bundles
33
and put them and this HTML file somewhere a browser can see it.
44
-->
55
<html lang="en">
@@ -8,7 +8,7 @@
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<title>AP Game Tester</title>
1010
<script src="https://renderer.dev.abstractplay.com/APRender.min.js"></script>
11-
<script src="./APGames.js"></script>
11+
<script src="./APGames.min.js"></script>
1212
<script src=" https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js"></script>
1313
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.1/mini-default.min.css">
1414
<script type="text/javascript">

playground/playground.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
To use this in your own environment, build the `APRender.js` and `APGames.js` bundles
2+
To use this in your own environment, build the `APRender.js` and `APGames.min.js` bundles
33
and put them and this HTML file somewhere a browser can see it.
44
-->
55
<html lang="en">
@@ -8,7 +8,7 @@
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99
<title>AP Game Tester</title>
1010
<script src="https://renderer.dev.abstractplay.com/APRender.min.js"></script>
11-
<script src="./APGames.js"></script>
11+
<script src="./APGames.min.js"></script>
1212
<script type="module" src="https://cdn.jsdelivr.net/npm/vanilla-colorful@0.8.0/hex-color-picker.js"></script>
1313
<script src=" https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js"></script>
1414
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

src/games/abande.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export class AbandeGame extends GameBase {
3838
description: "apgames:descriptions.abande",
3939
urls: [
4040
"https://spielstein.com/games/abande/rules",
41+
"https://spielstein.com/games/abande/rules/libre",
4142
"https://boardgamegeek.com/boardgame/21324/abande",
4243
"https://boardgamegeek.com/boardgameexpansion/57291/abande2",
4344
],
@@ -511,7 +512,7 @@ export class AbandeGame extends GameBase {
511512
return result;
512513
}
513514
// You can't move until there are four stones on the board
514-
if (this.board.size < 4) {
515+
if ([...this.board.values()].flat().length < 4) {
515516
result.valid = false;
516517
result.message = i18next.t("apgames:validation.abande.TOOEARLY_libre");
517518
return result;

src/games/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ import { GoGame, IGoState } from "./go";
233233
import { StilettoGame, IStilettoState } from "./stiletto";
234234
import { BTTGame, IBTTState } from "./btt";
235235
import { MinefieldGame, IMinefieldState } from "./minefield";
236+
import { SentinelGame, ISentinelState } from "./sentinel";
236237

237238
export {
238239
APGamesInformation, GameBase, GameBaseSimultaneous, IAPGameState,
@@ -469,6 +470,7 @@ export {
469470
StilettoGame, IStilettoState,
470471
BTTGame, IBTTState,
471472
MinefieldGame, IMinefieldState,
473+
SentinelGame, ISentinelState,
472474
};
473475

474476
const games = new Map<string, typeof AmazonsGame | typeof BlamGame | typeof CannonGame |
@@ -550,7 +552,7 @@ const games = new Map<string, typeof AmazonsGame | typeof BlamGame | typeof Cann
550552
typeof BambooGame | typeof PluralityGame | typeof CrosshairsGame |
551553
typeof MagnateGame | typeof ProductGame | typeof OonpiaGame |
552554
typeof GoGame | typeof StilettoGame | typeof BTTGame |
553-
typeof MinefieldGame
555+
typeof MinefieldGame | typeof SentinelGame
554556
>();
555557
// Manually add each game to the following array
556558
[
@@ -586,7 +588,7 @@ const games = new Map<string, typeof AmazonsGame | typeof BlamGame | typeof Cann
586588
SiegeOfJGame, StairsGame, EmuGame, DeckfishGame, BluestoneGame, SunspotGame, StawvsGame,
587589
LascaGame, EmergoGame, FroggerGame, ArimaaGame, RampartGame, KrypteGame, EnsoGame, RincalaGame,
588590
WaldMeisterGame, WunchunkGame, BambooGame, PluralityGame, CrosshairsGame, MagnateGame,
589-
ProductGame, OonpiaGame, GoGame, StilettoGame, BTTGame, MinefieldGame,
591+
ProductGame, OonpiaGame, GoGame, StilettoGame, BTTGame, MinefieldGame, SentinelGame
590592
].forEach((g) => {
591593
if (games.has(g.gameinfo.uid)) {
592594
throw new Error("Another game with the UID '" + g.gameinfo.uid + "' has already been used. Duplicates are not allowed.");
@@ -1064,6 +1066,8 @@ export const GameFactory = (game: string, ...args: any[]): GameBase|GameBaseSimu
10641066
return new BTTGame(args[0], ...args.slice(1));
10651067
case "minefield":
10661068
return new MinefieldGame(...args);
1069+
case "sentinel":
1070+
return new SentinelGame(...args);
10671071
}
10681072
return;
10691073
}

0 commit comments

Comments
 (0)