Markdown Converter
Agent skill for markdown-converter
This skill should be used when the user asks about "namespaces", "singleton", "TileManager", "GameManager", "TokenManager", "InputManager", "data flow", "class responsibilities", "layers", "folder structure", "code organization", "design patterns", "ScriptableObject", "databases", or discusses Zero-Day Attack codebase architecture and patterns.
Sign in to like and favorite skills
Expert knowledge of the Zero-Day Attack Unity codebase structure, design patterns, and architectural decisions.
The codebase organizes into distinct layers:
| Layer | Location | Purpose |
|---|---|---|
| Data | | Immutable data structures, ScriptableObjects |
| State | | Mutable runtime game state |
| Logic | | Game rules, orchestration |
| View | | Visual representation, Unity components |
| Input | | Board SDK abstraction |
| Config | | Static layout constants |
Only
InputManager.cs imports Board.Input namespace. This:
Core systems use singleton pattern with
Instance property:
GameManager.Instance // Game state and logic TileManager.Instance // Tile spawning, positioning TokenManager.Instance // Token spawning, input handling InputManager.Instance // Board SDK event broadcasting
Game data stored in ScriptableObjects:
TileDatabase - 25 tile definitions with sprites and pathsTokenDatabase - 6 token definitions with sprites and glyph IDs| Namespace | Purpose |
|---|---|
| Layout constants () |
| Game orchestration () |
| Data structures, enums, databases |
| Runtime state classes |
| Visual components, managers |
| Board SDK wrapper |
| Debug utilities |
| Editor-only tools |
When creating new scripts:
namespace ZeroDayAttack.View { }ZeroDayAttack.EditorAssets/Scripts/ ├── Config/ │ └── LayoutConfig.cs # Static layout constants │ ├── Core/ │ ├── GameManager.cs # Game orchestrator singleton │ ├── Data/ # Immutable data structures │ │ ├── Enums.cs # EdgeNode, PathColor, Player, etc. │ │ ├── PathSegment.cs # Path connection between nodes │ │ ├── TileData.cs # Tile definition │ │ ├── TileDatabase.cs # ScriptableObject: all tiles │ │ ├── TokenData.cs # Token definition │ │ └── TokenDatabase.cs # ScriptableObject: all tokens │ └── State/ # Mutable runtime state │ ├── BoardState.cs # Grid, reserves, deck │ ├── GameState.cs # Phase, current player │ └── TokenState.cs # Token position, ownership │ ├── View/ # Visual components │ ├── TileManager.cs # Singleton: tile spawning │ ├── TileView.cs # Individual tile visual │ ├── TokenManager.cs # Singleton: token spawning │ ├── TokenView.cs # Individual token visual │ ├── BackgroundRenderer.cs # Board background │ ├── CameraController.cs # Camera setup │ └── GridOverlayRenderer.cs # Grid lines with glow │ ├── Input/ │ └── InputManager.cs # Board SDK wrapper (ONLY Board.Input) │ ├── Diagnostics/ │ └── SceneDiagnostic.cs # Runtime debug │ └── Editor/ ├── TileParser.cs # Menu: ZeroDayAttack > Parse Tiles └── TokenParser.cs # Menu: ZeroDayAttack > Parse Tokens
| Class | Responsibility |
|---|---|
| Initialize game, manage phases, orchestrate state. No direct visuals. |
| Hold , , current player, phase, actions |
| 5×5 grid (), reserves, deck, discard |
| Token identity, position (tile, node), physical tracking |
| Class | Responsibility |
|---|---|
| Define tile: ID, sprite, segments, rotation, grid position |
| Define token: ID, sprite, owner, type, glyph ID |
| Connect two values with |
| ScriptableObject with |
| ScriptableObject with 6 token slots |
| Class | Responsibility |
|---|---|
| Spawn tiles, grid-to-world conversion, hold |
| Spawn tokens, handle glyph events, snap to nodes |
| MonoBehaviour on tile GameObjects, manage sprite |
| MonoBehaviour on token GameObjects, manage position |
| Render board background |
| Draw 5×5 grid with glow effect |
| Configure orthographic camera |
| Class | Responsibility |
|---|---|
| Poll , fire events, coordinate conversion |
Board Hardware (touch/glyph) │ ▼ InputManager ← Only Board.Input import │ ┌────┴────┐ ▼ ▼ TokenManager (Future: Tile touch) │ ▼ GameManager ← Game logic decisions │ ┌───┴───┐ ▼ ▼ GameState TileManager BoardState (spawn tiles) TokenState
GameplayScene ├── MainCamera [CameraController] ├── GlobalLight2D ├── GameManager [GameManager] ├── TileManager [TileManager] ├── TokenManager [TokenManager] ├── InputManager [InputManager] ├── BackgroundRenderer [BackgroundRenderer] ├── GridOverlayRenderer [GridOverlayRenderer] ├── Tiles (spawned at runtime) └── Tokens (spawned at runtime)
// Grid to World (via LayoutConfig) float x = LayoutConfig.GridLeft + (gridX * LayoutConfig.TileSize) + (LayoutConfig.TileSize / 2f); float y = LayoutConfig.GridBottom + (gridY * LayoutConfig.TileSize) + (LayoutConfig.TileSize / 2f);
Follow singleton pattern:
public class NewManager : MonoBehaviour { public static NewManager Instance { get; private set; } void Awake() { if (Instance != null) { Destroy(gameObject); return; } Instance = this; } }
For immutable data in
Core/Data/:
namespace ZeroDayAttack.Core.Data { [System.Serializable] public class NewData { public string Id; // Serialized fields... } }
For visual components in
View/:
namespace ZeroDayAttack.View { public class NewView : MonoBehaviour { [SerializeField] private SpriteRenderer spriteRenderer; // View logic... } }
For comprehensive architecture details:
When modifying architecture, review:
LayoutConfig.cs - All layout constantsGameManager.cs - Game orchestrationTileManager.cs - Tile coordinate conversion