using System.Collections.Generic;
using System.Threading.Tasks;
using GameData;
using Server.Config;

namespace Server.Core
{
    public class GameResHelper
    {
        public static GameMessage.ResData[] Convert(ResData[] resDatas, int num = 1)
        {
            GameMessage.ResData[] result = new GameMessage.ResData[resDatas.Length];
            for (int i = 0; i < resDatas.Length; i++)
            {
                result[i] = resDatas[i].Convert(num);
            }

            return result;
        }
        
        public static List<GameMessage.ResData> Convert(List<ResData> resDatas)
        {
            List<GameMessage.ResData> result = new List<GameMessage.ResData>();
            foreach (var resData in resDatas)
            {
                result.Add(resData.Convert());
            }

            return result;
        }
    }
}