using System.Collections.Generic;

namespace Server.Config
{
    public partial class CastlesConfigCategory
    {
        public CastlesConfig[] GetCastlesConfig(int gameId)
        {
            List<CastlesConfig> configs = new List<CastlesConfig>();
            foreach (var config in _dataList)
            {
                if (config.GameId == gameId)
                {
                    configs.Add(config);
                }
            }
            
            CastlesConfig[] castlesConfigs = new CastlesConfig[configs.Count];
            foreach (var config in configs)
                castlesConfigs[config.CastleId] = config;
            return castlesConfigs;
        }
    }
}