Exemple #1
0
        public void ModuleRetrieve(JournalModuleRetrieve e)
        {
            ShipInformation sm = EnsureShip(e.ShipId);            // this either gets current ship or makes a new one.

            if (e.SwapOutItem.Length > 0)
            {
                StoredModules = StoredModules.StoreModule(e.SwapOutItem, e.SwapOutItemLocalised);
            }

            Ships[e.ShipId] = sm.AddModule(e.Slot, e.SlotFD, e.RetrievedItem, e.RetrievedItemFD, e.RetrievedItemLocalised);

            StoredModules = StoredModules.RemoveModule(e.RetrievedItem);
        }
Exemple #2
0
        public void ModuleStore(JournalModuleStore e)
        {
            ShipInformation sm = EnsureShip(e.ShipId);            // this either gets current ship or makes a new one.

            if (e.ReplacementItem.Length > 0)
            {
                Ships[e.ShipId] = sm.AddModule(e.Slot, e.SlotFD, e.ReplacementItem, e.ReplacementItemFD, e.ReplacementItemLocalised);
            }
            else
            {
                Ships[e.ShipId] = sm.RemoveModule(e.Slot, e.StoredItem);
            }

            StoredModules = StoredModules.StoreModule(e.StoredItem, e.StoredItemLocalised);
            currentid     = e.ShipId;       // must be in it to do this
        }
Exemple #3
0
        public void ModuleBuy(JournalModuleBuy e)
        {
            ShipInformation sm = EnsureShip(e.ShipId);              // 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[e.ShipId] = 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 = e.ShipId;           // must be in it to do this
        }