using System.Drawing;

namespace Server.Config
{
    public partial class ExchangeMallConfig
    {
        private GameMessage.ResData[] SourceItemsResData;
        
        private GameMessage.ResData[] TargetItemsResData;
        
        public GameMessage.ResData[] SourceItemsResDataConvert()
        {
            if (SourceItemsResData == null)
            {
                SourceItemsResData = new GameMessage.ResData[SourceItems.Length];
                for (int i = 0; i < SourceItems.Length; i++)
                {
                    SourceItemsResData[i] = new GameMessage.ResData
                    {
                        Id = SourceItems[i].Id,
                        Count = SourceItems[i].Count
                    };
                }
            }
            return SourceItemsResData;
        }
        
        public GameMessage.ResData[] TargetItemsResDataConvert()
        {
            if (TargetItemsResData == null)
            {
                TargetItemsResData = new GameMessage.ResData[TargetItems.Length];
                for (int i = 0; i < TargetItems.Length; i++)
                {
                    TargetItemsResData[i] = new GameMessage.ResData
                    {
                        Id = TargetItems[i].Id,
                        Count = TargetItems[i].Count
                    };
                }
            }

            return TargetItemsResData;
        }
        
    }
}