private void Start()
    {
        Application.runInBackground = true;

        Universe = new OSTData.Universe(0);
        Universe.Build();

        PlayerCorp = Universe.CreateCorp(1);
        PlayerCorp.AddICU(200, "starting");

        OSTData.Station city = Universe.GetStation(2);
        city.CreateHangar(PlayerCorp);
        OSTData.Station mine = Universe.GetStation(6);
        mine.CreateHangar(PlayerCorp);
        OSTData.Station reprocessing = Universe.GetStation(21);
        reprocessing.CreateHangar(PlayerCorp);
        OSTData.Ship            ship = city.CreateShip(PlayerCorp);
        OSTData.ShipDestination dest = ship.AddDestination(city);
        dest.AddLoad(OSTData.ResourceElement.ResourceType.Wastes, 50);
        OSTData.ShipDestination dest2 = ship.AddDestination(mine);
        dest2.AddUnload(OSTData.ResourceElement.ResourceType.Wastes, 50);
        ship.Start();

        OSTData.Ship            ship2 = mine.CreateShip(PlayerCorp);
        OSTData.ShipDestination dest3 = ship2.AddDestination(reprocessing);
        dest3.AddUnload(OSTData.ResourceElement.ResourceType.Wastes, 100);
        OSTData.ShipDestination dest4 = ship2.AddDestination(mine);
        dest4.AddLoad(OSTData.ResourceElement.ResourceType.Wastes, 100);
        ship2.Start();
    }
示例#2
0
        /// <summary>
        /// Permet de creer une nouvelle corporation dans l'univers.
        /// De base la corporation possede un capital de 100 ICU.
        /// </summary>
        /// <param name="ID"> L'identifiant unique de la corp</param>
        /// <returns> La corporation cree si l'id etait libre, null sinon</returns>
        public Corporation CreateCorp(int ID)
        {
            if (_corporations.ContainsKey(ID))
            {
                return(null);
            }

            Corporation corp = new Corporation(ID);

            _corporations.Add(ID, corp);
            corp.AddICU(100, "starting");
            return(corp);
        }