How adelinchelariu/battleshipgame works
BattleshipGame is a WPF multiplayer client, a TCP server that manages lobby and independent matches, and a shared library for game rules and wire messages. The main workflow is connect, join the lobby, challenge and accept an opponent, place fleets, then exchange timed attacks until a result or rematch. Chat and disconnect handling are additional paths. The graph uses README-described capabilities and sampled source references; unsampled implementation details are not expanded beyond those documented relationships.
Main entry points: Client.cs Client networking · GameSession.cs Game session · MainWindow.xaml.cs Game window · LobbyManager.cs Lobby manager
Components 13
Desktop client
- Connect dialog
BattleshipClient/ConnectDialog.xaml.cs - Lobby window
BattleshipClient/LobbyWindow.xaml.cs - Game window
BattleshipClient/MainWindow.xaml.cs - Game chat
BattleshipClient/ChatWindow.xaml.cs - Client networking
BattleshipClient/Client.cs
Game server
- TCP listener
BattleshipServer/Server.cs - Client handler
BattleshipServer/ClientHandler.cs - Lobby manager
BattleshipServer/LobbyManager.cs - Game session
BattleshipServer/GameSession.cs
Shared rules
- Wire protocol
Shared/Protocol.cs - Board rules
Shared/Board.cs - Ship model
Shared/Ship.cs
Other components
- Player
Connections 24
- Player → Connect dialog: starts connection
README.md - Connect dialog → Client networking: configures
BattleshipClient/ConnectDialog.xaml.cs - Client networking → TCP listener: connects via TCP
README.md - TCP listener → Client handler: creates handlers
BattleshipServer/Server.cs - TCP listener → Lobby manager: registers clients
BattleshipServer/Server.cs - Client handler → Lobby manager: routes messages
BattleshipServer/LobbyManager.cs - Lobby manager → Client handler: sends updates
BattleshipServer/LobbyManager.cs - Lobby manager → Game session: starts match
BattleshipServer/LobbyManager.cs - Player → Lobby window: challenges players
README.md - Lobby window → Client networking: sends lobby actions
BattleshipClient/LobbyWindow.xaml.cs - Client networking → Lobby window: raises lobby events
BattleshipClient/LobbyWindow.xaml.cs - Player → Game window: places and attacks
README.md - Game window → Client networking: sends game actions
BattleshipClient/MainWindow.xaml.cs - Client networking → Game window: raises game events
BattleshipClient/MainWindow.xaml.cs - Game session → Client handler: uses connections
BattleshipServer/GameSession.cs - Game session → Board rules: applies game rules
BattleshipServer/GameSession.cs - Game session → Wire protocol: builds messages
BattleshipServer/GameSession.cs - Client networking → Wire protocol: parses messages
BattleshipClient/Client.cs - Game window → Board rules: manages grids
BattleshipClient/MainWindow.xaml.cs - Board rules → Ship model: tracks ships
Shared/Board.cs - Player → Game chat: chats in match
README.md - Game chat → Client networking: sends chat
BattleshipClient/ChatWindow.xaml.cs - Client networking → Game chat: delivers chat
BattleshipClient/ChatWindow.xaml.cs - Game session → Game chat: relays match chat