예제 #1
0
 /// <summary>
 /// Costruttore dell'insedimento da utilizzare per la creazione degli imperi
 /// </summary>
 /// <param name="type"></param>
 /// <param name="money"></param>
 /// <param name="inhabitants"></param>
 /// <param name="defense"></param>
 /// <param name="offense"></param>
 /// <param name="religion"></param>
 public Settlement(SettlementType type, int money, int inhabitants, int defense, int offense, Religion.ReligionType religion)
 {
     products = new List<Product>();
     this.type = type;
     this.money = money;
     this.inhabitants = inhabitants;
     defensiveArmy = defense;
     offensiveArmy = offense;
     SetInitialRates(religion);
 }
예제 #2
0
 public Empire(SolarSystem startingSystem, Religion.ReligionType religion, string name)
 {
     knownSystems = new List<SolarSystem>();
     ownedSystems = new List<SolarSystem>();
     ownedSystems.Add(startingSystem);
     fleet = new List<Ship>();
     empireRelations = new List<Relation>();
     empireReligion = religion;
     empireName = name;
     if(rnd == null)
        rnd = new Random();
     missingSecondsToUpdate = rnd.Next(1, 60);
 }
예제 #3
0
 public Empire(string name, Religion.ReligionType religion, List<SolarSystem> knownSys, List<SolarSystem> ownedSys, List<Ship> fleet,
     List<Relation> relations, Planet capital)
 {
     empireName = name;
     empireReligion = religion;
     knownSystems = knownSys;
     ownedSystems = ownedSys;
     this.fleet = fleet;
     empireRelations = relations;
     capitalPlanet = capital;
     if (rnd == null)
         rnd = new Random();
     missingSecondsToUpdate = rnd.Next(1, 60);
 }
예제 #4
0
 /// <summary>
 /// Costruttore dell'insediamento del giocatore
 /// </summary>
 /// <param name="type"></param>
 /// <param name="religion"></param>
 public Settlement(SettlementType type, Religion.ReligionType religion)
 {
     products = new List<Product>();
     this.type = type;
     money = 20000;
     inhabitants = 50000;
     //inhabitants = 100000000;//
     defensiveArmy = 3000;
     offensiveArmy = 20;
     SetInitialRates(religion);
     //scienceGrowthRate = 100f;//
     //commerceGrowthRate = 100f;//
     //tecnoGrowthRate = 100f;//
     //inhaGrowthRate = 1.5f;//
 }
예제 #5
0
        private void SetInitialRates(Religion.ReligionType religion)
        {
            Random rnd = new Random(this.GetHashCode());
            int max = 5;
            if (GameParams.gameDifficulty == GameParams.Difficulty.NORMAL)
                max = 15;
            else if (GameParams.gameDifficulty == GameParams.Difficulty.HARD)
                max = 30;

            scienceLevel = (float)(rnd.NextDouble() * max);
            commerceLevel = (float)(rnd.NextDouble() * max);
            tecnoLevel = (float)(rnd.NextDouble() * max);

            inhaGrowthRate = rnd.Next(1, 10) / 10000f + 1f;
            scienceGrowthRate = rnd.Next(1, 4) / 10f;
            commerceGrowthRate = rnd.Next(1, 4) / 10f;
            tecnoGrowthRate = rnd.Next(1, 4) / 10f;

            switch(religion)
            {
                case Religion.ReligionType.ATEO:
                    commerceGrowthRate = 0.8f;
                    break;
                case Religion.ReligionType.ATOM:
                    scienceGrowthRate = 0.8f;
                    break;
                case Religion.ReligionType.CURSER:
                    tecnoGrowthRate = 0.8f;
                    break;
                case Religion.ReligionType.BLESS:
                    defensiveArmy *= 2;
                    break;
            }
        }