public void ModuleBuy(JournalModuleBuy e)
        {
            string sid = Key(e.ShipFD, e.ShipId);

            ShipInformation sm = EnsureShip(sid);       // this either gets current ship or makes a new one.

            sm = sm.SetShipDetails(e.Ship, e.ShipFD);   // shallow copy if changed

            if (e.StoredItem.Length > 0)                // if we stored something
            {
                StoredModules = StoredModules.StoreModule(e.StoredItem, e.StoredItemLocalised);
            }

            // if we sold it, who cares?
            Ships[sid] = sm.AddModule(e.Slot, e.SlotFD, e.BuyItem, e.BuyItemFD, e.BuyItemLocalised); // replace the slot with this

            itemlocalisation[e.BuyItem] = e.BuyItemLocalised;                                        // record any localisations
            if (e.SellItem.Length > 0)
            {
                itemlocalisation[e.SellItem] = e.SellItemLocalised;
            }
            if (e.StoredItem.Length > 0)
            {
                itemlocalisation[e.StoredItem] = e.StoredItemLocalised;
            }

            VerifyList();
        }
Example #2
0
        public void ModuleBuy(JournalModuleBuy e)
        {
            string sid = Key(e.ShipFD, e.ShipId);

            ShipInformation sm = EnsureShip(sid);              // this either gets current ship or makes a new one.

            if (e.StoredItem.Length > 0)                       // if we stored something
            {
                StoredModules = StoredModules.StoreModule(e.StoredItem, e.StoredItemLocalised);
            }

            // if we sold it, who cares?
            Ships[sid] = sm.AddModule(e.Slot, e.SlotFD, e.BuyItem, e.BuyItemFD, e.BuyItemLocalised); // replace the slot with this

            itemlocalisation[e.BuyItem] = e.BuyItemLocalised;                                        // record any localisations
            if (e.SellItem.Length > 0)
            {
                itemlocalisation[e.SellItem] = e.SellItemLocalised;
            }
            if (e.StoredItem.Length > 0)
            {
                itemlocalisation[e.StoredItem] = e.StoredItemLocalised;
            }

            currentid = sid;           // must be in it to do this
        }