Example #1
0
 //internal bool canBuildNewFactory(FactoryType type)
 //{
 //    if (HaveFactory(type))
 //        return false;
 //    if (type.isResourceGathering() && type.basicProduction.getProduct() != this.resource
 //        || !type.basicProduction.getProduct().isInventedBy(getCountry())
 //        || type.isManufacture() && !getCountry().isInvented(Invention.Manufactories)
 //        || (type.basicProduction.getProduct() == Product.Cattle && !getCountry().isInvented(Invention.Domestication))
 //        )
 //        return false;
 //    return true;
 //}
 internal bool canBuildNewFactory(Province where)
 {
     if (where.hasFactory(this))
     {
         return(false);
     }
     if (isResourceGathering() && basicProduction.getProduct() != where.getResource() ||
         !basicProduction.getProduct().isInventedBy(where.getCountry()) ||
         isManufacture() && !where.getCountry().isInvented(Invention.Manufactures) ||
         (basicProduction.getProduct() == Product.Cattle && !where.getCountry().isInvented(Invention.Domestication))
         )
     {
         return(false);
     }
     return(true);
 }
 /// <summary>
 ///
 /// </summary>
 internal bool canBuildNewFactory(Province where, Agent builder)
 {
     if (where.hasFactory(this))
     {
         return(false);
     }
     if (isResourceGathering() && basicProduction.Product != where.getResource() ||
         (builder != null && !builder.Country.InventedFactory(this)) || // check it out side
         (builder != null && !allowsForeignInvestments.checkIftrue(builder, where))   // check it out side
                                                                                      //|| !basicProduction.Product.IsInventedByAnyOne()
         )
     {
         return(false);
     }
     return(true);
 }
Example #3
0
 /// <summary>
 /// Doesn't care about builder reforms
 /// </summary>
 internal bool canBuildNewFactory(Province where, Agent investor)
 {
     if (where.hasFactory(this))
     {
         return(false);
     }
     if (isResourceGathering() && basicProduction.getProduct() != where.getResource()
         //|| !where.GetCountry().isInvented(basicProduction.getProduct())
         || !investor.GetCountry().Invented(this)
         //|| isManufacture() && !investor.GetCountry().Invented(Invention.Manufactures)
         //|| (basicProduction.getProduct() == Product.Cattle && !investor.GetCountry().Invented(Invention.Domestication))
         || !allowsForeignInvestments.checkIftrue(investor, where)
         )
     {
         return(false);
     }
     return(true);
 }