コード例 #1
0
        private void AddShipCargoGraphic(Inventory inventory)
        {
            string name = GetName(inventory);
            Tuple<decimal, decimal> credits = _station.GetPrice_Sell(inventory);

            string[] actions = inventory.Ship != null ?
                _actions_Player_Cargo_ship :
                _actions_Player_Cargo_nonship;

            InventoryEntry entry = new InventoryEntry();
            entry.SetInventory(inventory, name, credits.Item1 * credits.Item2, Convert.ToDouble(credits.Item2), null, _world, actions, _editorOptions);

            //pnlCargo.Children.Add(entry);
            AddToPanel(pnlCargo, entry);

            InventoryEntryAdded(entry);
        }
コード例 #2
0
        private void StoreIn_Nearby(Inventory inventory, string name)
        {
            // Create an entry with the sell price
            Tuple<decimal, decimal> credits = _station.GetPrice_Sell(inventory);

            string[] actions = inventory.Ship != null ?
                _actions_Player_FreeSpace_ship :
                _actions_Player_FreeSpace_nonship;

            InventoryEntry newEntry = new InventoryEntry();
            newEntry.SetInventory(inventory, name, credits.Item1 * credits.Item2, Convert.ToDouble(credits.Item2), null, _world, actions, _editorOptions);

            // Store it
            AddToPanel(pnlNearbyItems, newEntry);
            InventoryEntryAdded(newEntry);
        }
コード例 #3
0
        private void AddStationMineralGraphic(Inventory inventory)
        {
            string name = GetName(inventory);
            Tuple<decimal, decimal> credits = _station.GetPrice_Buy(inventory);

            InventoryEntry entry = new InventoryEntry();
            entry.SetInventory(inventory, name, credits.Item1 * credits.Item2, Convert.ToDouble(credits.Item2), null, _world, _actions_Station_Minerals, _editorOptions);

            AddToPanel(pnlStationMinerals, entry);

            InventoryEntryAdded(entry);
        }
コード例 #4
0
        private void StoreIn_Hangar_Nearby(Inventory inventory, string name)
        {
            // Figure out where to put it
            string[] actions;
            Panel panel;
            bool isHangar;

            if (_station.PurchasedVolume - _station.UsedVolume >= inventory.Volume)
            {
                // Hangar
                actions = inventory.Ship != null ? _actions_Player_Hangar_ship : _actions_Player_Hangar_nonship;
                panel = pnlHangar;
                isHangar = true;
            }
            else
            {
                // Nearby
                actions = inventory.Ship != null ? _actions_Player_FreeSpace_ship : _actions_Player_FreeSpace_nonship;
                panel = pnlNearbyItems;
                isHangar = false;
            }

            // Create an entry with the sell price
            Tuple<decimal, decimal> credits = _station.GetPrice_Sell(inventory);

            InventoryEntry newEntry = new InventoryEntry();
            newEntry.SetInventory(inventory, name, credits.Item1 * credits.Item2, Convert.ToDouble(credits.Item2), null, _world, actions, _editorOptions);

            // Store it
            //panel.Children.Add(newEntry);
            AddToPanel(panel, newEntry);
            InventoryEntryAdded(newEntry);

            if (isHangar)
            {
                _station.PlayerInventory.Add(inventory);
                OnHangarChanged();
            }
        }