using System;
using System.Collections.Generic;
using UnityEngine;

[Serializable]
public class NoteData
{
    public float time;      // 베어야 하는 시간
    public int position;    // 생성 위치 (0~3)
    public int colorType;   // 0: 빨강, 1: 파랑
}

[Serializable]
public class MapData
{
    public List<NoteData> target;
}

// ── songs.json DTO ──────────────────────────────────────

[Serializable]
public class SongsList
{
    public string version;
    public List<SongInfo> songs;
}

[Serializable]
public class SongInfo
{
    public string id;
    public string title;
    public string artist;
    public float  bpm;
    public int    duration;
    public string audioFile;
    public long   audioSize;
    public string coverImage;
    public DifficultyMap difficulties;
    public string addedAt;
}

[Serializable]
public class DifficultyMap
{
    public DifficultyInfo normal;
    public DifficultyInfo hard;
    public DifficultyInfo expert;
    public DifficultyInfo expertplus;

    public DifficultyInfo Get(string key) => key switch
    {
        "normal"     => normal,
        "hard"       => hard,
        "expert"     => expert,
        "expertplus" => expertplus,
        _            => null
    };
}

[Serializable]
public class DifficultyInfo
{
    public string mapFile;
    public long   mapSize;
    public int    noteCount;
}