# nardinan/pomodoro architecture

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

- Interactive diagram: https://gitdiagram.com/nardinan/pomodoro
- Repository: https://github.com/nardinan/pomodoro

## Overview

##### Main System Components

a) Game Engine Core (Miranda Integration)
- Core modules: director, effecteer, factory, puppeteer, screenwriter, stagecrafter
- How these components interact with the game's main loop

b) Resource Management Layer
- Loader component for handling assets
- Module configuration system
- Collector for resource management
- Connections to the data directory structure

c) Game Logic Layer
- Character management system
- Camera control system
- Bubble system (likely for dialogues)
- Item management system
- Landscape handling system

d) Asset Organization
- Hierarchical structure of:
- Characters (animations, sprites)
- Dialogs (story branches)
- Effects (visual/audio)
- Items (game objects)
- Landscapes (game environments)
- Music and Sound effects

##### Interaction Flows

- Data flow between components
- Asset loading paths
- Event handling chains
- Script execution flows (particularly for the extensive Lisp scripts)

##### Technical Details

- Relationship between .obj.c and .obj.h files
- Build system integration (CMake)
- Tools directory functionality
- Multi-platform support architecture

##### Additional Notes

Annotations for:
- Multi-platform compatibility points
- Resource loading paths
- Script execution flow
- Dialog system branching

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core["Game Engine Core"]
        Miranda["Miranda Engine"]:::core
        Director["Director"]:::core
        Effecteer["Effecteer"]:::core
        Factory["Factory"]:::core
        Puppeteer["Puppeteer"]:::core
        Screenwriter["Screenwriter"]:::core
        Stagecrafter["Stagecrafter"]:::core
        
        Miranda --> Director
        Miranda --> Effecteer
        Miranda --> Factory
        Miranda --> Puppeteer
        Miranda --> Screenwriter
        Miranda --> Stagecrafter
    end

    subgraph ResourceMgmt["Resource Management Layer"]
        Loader["Loader"]:::resource
        ModuleConfig["Module Configuration"]:::resource
        Collector["Collector"]:::resource
        
        Loader --> Collector
        ModuleConfig --> Collector
    end

    subgraph GameLogic["Game Logic Layer"]
        CharSystem["Character System"]:::logic
        CameraSystem["Camera System"]:::logic
        BubbleSystem["Bubble System"]:::logic
        ItemSystem["Item System"]:::logic
        LandscapeSystem["Landscape System"]:::logic
        
        CameraSystem --> CharSystem
        BubbleSystem --> CharSystem
        ItemSystem --> CharSystem
        LandscapeSystem --> CameraSystem
    end

    subgraph Assets["Asset Organization"]
        Characters["Characters"]:::asset
        Dialogs["Dialogs"]:::asset
        Effects["Effects"]:::asset
        Items["Items"]:::asset
        Landscapes["Landscapes"]:::asset
        Music["Music"]:::asset
        Sounds["Sound Effects"]:::asset
        Voices["Voices"]:::asset
    end

    ResourceMgmt --> Core
    GameLogic --> ResourceMgmt
    Assets --> Loader

    classDef core fill:#2374ab
    classDef resource fill:#57a773
    classDef logic fill:#ffc857
    classDef asset fill:#a23b72

    %% Click events for components
    click Miranda "https://github.com/nardinan/pomodoro/blob/master/miranda.c"
    click Director "https://github.com/nardinan/pomodoro/blob/master/director.obj.c"
    click Effecteer "https://github.com/nardinan/pomodoro/blob/master/effecteer.obj.c"
    click Factory "https://github.com/nardinan/pomodoro/blob/master/factory.obj.c"
    click Puppeteer "https://github.com/nardinan/pomodoro/blob/master/puppeteer.obj.c"
    click Screenwriter "https://github.com/nardinan/pomodoro/blob/master/screenwriter.obj.c"
    click Stagecrafter "https://github.com/nardinan/pomodoro/blob/master/stagecrafter.obj.c"
    click Loader "https://github.com/nardinan/pomodoro/blob/master/loader.obj.c"
    click ModuleConfig "https://github.com/nardinan/pomodoro/blob/master/module_configuration.obj.c"
    click Collector "https://github.com/nardinan/pomodoro/blob/master/collector.obj.c"
    click CharSystem "https://github.com/nardinan/pomodoro/blob/master/character.obj.c"
    click CameraSystem "https://github.com/nardinan/pomodoro/blob/master/camera.obj.c"
    click BubbleSystem "https://github.com/nardinan/pomodoro/blob/master/bubble.obj.c"
    click ItemSystem "https://github.com/nardinan/pomodoro/blob/master/item.obj.c"
    click LandscapeSystem "https://github.com/nardinan/pomodoro/blob/master/landscape.obj.c"
    click Characters "https://github.com/nardinan/pomodoro/tree/master/data/characters"
    click Dialogs "https://github.com/nardinan/pomodoro/tree/master/data/dialogs"
    click Effects "https://github.com/nardinan/pomodoro/tree/master/data/effects"
    click Items "https://github.com/nardinan/pomodoro/tree/master/data/items"
    click Landscapes "https://github.com/nardinan/pomodoro/tree/master/data/landscapes"
    click Music "https://github.com/nardinan/pomodoro/tree/master/data/music"
    click Sounds "https://github.com/nardinan/pomodoro/tree/master/data/sounds"
    click Voices "https://github.com/nardinan/pomodoro/tree/master/data/voices"
```
