# fabianmontes/beastcardclash architecture

> Architecture diagram of the GitHub repository fabianmontes/beastcardclash, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fabianmontes/beastcardclash
- Repository: https://github.com/fabianmontes/beastcardclash

## Overview

##### Project type and purpose
- This is a Unity‐based turn‐based collectible card game (“Beast Card Clash”) built in C# and .NET 7, using Unity 6000.0.241f. It’s a client‐only game, no external server, with emphasis on educational/cultural content.

##### File structure
- Top‐level:
- Assets/               ← all Unity assets
- Docs/                 ← API/script docs generated from code
- Packages/             ← Unity package manifest
- ProjectSettings/      ← Unity project configuration
- README.md + python doc maker script
- Under Assets/ you see subfolders grouping:
- Scenes/               ← Unity scene files
- scripts/              ← gameplay and UI logic
- prefabs/              ← reusable GameObject templates
- Resources/            ← ScriptableObjects & JSON for localization & game state
- / & TextMesh Pro/ ← third-party plugins for rendering
- Sfxcombatmanager.cs & Sonido/ ← audio manager & audio assets
- Patterns: component-based architecture (MonoBehaviours), data-driven via ScriptableObjects, scene-based modularity, plugin integration (OutlineFX, URP, TextMeshPro).

##### README
- Confirms it’s a Unity game, uses .NET, highlights features (strategy, turn-based, educational).

