How rs-gty/peg-solitaire works
Peg Solitaire is a small graphical game: the user clicks a peg and then an empty cell to attempt a jump. The application initializes the grid and window, registers mouse callbacks, and runs the window event loop. Window translates mouse coordinates and dispatches registered events; the selection callback updates grid state and clears the moved-from and jumped-over cells, while the window redraws pegs and checks for closure. The excerpts show these runtime relationships; the README is empty, so no additional documented capabilities are available.
Main entry points: Window.cpp Window Loop · Grid.cpp Peg Grid · main.cpp Game Entry · Event.cpp Event Registry
Components 9
Application
- Game Entry
Peg Solitaire/main.cpp - Selection Callback
Peg Solitaire/main.cpp
Input and Events
- Mouse Mapping
Peg Solitaire/Window.cpp - Event Registry
Peg Solitaire/Event.cpp
Game State
- Peg Grid
Peg Solitaire/Grid.cpp
Window Display
- Window Loop
Peg Solitaire/Window.cpp - Grid and Peg Drawing
Peg Solitaire/Window.cpp
Other components
- Player
- EasyX Graphics
Connections 13
- Player → Window Loop: sends mouse input
Peg Solitaire/Window.cpp - Game Entry → Window Loop: starts and listens
Peg Solitaire/main.cpp - Game Entry → Peg Grid: creates grid
Peg Solitaire/main.cpp - Game Entry → Event Registry: registers callbacks
Peg Solitaire/main.cpp - Window Loop → Mouse Mapping: maps coordinates
Peg Solitaire/Window.cpp - Window Loop → Peg Grid: sets mouse position
Peg Solitaire/Window.cpp - Window Loop → Event Registry: triggers events
Peg Solitaire/Window.cpp - Event Registry → Selection Callback: invokes callback
Peg Solitaire/Event.cpp - Selection Callback → Peg Grid: selects and moves
Peg Solitaire/main.cpp - Selection Callback → Window Loop: clears moved cells
Peg Solitaire/main.cpp - Window Loop → Grid and Peg Drawing: draws each loop
Peg Solitaire/Window.cpp - Grid and Peg Drawing → Peg Grid: reads peg state
Peg Solitaire/Window.cpp - Window Loop → EasyX Graphics: draws graphics
Peg Solitaire/Window.cpp