# lykoss/lykos architecture

> Architecture diagram of the GitHub repository lykoss/lykos, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lykoss/lykos
- Repository: https://github.com/lykoss/lykos

## Overview

##### Main Components

a) Core System Components:
- IRC Transport Layer (src/transport/irc)
- Game Engine (src/wolfgame.py)
- Role System (src/roles/)
- Game Modes (src/gamemodes/)
- Message System (src/messages/)
- Database Layer (src/db/)
- Configuration System (botconfig.yml)

b) Supporting Components:
- Event System (src/events.py)
- Command Handler (src/handler.py)
- Game State Manager (src/gamestate.py)
- Player Management (src/users.py)

**[External Layer]**
**IRC Network <-> Transport Layer**

**[Core Layer]**
**Game Engine <-> Event System**
- ↕
**Role System <-> Game Modes**
- ↕
**Message System <-> Database**

**[Support Layer]**
**Configuration System**
**Command Handler**
**Game State Manager**
**Player Management**

##### Key Relationships to Highlight

- Bidirectional communication between IRC Transport and Game Engine
- Event flow from Game Engine to Roles and Game Modes
- Database interactions with Game State
- Message system integration with all components

##### Implementation Details

- Python 3.11+ requirement
- SQLite database backend
- YAML configuration system
- Event-driven architecture
- IRC protocol handling

Create distinct sections for:

##### Additional Elements

- Version control integration points
- Configuration flow
- Message localization path
- Command processing pipeline

Remember to maintain a balance between showing the complexity of the system while keeping it understandable. Focus on the game's core mechanics and how they interact with each other, while keeping implementation details at an appropriate level of abstraction.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph External
        IRC[IRC Network]
    end

    subgraph Transport
        TL["Transport Layer"]:::transport
    end

    subgraph Core
        direction TB
        GE["Game Engine"]:::core
        ES["Event System"]:::core
        RS["Role System"]:::core
        GM["Game Modes"]:::core
        MS["Message System"]:::core
        DB["Database Layer"]:::data
    end

    subgraph Support
        direction TB
        CS["Configuration System"]:::support
        CH["Command Handler"]:::support
        GSM["Game State Manager"]:::support
        PM["Player Management"]:::support
        GC["Game Commands"]:::support
        GJ["Game Join System"]:::support
        SE["Status Effects"]:::support
        RH["Role Helpers"]:::support
    end

    %% External to Transport
    IRC <--> TL

    %% Transport to Core
    TL <--> GE

    %% Core Internal Connections
    GE <--> ES
    GE <--> RS
    GE <--> GM
    GE <--> MS
    GE <--> DB
    RS <--> GM
    RS <--> RH
    MS <--> DB

    %% Support Connections
    CS --> GE
    CH --> GE
    GSM <--> GE
    PM <--> GE
    GC <--> GE
    GJ <--> GE
    SE <--> RS
    
    %% Styling
    classDef core fill:#2374ab
    classDef transport fill:#47a025
    classDef data fill:#ffb627
    classDef support fill:#a9a9a9

    %% Click Events
    click TL "https://github.com/lykoss/lykos/tree/master/src/transport/irc/"
    click GE "https://github.com/lykoss/lykos/blob/master/src/wolfgame.py"
    click RS "https://github.com/lykoss/lykos/tree/master/src/roles/"
    click GM "https://github.com/lykoss/lykos/tree/master/src/gamemodes/"
    click MS "https://github.com/lykoss/lykos/tree/master/src/messages/"
    click DB "https://github.com/lykoss/lykos/tree/master/src/db/"
    click CS "https://github.com/lykoss/lykos/blob/master/src/config.py"
    click ES "https://github.com/lykoss/lykos/blob/master/src/events.py"
    click CH "https://github.com/lykoss/lykos/blob/master/src/handler.py"
    click GSM "https://github.com/lykoss/lykos/blob/master/src/gamestate.py"
    click PM "https://github.com/lykoss/lykos/blob/master/src/users.py"
    click RH "https://github.com/lykoss/lykos/tree/master/src/roles/helper/"
    click GC "https://github.com/lykoss/lykos/blob/master/src/gamecmds.py"
    click GJ "https://github.com/lykoss/lykos/blob/master/src/gamejoin.py"
    click SE "https://github.com/lykoss/lykos/tree/master/src/status/"
```
