private void ApplyFreeBuildingsFromBonuses(ISocialPolicyBonusesData bonuses, ICivilization civ)
 {
     for (int i = 0; i < bonuses.FreeBuildingCount; i++)
     {
         FreeBuildingsCanon.SubscribeFreeBuildingToCiv(bonuses.FreeBuildingTemplates, civ);
     }
 }
        private void DecomposeFreeBuildings(SerializableCivilizationData civData, ICivilization newCiv)
        {
            if (civData.FreeBuildings != null)
            {
                foreach (List <string> freeBuildingSetByName in civData.FreeBuildings)
                {
                    var freeBuildingSet = new List <IBuildingTemplate>();

                    foreach (string templateName in freeBuildingSetByName)
                    {
                        var templateOfName = BuildingTemplates.Where(template => template.name.Equals(templateName)).FirstOrDefault();

                        if (templateOfName == null)
                        {
                            throw new InvalidOperationException(
                                      string.Format("CivData.FreeBuildings had invalid building name {0} in it", templateName)
                                      );
                        }

                        freeBuildingSet.Add(templateOfName);
                    }

                    FreeBuildingsCanon.SubscribeFreeBuildingToCiv(freeBuildingSet, newCiv);
                }
            }
        }