-
Notifications
You must be signed in to change notification settings - Fork 1
Feat additional features #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat-chess-game-example
Are you sure you want to change the base?
Conversation
…y, and check detection - Implemented time control management for chess games, allowing for various time settings (bullet, blitz, rapid, classic). - Added move history tracking to record each move made during the game, including details like captured pieces and check status. - Introduced check detection service to determine if a king is in check, checkmate, or stalemate. - Updated piece validation to include castling and en passant rules. - Enhanced the ChessApi and OnlineChessApi services to support undo functionality and move history retrieval. - Refactored game state management to accommodate new features, ensuring backward compatibility.
…ove history panel
|
@ggleyzer a new PR and I'm having trouble with the dates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR substantially upgrades the chess-game project with full chess rules, online multiplayer (including chat), per-tab single-player sessions, and a more sophisticated AI, plus corresponding UI and backend refactors.
Changes:
- Frontend: Adds a time-control bar, modernized chat UI, and layout tweaks, including a left-side chat drawer and integration with new backend APIs.
- Backend: Extends the data model (castling rights, en passant, move history, time control, per-session games), implements full rule enforcement (check/checkmate/stalemate, castling, en passant), and modularizes APIs for single-player, online play, chat, and time control.
- Documentation: Rewrites README and server module wiring to reflect the new architecture, endpoints, and capabilities.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| chess-game/webapp/public/static/styles.css | Adds styling for the new time-control bar, left-side slide panel, and a fully redesigned chat UI to support modern multiplayer UX. |
| chess-game/webapp/public/static/app.js | Integrates per-tab single-player session IDs, wires the frontend to new REST routes, introduces client-side time control handling, improves online state handling, and enhances chat polling/rendering. |
| chess-game/webapp/public/index.html | Adds the visible time-control bar and switches the chat drawer to a left-side slide panel, aligning markup with new UI components. |
| chess-game/server/chessDB/main/x/chessDB.x | Extends the schema with castling rights, move history, time control, half-move clocks, per-session single-player games, and richer online game metadata (including opponent-left tracking). |
| chess-game/server/chess/main/x/chess/ValidMovesHelper.x | Updates valid-move generation to accept castling rights and en passant targets and filters out moves that would leave the king in check. |
| chess-game/server/chess/main/x/chess/TimeControlService.x | Introduces a service for creating and updating TimeControl objects, including common presets, though it is not yet fully integrated into game flow. |
| chess-game/server/chess/main/x/chess/PieceValidator.x | Refactors piece-type helpers, adds en passant support for pawns, and implements castling logic for kings using CastlingRights. |
| chess-game/server/chess/main/x/chess/OnlineChessLogic.x | Propagates new GameRecord fields into OnlineGame, adds opponent-left tracking, and builds richer API state objects for online clients. |
| chess-game/server/chess/main/x/chess/OnlineChessApi.x | Extends online endpoints to support time-control configuration on room creation, respects castling/en passant in valid-moves queries, and marks players as having left games instead of deleting rooms outright. |
| chess-game/server/chess/main/x/chess/ChessGame.x | Centralizes game state updates to include castling rights, en passant, history, and accurate status via CheckDetection, and enriches move notation. |
| chess-game/server/chess/main/x/chess/ChessApi.x | Reworks single-player API to be per-session (browser tab) with separate game storage, and adjusts opponent-move scheduling over per-session pending maps. |
| chess-game/server/chess/main/x/chess/ChessAI.x | Replaces the simple heuristic AI with a materially and positionally aware evaluator, pseudo-randomized among top moves, plus a basic opening book. |
| chess-game/server/chess/main/x/chess/CheckDetection.x | Introduces full check, checkmate, and stalemate detection utilities, including legal-move enumeration that respects castling rights and en passant. |
| chess-game/server/chess/main/x/chess/ChatApi.x | Implements room-scoped chat send/history/recent endpoints, now using a monotonic counter for ordering rather than true timestamps. |
| chess-game/server/chess/main/x/chess.x | Updates top-level module wiring, refines chat request/response contracts, and splits static content routing between root and /static. |
| chess-game/README.md | Thoroughly updates documentation to describe the new architecture, modes, endpoints, AI behavior, session isolation, and (intended) time control support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ggleyzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please go over all your classes and replace the service with class for functional classes that have no state and only contain static methods
|
|
… improved accuracy
This pull request significantly updates the
chess-gameproject, enhancing both its features and architecture. The most notable improvements are the addition of a robust online multiplayer mode with real-time chat, a more sophisticated AI opponent, implementation of complete chess rules (including castling, en passant, and check/checkmate detection), and a modularization of the backend codebase. The documentation (README.md) has been thoroughly rewritten to reflect these new capabilities, and a newCheckDetectionmodule is introduced for accurate endgame logic.Major Feature Additions
Backend Architecture and API Improvements
ChessApi,ChessGame,ChessAI,CheckDetection,OnlineChessApi,ChatApi, etc.) for maintainability and scalability. [1] [2] [3]Technical and Usability Enhancements
These changes make the project a much more complete and realistic chess application, suitable for both solo and competitive online play.
References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]