using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScenePageCellItemData
{
    public string imgPath = "";//url | path
    public string name = "";
    public bool isLock = false;
    public bool isSelect = false;
    public int jindu = 0;
    public int jindumax = 0;
    public int gid = 0;
    
}
public class ScenePageCellGroupItemData
{
    public string name = "";
    public List<ScenePageCellItemData> datas = new List<ScenePageCellItemData>();
    public ScenePageCellGroupItemData() { }
    public ScenePageCellGroupItemData(string name)
    {
        this.name = name;
    }
    public void addItem(int gid,string path, string name, bool isLock,bool isSelect,int jindu,int jindumax)
    {
        ScenePageCellItemData pageCellItemData = new ScenePageCellItemData();
        pageCellItemData.imgPath = path;
        pageCellItemData.name = name;
        pageCellItemData.isLock = isLock;
        pageCellItemData.isSelect = isLock ? false : isSelect;
        pageCellItemData.jindu = jindu;
        pageCellItemData.jindumax = jindumax;
        pageCellItemData.gid = gid;
        for(int i = 0;i < datas.Count;i++)
        {
            var item = datas[i];
            if (item.gid.Equals(gid))
            {
                datas[i] = pageCellItemData;
                return;
            }
        }
        datas.Add(pageCellItemData);
    }
    public ScenePageCellItemData getItemByName(string name)
    {
        for (int i = 0; i < datas.Count; i++)
        {
            if (datas[i].name.Equals(name)) return datas[i];
        }
        return null;
    }
    
}