# janalihassan/tic_tac_toe-multiplayer- architecture

> Architecture diagram of the GitHub repository janalihassan/tic_tac_toe-multiplayer-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/janalihassan/tic_tac_toe-multiplayer-
- Repository: https://github.com/janalihassan/tic_tac_toe-multiplayer-

## Overview

This repository is documented as a Unity browser Tic Tac Toe game using PlayroomKit for two-player rooms and RPC synchronization. The documented workflow starts a room, assigns player order and symbols, accepts valid cell clicks, synchronizes moves and turns, then declares and displays a winner. The README names game scripts under Assets/Script/, but those files are absent from the supplied tree; their paths are therefore left null. Internal SDK behavior is represented only at the documented entry point.

Main entry points: [`Assets/PlayroomKit/PlayroomKit.cs`](https://github.com/janalihassan/tic_tac_toe-multiplayer-/blob/main/Assets/PlayroomKit/PlayroomKit.cs) (PlayroomKit SDK)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game flow"]
  node_manager["Game manager"]
  node_room["Two-player room"]
  node_order["Player order"]
  node_symbols["Symbol assignment"]
  node_movecheck["Move validation"]
  node_move_rpc["SpawnShape RPC"]
  node_turn_rpc["SyncTurn RPC"]
  node_wincheck["Win detection"]
  node_gameover_rpc["GameOver RPC"]
end

subgraph group_presentation["Board and UI"]
  node_board["Board cells"]
  node_turn_ui["Turn indicator"]
  node_winning_line["Winning line"]
  node_result_ui["Win/lose display"]
  node_you_label["YOU label"]
end

subgraph group_sdk["PlayroomKit SDK"]
  node_playroom["PlayroomKit SDK<br/>[PlayroomKit.cs]"]
end

node_players(("Browser players"))

node_players -->|"starts game"| node_manager
node_manager -->|"starts SDK"| node_playroom
node_manager -->|"creates room"| node_room
node_room -->|"admits players"| node_players
node_manager -->|"sends join order"| node_order
node_order -->|"assigns symbols"| node_symbols
node_players -->|"clicks cell"| node_board
node_board -->|"passes coordinates"| node_manager
node_manager -->|"validates move"| node_movecheck
node_manager -->|"sends move"| node_move_rpc
node_manager -->|"sends next turn"| node_turn_rpc
node_turn_rpc -->|"updates indicator"| node_turn_ui
node_manager -->|"checks winner"| node_wincheck
node_manager -->|"broadcasts result"| node_gameover_rpc
node_gameover_rpc -->|"provides winning cells"| node_winning_line
node_gameover_rpc -->|"shows outcome"| node_result_ui
node_symbols -->|"marks local symbol"| node_you_label

click node_playroom "https://github.com/janalihassan/tic_tac_toe-multiplayer-/blob/main/Assets/PlayroomKit/PlayroomKit.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manager,node_room,node_order,node_symbols,node_movecheck,node_move_rpc,node_turn_rpc,node_wincheck,node_gameover_rpc,node_players toneBlue
class node_board,node_turn_ui,node_winning_line,node_result_ui,node_you_label toneAmber
class node_playroom toneMint
```

## Components

### Game flow

- **Game manager**
- **Two-player room**
- **Player order**
- **Symbol assignment**
- **Move validation**
- **SpawnShape RPC**
- **SyncTurn RPC**
- **Win detection**
- **GameOver RPC**

### Board and UI

- **Board cells**
- **Turn indicator**
- **Winning line**
- **Win/lose display**
- **YOU label**

### PlayroomKit SDK

- [PlayroomKit SDK](https://github.com/janalihassan/tic_tac_toe-multiplayer-/blob/main/Assets/PlayroomKit/PlayroomKit.cs): `Assets/PlayroomKit/PlayroomKit.cs`

### Other components

- **Browser players**

## Connections

- Browser players → Game manager: starts game
- Game manager → PlayroomKit SDK: starts SDK
- Game manager → Two-player room: creates room
- Two-player room → Browser players: admits players
- Game manager → Player order: sends join order
- Player order → Symbol assignment: assigns symbols
- Browser players → Board cells: clicks cell
- Board cells → Game manager: passes coordinates
- Game manager → Move validation: validates move
- Game manager → SpawnShape RPC: sends move
- Game manager → SyncTurn RPC: sends next turn
- SyncTurn RPC → Turn indicator: updates indicator
- Game manager → Win detection: checks winner
- Game manager → GameOver RPC: broadcasts result
- GameOver RPC → Winning line: provides winning cells
- GameOver RPC → Win/lose display: shows outcome
- Symbol assignment → YOU label: marks local symbol
