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();
    }
Exemplo n.º 2
0
    public void CreateShipInfoView(OSTData.Ship ship)
    {
        ShipInfoView view   = Instantiate <ShipInfoView>(shipInfoViewPrefab);
        Window       window = winSystem.NewWindow("ship info", view.gameObject);

        window.Title = "Ship " + ship.ID;
        view.SetShip(ship);
    }
Exemplo n.º 3
0
    public void SetShip(OSTData.Ship ship)
    {
        _ship = ship;

        _ship.onDestinationChange += UpdateDestinations;

        shipName.text = "ship " + _ship.ID.ToString();

        UpdateDestinations();
    }
 private void Update()
 {
     time += Time.deltaTime;
     while (time > timePerUpdate)
     {
         time -= timePerUpdate;
         Universe.Update();
         OSTData.Ship s = Universe.Ships[0];
     }
 }
Exemplo n.º 5
0
 public void SetShip(OSTData.Ship ship)
 {
     _ship         = ship;
     shipName.text = "SHIP " + _ship.ID;
 }