Пример #1
0
 internal EconomyReformValue(string name, string description, int id, DoubleConditionsList condition,
                             bool allowForeighnIvestments, TaxationForPoor.PoorTaxValue maxTax = null, TaxationForPoor.PoorTaxValue minTax = null) : base(name, description, id, condition)
 {
     AllowForeignInvestments = allowForeighnIvestments;
     this.minTax             = minTax;
     this.maxTax             = maxTax;
 }
Пример #2
0
 internal GovernmentReformValue(string name, string description, int id, DoubleConditionsList condition,
                                string prefix, int MaxSizeLimitForDisloyaltyModifier, float scienceModifier, TaxationForPoor.PoorTaxValue defaultPoorTax = null, TaxationForRich.RichTaxValue defaultRichTax = null) : base(name, description, id, condition)
 {
     Prefix = prefix;
     this.MaxSizeLimitForDisloyaltyModifier = MaxSizeLimitForDisloyaltyModifier;
     ScienceModifier     = scienceModifier;
     this.defaultPoorTax = defaultPoorTax;
     this.defaultRichTax = defaultRichTax;
 }
Пример #3
0
 protected AbstractReformValue(int id, DoubleConditionsList condition)
 {
     LifeQualityImpact = Procent.ZeroProcent.Copy();
     ID          = id;
     allowed     = condition;
     wantsReform = new Modifier(x => howIsItGoodForPop(x as PopUnit).get(), "Benefit to population", 1f, true);
     loyalty     = new Modifier(x => loyaltyBoostFor(x as PopUnit), "Loyalty", 1f, false);
     modVoting   = new ModifiersList(new List <Condition> {
         wantsReform, loyalty, education
     });
 }
Пример #4
0
        /// <summary>
        /// Basic constructor for resource getting FactoryType
        /// </summary>
        public ProductionType(string name, Storage basicProduction, bool shaft, params Invention[] requiredInventions)
        {
            this.requiredInventions = requiredInventions;
            this.name  = name;
            this.shaft = shaft;
            nameWeight = name.GetWeight();

            allTypes.Add(this);
            this.basicProduction = basicProduction;

            enoughMoneyOrResourcesToBuild = new Condition(
                delegate(object forWhom)
            {
                var agent = forWhom as Agent;
                if (agent.Country.economy == Economy.PlannedEconomy)
                {
                    return(agent.Country.countryStorageSet.has(GetBuildNeeds()));
                }
                else
                {
                    var cost = GetBuildCost(agent.Country.market);
                    return(agent.CanPay(cost));
                }
            },
                delegate
            {
                var sb = new StringBuilder();
                // var cost = GetBuildCost(agent.Country.market);
                //sb.Append("Has ").Append(cost).Append(" coins");
                sb.Append("Has enough coins");
                sb.Append(" or (with ").Append(Economy.PlannedEconomy).Append(") has ").Append(GetBuildNeeds().ToString(", "));
                return(sb.ToString());
            }, true);

            // Using: Country () , province, this <FactoryType>
            // used in BuildPanel only, only for Game.Player
            // Should be: de-facto Country, Investor, this <FactoryType> (change Economy.isNot..)
            // Ideally: Agent, FactoryProject
            // or put it in FactoryProject
            conditionsBuildThis = new DoubleConditionsList(new List <Condition> {
                Economy.isNotLF, Economy.isNotInterventionism, enoughMoneyOrResourcesToBuild,
                allowsForeignInvestments
            });                             //
        }
Пример #5
0
 public UBIReformValue(string name, string description, int id, DoubleConditionsList condition) : base(name, description, id, condition)
 {
 }
