コード例 #1
0
        }                                                                       // SPECIAL USE ONLY - DOES NOT COMPUTE ALL THE OTHER STUFF

        #region Entry processing

        // Called on a New Entry, by EDDiscoveryController:NewEntry, to add an journal entry in.  May return null or empty list, or multiple entries.

        public List <HistoryEntry> AddJournalEntryToHistory(JournalEntry je, Action <string> logerror)
        {
            HistoryEntry he = HistoryEntry.FromJournalEntry(je, hlastprocessed);     // we may check edsm for this entry

            he.UpdateMaterialsCommodities(MaterialCommoditiesMicroResources.Process(je, hlastprocessed?.journalEntry, he.Status.TravelState == HistoryEntryStatus.TravelStateType.SRV));

            // IN THIS order, so suits can be added, then weapons, then loadouts
            he.UpdateSuits(SuitList.Process(je, he.WhereAmI, he.System));
            he.UpdateWeapons(WeaponList.Process(je, he.WhereAmI, he.System));
            he.UpdateLoadouts(SuitLoadoutList.Process(je, WeaponList, he.WhereAmI, he.System));

            // check here to see if we want to remove the entry.. can move this lower later, but at first point where we have the data

            he.UpdateStats(je, statisticsaccumulator, he.StationFaction);
            he.UpdateSystemNote();

            CashLedger.Process(je);
            he.Credits = CashLedger.CashTotal;

            Shipyards.Process(je);
            Outfitting.Process(je);

            Tuple <ShipInformation, ModulesInStore> ret = ShipInformationList.Process(je, he.WhereAmI, he.System);

            he.UpdateShipInformation(ret.Item1);
            he.UpdateShipStoredModules(ret.Item2);

            he.UpdateMissionList(MissionListAccumulator.Process(je, he.System, he.WhereAmI));

            hlastprocessed = he;

            var reorderlist = ReorderRemove(he);

            foreach (var heh in reorderlist.EmptyIfNull())
            {
                heh.Index = historylist.Count; // store its index
                historylist.Add(heh);          // then add to history
                AddToVisitsScan(logerror);     // add to scan database and complain if can't add. Do this after history add, so it has a list.
            }

            return(reorderlist);
        }
コード例 #2
0
        // Called on a New Entry, by EDDiscoveryController:NewEntry, to add an journal entry in.  May return null if don't want it in history

        public HistoryEntry AddJournalEntryToHistory(JournalEntry je, Action <string> logerror)
        {
            HistoryEntry hprev = GetLast;

            HistoryEntry he = HistoryEntry.FromJournalEntry(je, hprev);     // we may check edsm for this entry

            he.UpdateMaterialsCommodities(MaterialCommoditiesMicroResources.Process(je));

            if (CheckForRemoval(he, hprev))                                     // check here to see if we want to remove the entry.. can move this lower later, but at first point where we have the data
            {
                return(null);
            }

            he.UpdateStats(je, statisticsaccumulator, he.StationFaction);
            he.UpdateSystemNote();

            CashLedger.Process(je);
            he.Credits = CashLedger.CashTotal;

            Shipyards.Process(je);
            Outfitting.Process(je);

            Tuple <ShipInformation, ModulesInStore> ret = ShipInformationList.Process(je, he.WhereAmI, he.System);

            he.UpdateShipInformation(ret.Item1);
            he.UpdateShipStoredModules(ret.Item2);

            he.UpdateMissionList(MissionListAccumulator.Process(je, he.System, he.WhereAmI));

            he.UpdateWeapons(WeaponList.Process(je, he.WhereAmI, he.System));          // update the entries in suit entry list
            he.UpdateSuits(SuitList.Process(je, he.WhereAmI, he.System));
            he.UpdateLoadouts(SuitLoadoutList.Process(je, WeaponList, he.WhereAmI, he.System));

            historylist.Add(he);                                         // then add to history

            AddToVisitsScan(this, this.historylist.Count - 1, logerror); // add to scan database and complain if can't add. Do this after history add, so it has a list.

            return(he);
        }