Beispiel #1
0
        //bool isStorable()
        //{
        //    return storable;
        //}
        //void setStorable(bool isStorable)
        //{
        //    storable = isStorable;
        //}

        internal Value getDefaultPrice()
        {
            if (isResource())
            {
                return(defaultPrice.Copy().Multiply(Options.defaultPriceLimitMultiplier));
            }
            else
            {
                var type = ProductionType.whoCanProduce(this);
                if (type == null)
                {
                    return(defaultPrice.Copy().Multiply(Options.defaultPriceLimitMultiplier));
                }
                else
                {
                    Value res = Game.market.getCost(type.resourceInput);
                    res.Multiply(Options.defaultPriceLimitMultiplier);
                    res.Divide(type.basicProduction);
                    return(res);
                }
            }
        }
Beispiel #2
0
        private static void IndustrialStart()
        {
            foreach (var item in AllExistingCountries())
            {
                item.Science.Invent(Invention.Universities);
                item.Science.Invent(Invention.Manufactures);
                item.Science.Invent(Invention.Metal);
                item.Science.Invent(Invention.Gunpowder);



                var resurceEnterprise = ProductionType.whoCanProduce(item.Capital.getResource());
                var aristocrats       = item.Capital.AllPops.Where(x => x.Type == PopType.Aristocrats).First() as Aristocrats;

                if (resurceEnterprise != null && item.Science.IsInvented(resurceEnterprise.basicProduction.Product))
                {
                    item.Capital.BuildFactory(aristocrats, resurceEnterprise, resurceEnterprise.GetBuildCost(item.market), true);
                }

                var processingEnterprises = ProductionType.getAllInventedFactories(item).Where(x => x.hasInput() || x == ProductionType.University);

                var capitalists = item.Capital.AllPops.Where(x => x.Type == PopType.Capitalists).First() as Capitalists;
                for (int i = 0; i < 3; i++)
                {
                    var processingEnterprise = processingEnterprises.Random();
                    if (processingEnterprise.canBuildNewFactory(item.Capital, capitalists))
                    {
                        item.Capital.BuildFactory(capitalists, processingEnterprise, processingEnterprise.GetBuildCost(item.market), true);
                    }
                }

                //ProductionType.getAllInventedFactories(Country).Where(x=>x.canBuildNewFactory);
                //var res = new Factory(this, investor, type, cost);
                //allFactories.Add(res);
            }
        }