From 42156c76559b866ed413a8d104afea48e31f1dbd Mon Sep 17 00:00:00 2001 From: Aaron Dalton Date: Thu, 21 Oct 2021 08:46:52 -0600 Subject: [PATCH] API documented, and repo prepped for 0.1.0 release --- CHANGELOG.md | 4 +- README.md | 3 ++ docs/api.md | 102 +++++++++++++++++++++++++++++++++++++++++++ src/games/_base.ts | 15 +++++-- src/games/amazons.ts | 3 +- src/games/blam.ts | 5 ++- src/games/cannon.ts | 3 +- src/games/index.ts | 4 +- src/games/mchess.ts | 3 +- src/index.ts | 5 ++- 10 files changed, 133 insertions(+), 14 deletions(-) create mode 100644 docs/api.md diff --git a/CHANGELOG.md b/CHANGELOG.md index bf0e5786..7cdd7110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.1.0] - 2021-10-21 ### Added -- Support library for rectangular grids created. - The game "Amazons" has been implemented, including a rudimentary and very slow AI. - The game "Blam!" has been implemented, including a rudimentary AI. - The game "Cannon" has been implemented, including a rudimentary AI. - The game "Martian Chess" (2-player only, including "Of Knights and Kings" variant) has been implemented, including a rudimentary AI. - Playground added. +- Public API documented diff --git a/README.md b/README.md index 17fa1410..737369db 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ # Abstract Play Games Library + TypeScript implementations of the core Abstract Play games, intended to be wrapped by the front- and backends. ## Contributing +Currently all Abstract Play games must be coded in TypeScript and included in this library. Eventually externally hosted games will hopefully be supported. Until then, pull requests are welcome. ## Contact @@ -18,3 +20,4 @@ This is a basic NPM module; it's just private. It's not meant to be generally us - `npm run test` (makes sure everything is working) - `npm run build` (compiles the TypeScript files into the `./build` folder) - `npm run dist-dev` (or `dist-prod` if you want it minified; bundles everything for the browser into the `./dist` folder) +- The public-facing API is documented in `./docs/api.md`. diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 00000000..2ebf9c82 --- /dev/null +++ b/docs/api.md @@ -0,0 +1,102 @@ +# Games Library API + +All of Abstract Play's internal games exist within this single Node project. This document describes the public-facing API that can be used by the browser and the API to interact with the game code. For concrete examples, see `playground/index.html`. + +This document only looks at the public interface—the relatively small selection of variables and functions exported by the root module. Documentation for games developers will come later. + +The AI code in this library is for testing only. It is not ready for release and is not documented here yet. + +## Usage + +In the browser, simply load `APGames.js` via a `