2.2.1 • Published 5 months ago
@nodots-llc/backgammon-types v2.2.1
@nodots-llc/backgammon-types
Type definitions for the nodots-backgammon project. This package provides TypeScript type definitions and interfaces for representing backgammon game states, moves, and related functionality.
Overview
This package contains TypeScript type definitions for:
- Game state and management
- Board representation
- Checker movements and positions
- Dice rolls and cube decisions
- Player information and states
- Move validation and game rules
- Game offers and decisions
Installation
Install the package from npm:
npm install @nodots-llc/backgammon-typesProject Structure
The type definitions are organized into the following modules:
board.ts- Board state and position typeschecker.ts- Checker representation and movementcheckercontainer.ts- Container management for checkerscube.ts- Doubling cube related typesdice.ts- Dice roll types and validationgame.ts- Core game state and managementmove.ts- Move representation and validationoffer.ts- Game offers (double, resign, etc.)pip.ts- Pip counting and managementplay.ts- Play action types and validationplayer.ts- Player state and management
Usage
Import the types you need in your TypeScript files:
import { Game, Move, Player, Board } from '@nodots-llc/backgammon-types'Development
Prerequisites
- Node.js (Latest LTS recommended)
- npm
Setup
- Clone the repository
- Install dependencies:
npm install
Building
To compile the TypeScript files:
npm run buildThis will generate the compiled JavaScript and type definition files in the dist directory.
Scripts
npm run build- Compiles the TypeScript codenpm run prepare- Runs automatically before the package is packed or installed
License
MIT License - See LICENSE file for details
Author
Ken Riley kenr@nodots.com