Пример #6
0
        /// <summary>
        /// Basic constructor for resource getting FactoryType
        /// </summary>
        internal ProductionType(string name, Storage basicProduction, bool shaft)
        {
            //var product = basicProduction.Product;
            //if (product == Product.Cattle|| product == Product.Cotton || product == Product.Fish
            //    || product == Product.Fruit|| product == Product.Grain
            //    || product == Product.Tobacco || product == Product.Wood )
            //    _isRural = true;

            this.name  = name;
            nameWeight = name.GetWeight();
            if (name == "Gold pit")
            {
                GoldMine = this;
            }
            if (name == "Furniture factory")
            {
                Furniture = this;
            }
            if (name == "Metal pit")
            {
                MetalDigging = this;
            }
            if (name == "Metal smelter")
            {
                MetalSmelter = this;
            }
            if (name == "Barnyard")
            {
                Barnyard = this;
            }
            allTypes.Add(this);
            this.basicProduction = basicProduction;

            enoughMoneyOrResourcesToBuild = new Condition(
                delegate(object forWhom)
            {
                var agent = forWhom as Agent;
                if (agent.Country.economy.getValue() == Economy.PlannedEconomy)
                {
                    return(agent.Country.countryStorageSet.has(GetBuildNeeds()));
                }
                else
                {
                    var cost = GetBuildCost();
                    return(agent.CanPay(cost));
                }
            },
                delegate
            {
                var sb   = new StringBuilder();
                var cost = GetBuildCost();
                sb.Append("Have ").Append(cost).Append(" coins");
                sb.Append(" or (with ").Append(Economy.PlannedEconomy).Append(") have ").Append(GetBuildNeeds().getString(", "));
                return(sb.ToString());
            }, true);

            // Using: Country () , province, this <FactoryType>
            // used in BuildPanel only, only for Game.Player
            // Should be: de-facto Country, Investor, this <FactoryType> (change Economy.isNot..)
            // Ideally: Agent, FactoryProject
            // or put it in FactoryProject
            conditionsBuildThis = new DoubleConditionsList(new List <Condition> {
                Economy.isNotLF, Economy.isNotInterventionism, enoughMoneyOrResourcesToBuild,
                allowsForeignInvestments
            });                             //
            this.shaft = shaft;
        }
Пример #7
0
 internal FamilyPlanningValue(string inname, string indescription, int id, DoubleConditionsList condition, Procent growthRate)
     : base(inname, indescription, id, condition)
 {
     LifeQualityImpact = new Procent(ID, 10f);
     GrowthRate        = growthRate;
 }
Пример #8
0
 internal UnemploymentReformValue(string name, string description, int id, DoubleConditionsList condition)//, Procent procent
     : base(name, description, id, condition)
 {
     LifeQualityImpact = new Procent(ID * 2f, 10f); // doubles impact
 }
Пример #9
0
 internal RichTaxValue(int ID, float number, DoubleConditionsList condition) : base(ID, new Procent(number), condition)
 {
     LifeQualityImpact = new Procent(ID, 10f);
 }
Пример #10
0
 internal MinWageReformValue(string inname, string indescription, int id, DoubleConditionsList condition)
     : base(inname, indescription, id, condition)
 {
     LifeQualityImpact = new Procent(ID, 10f);
 }
Пример #11
0
 internal SerfdomReformValue(string name, string description, int id, DoubleConditionsList condition) : base(name, description, id, condition)
 {
     // this.allowed = condition;
 }
Пример #12
0
 internal PoorTaxValue(int ID, float number, DoubleConditionsList condition) : base(ID, new Procent(number), condition)
 {
 }
Пример #13
0
 internal NamedReformValue(string name, string description, int id, DoubleConditionsList condition) : base(id, condition)
 {
     this.description = description;
     this.name        = name;
 }
Пример #14
0
 internal MinorityPolicyValue(string inname, string indescription, int idin, DoubleConditionsList condition) : base(inname, indescription, idin, condition)
 {
 }
Пример #15
0
 internal ProcentReformValue(int ID, Procent procent, DoubleConditionsList condition) : base(ID, condition)
 {
     Procent = procent;
 }