Exemplo n.º 1
0
 public Research(MilleniumGoalsSet bonus, int price, ConstructionType type)
 {
     done         = false;
     this.bonus   = bonus;
     cost         = price;
     researchType = type;
 }
        public static MilleniumGoalsSet operator -(MilleniumGoalsSet a, MilleniumGoalsSet b)
        {
            MilleniumGoalsSet c = new MilleniumGoalsSet();

            c.environment = a.environment - b.environment;
            c.energy      = a.energy - b.energy;
            c.education   = a.education - b.education;
            c.economy     = a.economy - b.economy;
            c.health      = a.health - b.health;
            c.food        = a.food - b.food;
            return(c);
        }
        public static MilleniumGoalsSet operator *(MilleniumGoalsSet a, float b)
        {
            MilleniumGoalsSet c = new MilleniumGoalsSet();

            c.environment = a.environment * b;
            c.energy      = a.energy * b;
            c.education   = a.education * b;
            c.economy     = a.economy * b;
            c.health      = a.health * b;
            c.food        = a.food * b;
            return(c);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Building production modifier. Is determined by research.
        /// </summary>
        /// <param name="year"></param>
        /// <returns></returns>
        public MilleniumGoalsSet Production(int year)
        {
            MilleniumGoalsSet p = new MilleniumGoalsSet(1, 1, 1, 1, 1, 1);

            foreach (Research r in GameManager.ResearchList)
            {
                if (r.Completed && r.YearCompleted <= year)
                {
                    p += r.Bonus;
                }
            }
            return(p);
        }
Exemplo n.º 5
0
        public MilleniumGoalsSet GetModifierByResearch(int year)
        {
            MilleniumGoalsSet modifier = new MilleniumGoalsSet(1, 1, 1, 1, 1, 1);

            foreach (Research r in researchList)
            {
                if (r.YearAvailable <= year && r.Completed)
                {
                    modifier += r.Bonus;
                }
            }
            return(modifier);
        }
Exemplo n.º 6
0
        public MilleniumGoalsSet GetConsumptionCoverage(int year)
        {
            MilleniumGoalsSet production  = GetBuildingProduction(year);
            MilleniumGoalsSet consumption = baseConsumptionPerPerson * GameManager.Modifier.Consumption(year) * (GetPopulation(year) + Overpopulation(year));
            MilleniumGoalsSet coverage    = new MilleniumGoalsSet();

            coverage.Economy   = production.Economy / consumption.Economy;
            coverage.Education = production.Education / consumption.Education;
            coverage.Energy    = production.Energy / consumption.Energy;
            if (consumption.Environment == 0)
            {
                coverage.Environment = 1;
            }
            else
            {
                coverage.Environment = production.Environment / consumption.Environment;
            }
            coverage.Food   = production.Food / consumption.Food;
            coverage.Health = production.Health / consumption.Health;
            return(coverage);
        }
Exemplo n.º 7
0
        public MilleniumGoalsSet GetBuildingProduction(int year)
        {
            MilleniumGoalsSet total = new MilleniumGoalsSet();

            foreach (Reservation res in GameMap.GetReservationsForYear(year))
            {
                int yearNew = 0;

                if (res.StartingYear < (int)HistoricalPeriod.HP2_FirstYear)
                {
                    if (res.UpgradeYear >= (int)HistoricalPeriod.HP2_FirstYear)
                    {
                        if (GameManager.CurrentYear < res.UpgradeYear)
                        {
                            yearNew = (int)HistoricalPeriod.HP1_FirstYear;
                        }
                        else
                        {
                            yearNew = (int)HistoricalPeriod.HP2_FirstYear;
                        }
                    }
                    else
                    {
                        yearNew = (int)HistoricalPeriod.HP1_FirstYear;
                    }
                }
                else
                {
                    yearNew = (int)HistoricalPeriod.HP2_FirstYear;
                }

                if (res.Status(year) == ConstructionStatus.InProduction)
                {
                    total += GameManager.BuildingBonuses.BuildingMilleniumGoalSet(res.ConstructionName, yearNew) * GameManager.Modifier.Production(year);
                }
            }
            total += GameMap.MapProduction;
            return(total);
        }
Exemplo n.º 8
0
 public PopulationManager(Game game) : base(game)
 {
     baseConsumptionPerPerson = new MilleniumGoalsSet(1f, 1f, 1f, 1f, 1f, 1f);
     populationLevels         = new List <float>(GameManager.MaximumTimeRange);
 }
        private MilleniumGoalsSet BuildingMilleniumGoalSet_HP1(Construction building)
        {
            MilleniumGoalsSet GoalSet;

            switch (building)
            {
            case Construction.EnergySolar:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EnergySolid:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EnergyWind:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EnergyGeo:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EnergyNuclear:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.FoodCropFarm:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(-250, 0, 0, 0, 800, 0);
                break;

            case Construction.FoodAnimalFarm:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(-100, 0, 0, 0, 700, 0);
                break;

            case Construction.FoodOrchard:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(-50, 0, 0, 0, 250, 0);
                break;

            case Construction.FoodFarmedFisherie:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(-150, 0, 0, 0, 650, 0);
                break;

            case Construction.FoodWildFisherie:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.HealthClinic:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(-150, 400, 0, 0, -50, 0);
                break;

            case Construction.HealthHospital:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(-400, 1400, 0, 0, -100, 0);
                break;

            case Construction.HealthLaboratory:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EnvironmentNursery:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EnvironmentWaterPurification:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EnvironmentRecycling:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EducationSchool:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(-100, 0, 500, 0, -50, 0);
                break;

            case Construction.EducationHighSchool:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(-200, 0, 1200, 0, -100, 0);
                break;

            case Construction.EducationUniversity:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(-400, 0, 2800, 0, -200, 0);
                break;

            case Construction.EducationResearch:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EconomyMine:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(1800, -200, 0, 0, -250, 0);
                break;

            case Construction.EconomyFactory:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(1500, -150, 0, 0, -250, 0);
                break;

            case Construction.EconomyOilWell:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.EconomySawMill:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(900, -150, 0, 0, -150, 0);
                break;

            case Construction.PopulationVillage:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.PopulationTown:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.PopulationCity:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            case Construction.PopulationMetropolis:
                //Economy, Health, Education, Energy, Food, Environment
                GoalSet = new MilleniumGoalsSet(0, 0, 0, 0, 0, 0);
                break;

            default:
                GoalSet = new MilleniumGoalsSet();
                break;
            }

            return(GoalSet);
        }