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

[CreateAssetMenu]
public class TileSet : ScriptableObject
{
    [SerializeField] private List<GameObject> m_ground;
    [SerializeField] private List<GameObject> m_standalone_Connected;
    [SerializeField] private List<GameObject> m_standalone_Lonely;
    [SerializeField] private List<GameObject> m_standalone_Straight;
    [SerializeField] private List<GameObject> m_standalone_T;
    [SerializeField] private List<GameObject> m_standalone_X;
    [SerializeField] private List<GameObject> m_wall_Inner;
    [SerializeField] private List<GameObject> m_wall_InnerX2;
    [SerializeField] private List<GameObject> m_wall_Outer;
    [SerializeField] private List<GameObject> m_wall_Standalone;
    [SerializeField] private List<GameObject> m_wall_Straight;
    [SerializeField] private List<GameObject> m_wall_Filled;
    [SerializeField] private List<GameObject> m_wall_bend;
    [SerializeField] private List<GameObject> m_wall_half_t_r;
    [SerializeField] private List<GameObject> m_wall_half_t_l;
    [SerializeField] private List<GameObject> m_wall_half_x;
    [SerializeField] private Mesh m_wall_ore;
    [SerializeField] private GameObject m_stockpile;

    public GameObject Magma;
    public GameObject Ladder;

    public Dictionary<TileTypes, List<GameObject>> Tiles;
    public Dictionary<Building.Type, GameObject> Buildings;

    public void Setup()
    {
        Tiles = new Dictionary<TileTypes, List<GameObject>>
        {
            [TileTypes.Ground] = m_ground,
            [TileTypes.Standalone_Connected] = m_standalone_Connected,
            [TileTypes.Standalone_Lonely] = m_standalone_Lonely,
            [TileTypes.Standalone_Straight] = m_standalone_Straight,
            [TileTypes.Standalone_T] = m_standalone_T,
            [TileTypes.Standalone_X] = m_standalone_X,
            [TileTypes.Wall_Inner] = m_wall_Inner,
            [TileTypes.Wall_InnerX2] = m_wall_InnerX2,
            [TileTypes.Wall_Outer] = m_wall_Outer,
            [TileTypes.Wall_Standalone] = m_wall_Standalone,
            [TileTypes.Wall_Straight] = m_wall_Straight,
            [TileTypes.Wall_Filled] = m_wall_Filled,
            [TileTypes.Wall_Half_T_Left] = m_wall_half_t_l,
            [TileTypes.Wall_Half_T_Right] = m_wall_half_t_r,
            [TileTypes.Wall_Half_X] = m_wall_half_x,
            [TileTypes.Wall_Bend] = m_wall_bend
        };
        Buildings = new Dictionary<Building.Type, GameObject>()
        {
            [Building.Type.Stockpile] = m_stockpile
        };
    }

    public enum TileTypes
    {
        Ground,
        Standalone_Connected,
        Standalone_Lonely,
        Standalone_Straight,
        Standalone_T,
        Standalone_X,
        Wall_Inner,
        Wall_InnerX2,
        Wall_Outer,
        Wall_Standalone,
        Wall_Straight,
        Wall_Filled,
        Wall_Half_T_Left,
        Wall_Half_T_Right,
        Wall_Half_X,
        Wall_Bend,
    }
}
