public void construireVaisseaux(Vaisseaux vaisseaux)
        {
            if (!vaisseaux.Actif)
                    throw new Exception("Vaisseaux Non Constructible");

                // Verifier si les ressources sont ok

                // Traitement du temps
                TimeSpan tempsConstruction = new TimeSpan(0, 0, 0, 0, 0);

                m_FChantier.Enqueue(new m_ObjetConstruction(vaisseaux.Nom, tempsConstruction));
                m_ordreChantier.Enqueue("Vaisseaux");
        }
Example #2
0
        // Constructeur
        public Partie()
        {
            #region resources
            m_metal = 100d;
            m_crystal = 20d;
            m_uranium = 0d;

            m_pourcentageMetal   = 100;
            m_pourcentageCrystal = 100;
            m_pourcentageUranium = 100;

            m_pourcentageCentrale = 100;
            m_pourcentageNucleaire = 100;

            m_IncrementMetal   = 0.1d;
            m_IncrementCrystal = 0.05d;
            m_IncrementUranium = 0d;

            m_CapaciteMaxMetal = 100000d;
            m_CapaciteMaxCrystal = 100000d;
            m_CapaciteMaxUranium = 100000d;

            #endregion

            #region Batiment
            m_MineMetal =   	   new Batiment("Mine de Metal",			 0, true, 20,   10, 0, 0);
            m_MineCrystal = 	   new Batiment("Mine de Crystal",  		 0, true, 18,   8, 0, 0);
            m_MineUranium = 	   new Batiment("Synthetiseur d'uranium235", 0, true, 70,   45, 0, 0);
            m_SiloMetal =   	   new Batiment("Silo de metal",			 0, true, 2000, 0, 0, 0);
            m_SiloCrystal = 	   new Batiment("Silo de crystal",			 0, true, 2000, 1000, 0, 0);
            m_SiloUranium = 	   new Batiment("Silo d'uranium",			 0, true, 2000, 2000, 0, 0);
            m_CentraleEnergie =    new Batiment("Centrale d'energie",		 0, true, 0, 0, 0, 0);
            m_CentraleNucleraire = new Batiment("Centrale Nucleraire",		 0, false, 0, 0, 0, 0);
            m_Usine = 			   new Batiment("Usine",					 0, true, 0, 0, 0, 0);
            m_ChantierSpatial =    new Batiment("Chantier Spatial",			 0, false, 0, 0, 0, 0);
            m_UsineNano = 		   new Batiment("Usine Nanotechnique",		 0, false, 2000000, 2000000, 1000000, 0);
            m_CentreTechnique =    new Batiment("Centre Technique",			 0, true,  400, 800, 400, 0);
            m_Convertisseur =      new Batiment("Convertisseur",			 0, false, 0, 0, 0, 0);
            m_Terraformeur = 	   new Batiment("Terraformeur",				 0, false, 0, 0, 0, 0);
            m_HangardMissile = 	   new Batiment("Hangard a missile",		 0, true, 10000, 10000, 1000, 0);
            #endregion

            #region Technologies
            m_Laser = 				 	new Technologie("Laser", 0, false, 400, 200, 0, 0);
            m_Ion =    					new Technologie("Ion", 0, false, 0, 0, 0, 0);
            m_Plasma = 					new Technologie("Plasma", 0, false, 0, 0, 0, 0);

               		m_Propulsion = 		  		new Technologie("Propulsion", 0, false, 400, 0, 600, 0);
               		m_Hyperespace =   	  		new Technologie("Hyperespace", 0, false, 0, 0, 0, 0);
               		m_PropulsionPoussee = 		new Technologie("Propulsion Amelioree", 0, false, 2000, 4000, 600, 0); //a modifier

               		m_Espionage = 		  		new Technologie("Espionage", 0, false, 400, 1500, 300, 0);

            m_Crystalisateur = 	  		new Technologie("Crystalisateur", 0, false, 1000, 0, 800, 0);
            m_StationDeForage =   	 	new Technologie("Station de Forage", 0, false, 0, 400, 800, 0);
            m_StabilisationIsotopique = new Technologie("Stabilisation Isotopique", 0, false, 1200, 800, 0, 0);

            m_Blindage = 				new Technologie("Blindage", 0, false, 1000,  0, 0, 0);
            m_Armement = 				new Technologie("Armement", 0, false, 750, 250, 0, 0);
            m_Bouclier = 				new Technologie("Bouclier", 0, false, 0,     0, 0, 0);

            m_CoordinationDesCentres  = new Technologie("Coordination des centres techniques", 0, false, 0, 0, 0, 0);
            m_CoordinationDesFlottes  = new Technologie("Coordination des flottes", 0, false, 0, 600, 1000, 0);
            m_CoordinationDesPlanetes = new Technologie("Coordination des planetes", 0, false, 2000, 2500, 800, 0);

            m_Planetarion = new Technologie("Planetarion", 0, false, 0, 0, 0, 0);
            #endregion

            #region Flotte
            m_NavLeg =      new Vaisseaux("Navette Legere",    0, false, 2000, 1000, 20, 5000, 0, 0, 0, 0);
            m_NavLrd =      new Vaisseaux("Navette Lourde",    0, false, 40000, 25000, 200, 50000, 0, 0, 0, 0);
            m_Chasseur =    new Vaisseaux("Chasseur",          0, false, 3500, 1000, 20, 50, 0, 0, 0, 0);
            m_Escorteur =   new Vaisseaux("Escorteur",         0, false, 0, 0, 75, 100, 0, 0, 0, 0);
            m_Frégate =     new Vaisseaux("Fregate",           0, false, 0, 0, 250, 1000, 0, 0, 0, 0);
            m_Destroyer =   new Vaisseaux("Destroyer",         0, false, 0, 0, 350, 1250, 0, 0, 0, 0);
            m_Croiseur =    new Vaisseaux("Croiseur",          0, false, 0, 0, 750, 500, 0, 0, 0, 0);
            m_Forteresse =  new Vaisseaux("Forteresse",        0, false, 0, 0, 1000, 2000, 0, 0, 0, 0);
            m_BatAmiral =   new Vaisseaux("Batiment Amiral",   0, false, 5000000, 3000000, 2500000, 10, 0, 0, 0, 0);
            m_SatSol =      new Vaisseaux("Satellite Solaire", 0, false, 0, 2500, 0, 0, 0, 0, 0, 0);
            m_Collecteur =  new Vaisseaux("Collecteur",        0, false, 0, 0, 300, 20000, 0, 0, 0, 0);
            m_SondeEspion = new Vaisseaux("Sonde Espion",      0, false, 0, 0, 5, 1, 0, 0, 0, 0);
            #endregion

            #region Defense
            m_CanonLaser =   new Defense("Canon Laser",				  0, false, 30000, 0, 0, 500, 100, 10500, 0);
            m_CanonIon =     new Defense("Canon a Ion",				  0, false, 0, 0, 0, 300, 600, 9000, 0);
            m_CanonPlasma =  new Defense("Canon Plasma",			  0, false, 0, 0, 0, 4000, 500, 95000, 0);
            m_CanonGauss =   new Defense("Canon Gauss",				  0, false, 0, 0, 0, 1150, 250, 35000, 0);
            m_ChampDeForce = new Defense("Champ de Force",			  0, false, 0, 0, 0, 1, 10000, 10000, 0);
            m_MissileInter = new Defense("Missile Interplanetaire",   0, false, 0, 0, 0, 15000, 1, 18000, 0);
            m_ContreMesure = new Defense("Contre Mesure de defense",  0, false, 0, 0, 0, 1, 1, 6000, 0);
            m_PlateFormeSpatiale = false;
            #endregion

            #region File de Construction
            m_FConstruction = new Queue<m_ObjetConstruction>();
            m_FChantier = new Queue<m_ObjetConstruction>();
            m_ordreChantier = new Queue<string>();
            m_FTechnologie = new Queue<m_ObjetConstruction>();
            #endregion

            m_secondes = 0;
            m_minutes = 0;
            m_heures = 0;
            m_jours = 0;

            #region Listes Batiments - Defenses - Technologies - Vaisseaux

            #region Batiments
            Batiment[] m_ListeBatiments = new Batiment[] { m_MineCrystal,m_SiloCrystal,
                                                           m_MineMetal,m_SiloMetal,
                                                           m_MineUranium,m_SiloUranium,
                                                           m_Usine, m_UsineNano,
                                                           m_ChantierSpatial, m_Terraformeur,
                                                           m_CentraleEnergie, m_CentraleNucleraire,
                                                           m_CentreTechnique, m_Convertisseur, m_HangardMissile };
            #endregion

            #region Defenses
            Batiment[] m_ListeDefense = new Batiment[] { m_CanonLaser,m_CanonIon, m_ChampDeForce,
                                                         m_CanonPlasma, m_CanonGauss,
                                                         m_ContreMesure, m_MissileInter };
            #endregion

            #region Technologies
            Technologie[] m_ListeTechnologies = new Technologie[] { m_Laser,  m_Ion, m_Plasma,
               																m_Propulsion, m_Hyperespace, m_PropulsionPoussee,
               																m_Espionage,
                                                                    m_Crystalisateur, m_StationDeForage, m_StabilisationIsotopique,
                                                                    m_Blindage, m_Armement, m_Bouclier,
                                                                    m_CoordinationDesCentres, m_CoordinationDesFlottes,  m_CoordinationDesPlanetes,
                                                                    m_Planetarion, };
            #endregion

            #region Vaisseaux
            Vaisseaux[] m_ListeVaisseaux = new Vaisseaux[] { m_NavLeg, m_NavLrd,
                                                             m_Chasseur, m_Escorteur,
                                                             m_Frégate, m_Destroyer,
                                                             m_Croiseur, m_Forteresse,
                                                             m_BatAmiral, m_SatSol,
                                                             m_Collecteur, m_SondeEspion };

            #endregion

            #endregion
        }