##### Diagramming recommendations
- Blue: Engine & Rendering subsystems
- Green: Game Logic
- Yellow: Data layer (ScriptableObjects, JSON)
- Orange: UI
- Purple: Plugins & External tools
- Rectangles for code modules and scenes
- Parallelograms for assets (audio, prefabs)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Engine & Rendering
    subgraph "Engine & Rendering"
        direction TB
        UnityEngine["Unity Engine & Editor"]:::engineblue
        subgraph "Rendering Pipeline (URP)"
            direction TB
            URP1["UniversalRenderPipelineGlobalSettings.asset"]:::engineblue
            URP2["Mobile_RPAsset.asset"]:::engineblue
            URP3["PC_RPAsset.asset"]:::engineblue
            URP4["Mobile_Renderer.asset"]:::engineblue
            URP5["PC_Renderer.asset"]:::engineblue
        end
        subgraph "Plugins"
            direction TB
            OutlineFx["OutlineFx.cs"]:::pluginpurple
            OutlineRuntime["Outline.cs"]:::pluginpurple
            OutlineShader["Main.shader"]:::pluginpurple
            OutlineEditor["OutlineFx.Editor.asmdef"]:::pluginpurple
            TMPFont["LiberationSans SDF.asset"]:::pluginpurple
            TMPShader["TMP_SDF.shader"]:::pluginpurple
            TMPSettings["TMP Settings.asset"]:::pluginpurple
        end
        UnityEngine -->|uses| URP1
        URP1 --> URP2 --> URP3 --> URP4 --> URP5
        UnityEngine -->|integrates| OutlineFx
        UnityEngine -->|integrates| TMPFont
    end

    %% Input System
    subgraph "Input System"
        direction TB
        InputActions["InputSystem_Actions.inputactions"]:::engineblue
    end

    %% Scenes
    subgraph "Scenes"
        direction TB
        MenuScene["menu.unity"]:::engineblue
        SkinScene["SkinSelector.unity"]:::engineblue
        CombatScene["CombatBase.unity"]:::engineblue
        WorldScene["world.unity"]:::engineblue
    end

    %% Game Logic
    subgraph "Game Logic"
        direction TB
        subgraph "Core"
            direction TB
            CombatJudge["Combatjudge.cs"]:::logicgreen
            CardScript["Card.cs"]:::logicgreen
            HandCard["HandCard.cs"]:::logicgreen
            PlayZone["PlayZone.cs"]:::logicgreen
            PickerCard["PickerCard.cs"]:::logicgreen
            RoundAnim["Roundanimation.cs"]:::logicgreen
        end
        subgraph "Player & Entities"
            direction TB
            PlayerCtrl["Player.cs"]:::logicgreen
            BotPlayer["BotPlayer.cs"]:::logicgreen
            Fighter["Figther.cs"]:::logicgreen
            RockBeh["RockBehavior.cs"]:::logicgreen
            FollowShield["followShield.cs"]:::logicgreen
            CameraMove["CameraMovement.cs"]:::logicgreen
        end
    end

    %% UI Layer
    subgraph "UI Layer"
        direction TB
        StartMenuMgr["StartMenuManager.cs"]:::uiorange
        DialogMgr["DialogManager.cs"]:::uiorange
        TutorialMgr["TutorialMenuManager.cs"]:::uiorange
        SkinUI["SkinSelector.cs"]:::uiorange
        SkinStartBtn["SkinSelectorStartButton.cs"]:::uiorange
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        GameStateSO["GameState ScriptableObject"]:::datayellow
        MenuTextsSO["MenuTexts ScriptableObject"]:::datayellow
        DialogEN["DialogsEN.json"]:::datayellow
        DialogES["DialogsES.json"]:::datayellow
    end

    %% Prefabs & Assets
    subgraph "Prefabs & Assets"
        direction TB
        CardPrefab["Cards Prefab"]:::assetpar
        CardDataPrefab["CardData Prefab"]:::assetpar
        CharacterPrefabs["Character Prefabs"]:::assetpar
        TokenPrefabs["Tokens & UI Prefabs"]:::assetpar
    end

    %% Audio Subsystem
    subgraph "Audio Subsystem"
        direction TB
        AudioMgr["Sfxcombatmanager.cs"]:::assetpar
        AudioAssets[".mp3/.ogg Assets"]:::assetpar
    end

    %% External Tools
    subgraph "External Tools"
        direction TB
        DocMaker["documentationMaker.py"]:::pluginpurple
    end

    %% Relationships
    InputActions -->|drives| PlayerCtrl
    InputActions -->|drives| UI
    MenuScene -->|loads| CardPrefab
    SkinScene -->|loads| CharacterPrefabs
    CombatScene -->|loads| CardPrefab
    CombatScene -->|loads| CharacterPrefabs
    CombatScene -->|uses| CombatJudge
    Core -->|updates| GameStateSO
    UI -->|reads/writes| GameStateSO
    UI -->|reads| MenuTextsSO
    Core -->|triggers| AudioMgr
    AudioMgr -->|plays| AudioAssets
    Core -->|uses| CardDataPrefab
    Core -->|uses| DialogEN
    Core -->|uses| DialogES
    OutlineFx -->|enhances| CharacterPrefabs
    TMPFont -->|renders text in| UI
    URP1 -->|renders| CharacterPrefabs
    URP1 -->|renders| CardPrefab

    %% Click Events
    click URP1 "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Settings/UniversalRenderPipelineGlobalSettings.asset"
    click URP2 "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Settings/Mobile_RPAsset.asset"
    click URP3 "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Settings/PC_RPAsset.asset"
    click URP4 "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Settings/Mobile_Renderer.asset"
    click URP5 "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Settings/PC_Renderer.asset"
    click OutlineFx "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Outline/Runtime/OutlineFx.cs"
    click OutlineRuntime "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Outline/Runtime/Outline.cs"
    click OutlineShader "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Outline/Runtime/Shaders/Main.shader"
    click OutlineEditor "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Outline/Editor/OutlineFx.Editor.asmdef"
    click TMPFont "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/TextMesh Pro/Resources/Fonts & Materials/LiberationSans SDF.asset"
    click TMPShader "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/TextMesh Pro/Shaders/TMP_SDF.shader"
    click TMPSettings "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/TextMesh Pro/Resources/TMP Settings.asset"
    click InputActions "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/InputSystem_Actions.inputactions"
    click MenuScene "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Scenes/menu.unity"
    click SkinScene "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Scenes/SkinSelector.unity"
    click CombatScene "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Scenes/CombatBase.unity"
    click WorldScene "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Scenes/world.unity"
    click CombatJudge "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/Combatjudge.cs"
    click CardScript "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/Card.cs"
    click HandCard "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/HandCard.cs"
    click PlayZone "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/PlayZone.cs"
    click PickerCard "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/PickerCard.cs"
    click RoundAnim "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/Roundanimation.cs"
    click PlayerCtrl "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/Player/Player.cs"
    click BotPlayer "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/BotPlayer.cs"
    click Fighter "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/Figther.cs"
    click RockBeh "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/RockBehavior.cs"
    click FollowShield "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/followShield.cs"
    click CameraMove "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/Player/CameraMovement.cs"
    click StartMenuMgr "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/UI/StartMenuManager.cs"
    click DialogMgr "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/UI/DialogManager.cs"
    click TutorialMgr "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/UI/TutorialMenuManager.cs"
    click SkinUI "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/UI/SkinSelector.cs"
    click SkinStartBtn "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/UI/SkinSelectorStartButton.cs"
    click GameStateSO "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/ScriptableObjects/GameState.cs"
    click MenuTextsSO "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/scripts/ScriptableObjects/MenuTexts.cs"
    click DialogEN "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Resources/DialogsEN.json"
    click DialogES "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Resources/DialogsES.json"
    click CardPrefab "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/prefabs/Cards/Card.prefab"
    click CardDataPrefab "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/prefabs/Cards/CardData.prefab"
    click CharacterPrefabs "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/prefabs/BearModel.prefab"
    click TokenPrefabs "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/prefabs/PlayerToke.prefab"
    click AudioMgr "https://github.com/fabianmontes/beastcardclash/blob/main/Assets/Sfxcombatmanager.cs"
    click DocMaker "https://github.com/fabianmontes/beastcardclash/blob/main/documentationMaker.py"

    %% Styles
    classDef engineblue fill:#AED6F1,stroke:#1F618D,color:#1F618D;
    classDef logicgreen fill:#ABEBC6,stroke:#196F3D,color:#196F3D;
    classDef datayellow fill:#F9E79F,stroke:#B7950B,color:#B7950B;
    classDef uiorange fill:#F5CBA7,stroke:#A04000,color:#A04000;
    classDef pluginpurple fill:#D7BDE2,stroke:#6C3483,color:#6C3483;
    classDef assetpar fill:#D5DBDB,stroke:#424949,color:#424949;
```
