Skip to content

Multigame stage1a#568

Open
JeffML wants to merge 10 commits into
jhlywa:masterfrom
JeffML:multigameStage1a
Open

Multigame stage1a#568
JeffML wants to merge 10 commits into
jhlywa:masterfrom
JeffML:multigameStage1a

Conversation

@JeffML
Copy link
Copy Markdown
Contributor

@JeffML JeffML commented Oct 5, 2025

This encapsulates all game-related methods and state to Game.ts. Constants and other shared state moved to types.js.

This is a backward-compatible refactoring of Chess.js; Chess methods now delegate to a Game instance where warranted.

If this PR is accepted, then I can proceed to Stage 2: multi-game PGN support for chess.js

@JeffML
Copy link
Copy Markdown
Contributor Author

JeffML commented Oct 5, 2025

#561

@neofight78
Copy link
Copy Markdown
Collaborator

I've not looked at it in detail yet but these are my initial thoughts:

  • types.ts - Bit of a nit pick, but this has constants and functions too. I'd call it common.ts or something more generic. But the idea is good / essential. I've had to do the same when work on my RAV POC.
  • Move.ts - Yep, good call to pull this out into it's own file. I'd prefer to keep the filenames all lowercase though (sorry, another nitpick).
  • Game.ts - This one I'm not so sure about. Keeping the Chess class as essentially the game object and splitting out board state, and adding something new to represent a PGN feels like a more natural direction to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants