private IEnumerable <List <ProductionRequest> > SeparateRequestsByCiv(List <ProductionRequest> requests)
        {
            var requestsByCiv = new DictionaryOfLists <ICivilization, ProductionRequest>();

            foreach (var request in requests)
            {
                var cityOwner = CityPossessionCanon.GetOwnerOfPossession(request.RequestingCity);

                requestsByCiv.AddElementToList(cityOwner, request);
            }

            return(requestsByCiv.Values);
        }
        public void SubscribeFreeBuildingToCiv(
            IEnumerable <IBuildingTemplate> validTemplates, ICivilization civ
            )
        {
            if (IsActive)
            {
                foreach (var city in CityPossessionCanon.GetPossessionsOfOwner(civ))
                {
                    if (FreeBuildingApplier.CanApplyFreeBuildingToCity(validTemplates, city))
                    {
                        FreeBuildingApplier.ApplyFreeBuildingToCity(validTemplates, city);

                        return;
                    }
                }
            }

            PendingFreeBuildingsOfCiv.AddElementToList(civ, validTemplates);
        }
 public void MakeProductionRequest(
     IProductionProject project, ICity requestingCity
     )
 {
     if (project.UnitToConstruct != null)
     {
         project.Execute(requestingCity);
     }
     else if (project.BuildingToConstruct != null && project.BuildingToConstruct.Type == BuildingType.Normal)
     {
         project.Execute(requestingCity);
     }
     else if (project.BuildingToConstruct != null)
     {
         ProductionRequestsByTemplate.AddElementToList(
             project.BuildingToConstruct,
             new ProductionRequest()
         {
             Project        = project,
             RequestingCity = requestingCity,
         }
             );
     }
 }