How chimpirilin/desmoche works
This repository implements a browser-based card game with a React board and automated players. The principal workflow mounts the board, creates a game model, and starts a game state machine; turns are then dispatched through bot-turn logic, which draws, optionally melds, and discards while coordinating card animations. The model layer owns players, cards, deck and discard state, and meld piles. The README is only a TODO, so game rules beyond the sampled behavior and the purpose of the event/controller modules are unclear; those modules are omitted rather than assigned speculative roles.
Main entry points: botTurnFsm.ts Bot turn machine · GameArea.tsx Game board · Game.ts Game model · Card.ts Card type
Components 19
Game interface
- App shell
src/App.tsx - Game board
src/component/GameArea.tsx - Player cards
src/component/PlayerCards.tsx - Meld display
src/component/MeldsPile.tsx - Deck and discard
src/component/DeckAndDiscardPile.tsx
Turn orchestration
- Game machine
src/finite_state_machines/gameFsm.ts - Bot turn machine
src/finite_state_machines/botTurnFsm.ts
Game domain
- Game model
src/models/Game.ts - Bot strategy
src/models/BotPlayer.ts - Player state
src/models/Player.ts - Card deck
src/models/Deck.ts - Discard pile
src/models/DiscardPile.ts - Meld piles
src/models/MeldPile.ts - Card type
src/models/Card.ts
Card animations
- Deck draw
src/animations/draw_from_deck.ts - Discard animation
src/animations/discard.ts - Discard draw
src/animations/draw_from_discard_pile.ts - Meld animation
src/animations/meld.ts
Other components
- Player
Connections 30
- Player → App shell: opens
- App shell → Game board: renders
src/App.tsx - Game board → Game model: creates
src/component/GameArea.tsx - Game board → Game machine: creates
src/component/GameArea.tsx - Game board → Player cards: renders
src/component/GameArea.tsx - Game board → Meld display: renders
src/component/GameArea.tsx - Game board → Deck and discard: renders
src/component/GameArea.tsx - Game machine → Bot turn machine: starts turns
src/finite_state_machines/gameFsm.ts - Game machine → Game model: uses game
src/finite_state_machines/gameFsm.ts - Bot turn machine → Bot strategy: runs strategy
src/finite_state_machines/botTurnFsm.ts - Bot turn machine → Game model: updates first play
src/finite_state_machines/botTurnFsm.ts - Bot turn machine → Deck draw: animates draw
src/finite_state_machines/botTurnFsm.ts - Bot turn machine → Discard animation: animates discard
src/finite_state_machines/botTurnFsm.ts - Bot turn machine → Discard draw: animates pickup
src/finite_state_machines/botTurnFsm.ts - Bot turn machine → Meld animation: animates meld
src/finite_state_machines/botTurnFsm.ts - Game model → Card deck: creates
src/models/Game.ts - Game model → Discard pile: creates
src/models/Game.ts - Game model → Bot strategy: creates players
src/models/Game.ts - Bot strategy → Player state: extends
src/models/BotPlayer.ts - Bot strategy → Meld piles: manages melds
src/models/BotPlayer.ts - Player state → Card deck: draws from
src/models/Player.ts - Player state → Discard pile: discards to
src/models/Player.ts - Player state → Meld piles: holds piles
src/models/Player.ts - Card deck → Card type: stores
src/models/Deck.ts - Discard pile → Card type: stores
src/models/DiscardPile.ts - Meld piles → Card type: stores
src/models/MeldPile.ts - Deck draw → Card type: displays
src/animations/draw_from_deck.ts - Discard animation → Card type: animates
src/animations/discard.ts - Discard draw → Card type: animates
- Meld animation → Meld display: targets display