@kayahr/ed-journal
Version:
Typescript library to read/watch the player journal of Frontier's game Elite Dangerous
45 lines • 1.55 kB
JavaScript
/*
* Copyright (C) 2022 Klaus Reimer <k@ailis.de>
* See LICENSE.md for licensing information.
*/
import { registerJournalEventUpdate } from "../../JournalEvent.js";
import { correctStationService } from "../types/StationService.js";
registerJournalEventUpdate("Docked", (from, to) => {
if (from.Faction != null) {
to.StationFaction = { Name: from.Faction };
delete from.Faction;
}
if (from.Government != null) {
to.StationGovernment = from.Government;
delete from.Government;
}
if (from.Government_Localised != null) {
to.StationGovernment_Localised = from.Government_Localised;
delete from.Government_Localised;
}
if (from.Economy != null) {
to.StationEconomy = from.Economy;
delete from.Economy;
}
if (from.Economy_Localised != null) {
to.StationEconomy_Localised = from.Economy_Localised;
delete from.Economy_Localised;
}
if (from.Allegiance != null) {
to.StationAllegiance = from.Allegiance;
delete from.Allegiance;
}
if (typeof from.StationFaction === "string") {
to.StationFaction = {
Name: from.StationFaction
};
}
if (from.FactionState != null && to.StationFaction instanceof Object) {
to.StationFaction.FactionState = from.FactionState;
delete from.FactionState;
}
if (from.StationServices instanceof Array) {
to.StationServices = from.StationServices.map(correctStationService);
}
});
//# sourceMappingURL=Docked.js.map