ed_journals/modules/logs/content/
log_event_content.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
use kinded::Kinded;
use serde::{Deserialize, Serialize};
#[cfg(feature = "allow-unknown")]
use serde_json::Value;

use afmu_repairs_event::AFMURepairsEvent;
use applied_to_squadron_event::AppliedToSquadronEvent;
use approach_body_event::ApproachBodyEvent;
use approach_settlement_event::ApproachSettlementEvent;
use asteroid_cracked_event::AsteroidCrackedEvent;
use backpack_change_event::BackpackChangeEvent;
use backpack_event::BackpackEvent;
use book_dropship_event::BookDropshipEvent;
use book_taxi_event::BookTaxiEvent;
use bounty_event::BountyEvent;
use buy_ammo_event::BuyAmmoEvent;
use buy_drones_event::BuyDronesEvent;
use buy_exploration_data_event::BuyExplorationDataEvent;
use buy_micro_resource_event::BuyMicroResourceEvent;
use buy_suit_event::BuySuitEvent;
use buy_trade_data_event::BuyTradeDateEvent;
use buy_weapon_event::BuyWeaponEvent;
use cancel_dropship_event::CancelDropshipEvent;
use cancel_taxi_event::CancelTaxiEvent;
use cap_ship_bond_event::CapShipBondEvent;
use cargo_depot_event::CargoDepotEvent;
use cargo_event::CargoEvent;
use cargo_transfer_event::CargoTransferEvent;
use carrier_bank_transfer_event::CarrierBankTransferEvent;
use carrier_buy_event::CarrierBuyEvent;
use carrier_cancel_decommission_event::CarrierCancelDecommissionEvent;
use carrier_crew_services_event::CarrierCrewServicesEvent;
use carrier_decommision_event::CarrierDecommissionEvent;
use carrier_deposit_fuel_event::CarrierDepositFuelEvent;
use carrier_docking_permission_event::CarrierDockingPermissionEvent;
use carrier_finance_event::CarrierFinanceEvent;
use carrier_jump_cancelled_event::CarrierJumpCancelled;
use carrier_jump_event::CarrierJumpEvent;
use carrier_jump_request_event::CarrierJumpRequestEvent;
use carrier_module_pack_event::CarrierModulePackEvent;
use carrier_name_changed_event::CarrierNameChangeEvent;
use carrier_ship_pack_event::CarrierShipPackEvent;
use carrier_stats_event::CarrierStatsEvent;
use carrier_trade_order_event::CarrierTradeOrderEvent;
use change_crew_role_event::ChangeCrewRoleEvent;
use clear_impound_event::ClearImpoundEvent;
use clear_saved_game_event::ClearSavedGameEvent;
use codex_entry_event::CodexEntryEvent;
use collect_cargo_event::CollectCargoEvent;
use collect_items_event::CollectItemsEvent;
use commander_event::CommanderEvent;
use commit_crime_event::CommitCrimeEvent;
use community_goal_discard_event::CommunityGoalDiscardEvent;
use community_goal_join_event::CommunityGoalJoinEvent;
use community_goal_reward_event::CommunityGoalRewardEvent;
use continued_event::ContinuedEvent;
use create_suit_loadout_event::CreateSuitLoadoutEvent;
use crew_assign_event::CrewAssignEvent;
use crew_fire_event::CrewFireEvent;
use crew_hire_event::CrewHireEvent;
use crew_launch_fighter_event::CrewLaunchFighterEvent;
use crew_member_joins_event::CrewMemberJoinsEvent;
use crew_member_quits_event::CrewMemberQuitsEvent;
use crew_member_role_change_event::CrewMemberRoleChangeEvent;
use crime_victim_event::CrimeVictimEvent;
use data_scanned_event::DataScannedEvent;
use datalink_scan_event::DatalinkScanEvent;
use datalink_voucher_event::DatalinkVoucherEvent;
use delete_suit_loadout_event::DeleteSuitLoadoutEvent;
use died_event::DiedEvent;
use disbanded_squadron_event::DisbandedSquadronEvent;
use discovery_scan_event::DiscoveryScanEvent;
use disembark_event::DisembarkEvent;
use dock_fighter_event::DockFighterEvent;
use dock_srv_event::DockSRVEvent;
use docked_event::DockedEvent;
use docking_cancelled_event::DockingCancelled;
use docking_denied_event::DockingDeniedEvent;
use docking_granted_event::DockingGrantedEvent;
use docking_requested_event::DockingRequestedEvent;
use docking_timeout_event::DockingTimeoutEvent;
use drop_items_event::DropItemsEvent;
use drop_ship_deploy_event::DropshipDeployEvent;
use eject_cargo_event::EjectCargoEvent;
use embark_event::EmbarkEvent;
use end_crew_session_event::EndCrewSessionEvent;
use engineer_contribution_event::EngineerContributionEvent;
use engineer_craft_event::EngineerCraftEvent;
use engineer_progress_event::EngineerProgressEvent;
use escape_interdiction_event::EscapeInterdictionEvent;
use faction_kill_bond_event::FactionKillBondEvent;
use fc_embark_event::FCEmbarkEvent;
use fetch_remote_module_event::FetchRemoteModuleEvent;
use fighter_destroyed_event::FighterDestroyedEvent;
use fighter_rebuilt_event::FighterRebuiltEvent;
use file_header_event::FileHeaderEvent;
use friends_event::FriendsEvent;
use fsd_jump_event::FSDJumpEvent;
use fsd_target_event::FSDTargetEvent;
use fss_all_bodies_found_event::FSSAllBodiesFoundEvent;
use fss_body_signals_event::FSSBodySignalsEvent;
use fss_discovery_scan_event::FSSDiscoveryScan;
use fss_signal_discovered_event::FSSSignalDiscoveredEvent;
use fuel_scoop_event::FuelScoopEvent;
use hull_damage_event::HullDamageEvent;
use interdicted_event::InterdictedEvent;
use interdiction_event::InterdictionEvent;
use invited_to_squadron_event::InvitedToSquadronEvent;
use jet_cone_boost_event::JetConeBoostEvent;
use jet_cone_damage_event::JetConeDamageEvent;
use join_a_crew_event::JoinACrewEvent;
use joined_squadron_event::JoinedSquadronEvent;
use kick_crew_member_event::KickCrewMemberEvent;
use kicked_from_squadron_event::KickedFromSquadronEvent;
use launch_drone_event::LaunchDroneEvent;
use launch_fighter_event::LaunchFighterEvent;
use launch_srv_event::LaunchSRVEvent;
use leave_body_event::LeaveBodyEvent;
use left_squadron_event::LeftSquadronEvent;
use liftoff_event::LiftoffEvent;
use load_game_event::LoadGameEvent;
use loadout_equip_module_event::LoadoutEquipModuleEvent;
use loadout_event::LoadoutEvent;
use loadout_remove_module_event::LoadoutRemoveModuleEvent;
use location_event::LocationEvent;
use market_buy_event::MarketBuyEvent;
use market_event::MarketEvent;
use market_sell_event::MarketSellEvent;
use mass_module_store_event::MassModuleStoreEvent;
use material_collected_event::MaterialCollectedEvent;
use material_discarded_event::MaterialDiscarded;
use material_discovered_event::MaterialDiscoveredEvent;
use material_trade_event::MaterialTradeEvent;
use materials_event::MaterialsEvent;
use mining_refined::MiningRefinedEvent;
use mission_abandoned_event::MissionAbandonedEvent;
use mission_accepted_event::MissionAcceptedEvent;
use mission_completed_event::MissionCompletedEvent;
use mission_failed_event::MissionFailedEvent;
use mission_redirected_event::MissionRedirectedEvent;
use missions_event::MissionsEvent;
use module_buy_and_store_event::ModuleBuyAndStoreEvent;
use module_buy_event::ModuleBuyEvent;
use module_retrieve_event::ModuleRetrieveEvent;
use module_sell_event::ModuleSellEvent;
use module_sell_remote_event::ModuleSellRemoteEvent;
use module_store_event::ModuleStoreEvent;
use module_swap_event::ModuleSwapEvent;
use multi_sell_exploration_data_event::MultiSellExplorationDataEvent;
use music_event::MusicEvent;
use nav_beacon_scan_event::NavBeaconScanEvent;
use new_commander_event::NewCommanderEvent;
use npc_crew_rank_event::NPCCrewRankEvent;
use npc_crew_wage_paid_event::NPCCrewWagePaidEvent;
use outfitting_event::OutfittingEvent;
use passengers_event::PassengersEvent;
use pay_bounties_event::PayBountiesEvent;
use pay_fines_event::PayFinesEvent;
use powerplay_collect_event::PowerplayCollectEvent;
use powerplay_defect_event::PowerplayDefectEvent;
use powerplay_deliver_event::PowerplayDeliverEvent;
use powerplay_event::PowerplayEvent;
use powerplay_fast_track_event::PowerplayFastTrackEvent;
use powerplay_join_event::PowerplayJoinEvent;
use powerplay_leave_event::PowerplayLeaveEvent;
use powerplay_salary_event::PowerplaySalaryEvent;
use powerplay_vote_event::PowerplayVoteEvent;
use progress_event::ProgressEvent;
use promotion_event::PromotionEvent;
use prospected_asteroid_event::ProspectedAsteroidEvent;
use pvp_kill_event::PVPKillEvent;
use quit_a_crew_event::QuitACrewEvent;
use rank_event::RankEvent;
use reboot_repair_event::RebootRepairEvent;
use receive_text_event::ReceiveTextEvent;
use redeem_voucher_event::RedeemVoucherEvent;
use refuel_all_event::RefuelAllEvent;
use refuel_partial_event::RefuelPartialEvent;
use rename_suit_loadout_event::RenameSuitLoadoutEvent;
use repair_all_event::RepairAllEvent;
use repair_drone_event::RepairDroneEvent;
use repair_event::RepairEvent;
use reputation_event::ReputationEvent;
use reservoir_replenished_event::ReservoirReplenishedEvent;
use restock_vehicle_event::RestockVehicleEvent;
use resurrect_event::ResurrectEvent;
use saa_scan_complete_event::SAAScanCompleteEvent;
use saa_signals_found_event::SAASignalsFoundEvent;
use scan_bary_centre_event::ScanBaryCentreEvent;
use scan_event::ScanEvent;
use scan_organic_event::ScanOrganicEvent;
use scanned_event::ScannedEvent;
use scientific_research_event::ScientificResearchEvent;
use screenshot_event::ScreenshotEvent;
use search_and_rescue_event::SearchAndRescueEvent;
use sell_drones_event::SellDronesEvent;
use sell_exploration_date_event::SellExplorationDataEvent;
use sell_micro_resources_event::SellMicroResourcesEvent;
use sell_organic_data::SellOrganicDataEvent;
use sell_ship_on_rebuy_event::SellShipOnRebuyEvent;
use sell_suit_event::SellSuitEvent;
use sell_weapon_event::SellWeaponEvent;
use send_text_event::SendTextEvent;
use set_user_ship_name_event::SetUserShipNameEvent;
use shared_bookmark_to_squadron_event::ShardedBookmarkToSquadronEvent;
use shield_state_event::ShieldStateEvent;
use ship_locker_event::ShipLockerEvent;
use ship_targeted_event::ShipTargetedEvent;
use shipyard_buy_event::ShipyardBuyEvent;
use shipyard_event::ShipyardEvent;
use shipyard_new_event::ShipyardNewEvent;
use shipyard_sell_event::ShipyardSellEvent;
use shipyard_swap_event::ShipyardSwapEvent;
use shipyard_transfer_event::ShipyardTransferEvent;
use squadron_created_event::SquadronCreatedEvent;
use squadron_demotion_event::SquadronDemotionEvent;
use squadron_promotion_event::SquadronPromotionEvent;
use squadron_startup_event::SquadronStartupEvent;
use srv_destroyed_event::SRVDestroyedEvent;
use start_jump_event::StartJumpEvent;
use statistics_event::StatisticsEvent;
use stored_modules_event::StoredModulesEvent;
use stored_ships_event::StoredShipsEvent;
use suit_loadout_event::SuitLoadoutEvent;
use supercruise_destination_drop_event::SupercruiseDestinationDropEvent;
use supercruise_entry_event::SupercruiseEntryEvent;
use supercruise_exit_event::SupercruiseExitEvent;
use switch_suit_loadout_event::SwitchSuitLoadoutEvent;
use synthasis_event::SynthesisEvent;
use technology_broker_event::TechnologyBrokerEvent;
use touchdown_event::TouchdownEvent;
use trade_micro_resources_event::TradeMicroResourcesEvent;
use transfer_micro_resources_event::TransferMicroResourcesEvent;
use under_attack_event::UnderAttackEvent;
use undocked_event::UndockedEvent;
use upgrade_suit_event::UpgradeSuitEvent;
use upgrade_weapon_event::UpgradeWeaponEvent;
use use_consumable_event::UseConsumableEvent;
use uss_drop_event::USSDropEvent;
use vehicle_switch_event::VehicleSwitchEvent;
use wing_add_event::WingAddEvent;
use wing_invite_event::WingInviteEvent;
use wing_join_event::WingJoinEvent;
use won_a_trophy_for_squadron_event::WonATrophyForSquadronEvent;

use crate::logs::content::log_event_content::community_goal_event::CommunityGoalEvent;
use crate::logs::content::log_event_content::ship_redeemed::ShipRedeemed;
use crate::logs::content::log_event_content::shipyard_redeem::ShipyardRedeem;
use crate::logs::content::log_event_content::start_jump_event::StartJumpType;
use crate::modules::partials::PartialSystemInfo;

#[cfg(feature = "legacy")]
use crate::logs::content::log_event_content::legacy_liftoff_event::LegacyLiftoffEvent;

#[cfg(feature = "legacy")]
use crate::logs::content::log_event_content::legacy_touchdown_event::LegacyTouchdownEvent;

pub mod afmu_repairs_event;
pub mod applied_to_squadron_event;
pub mod approach_body_event;
pub mod approach_settlement_event;
pub mod asteroid_cracked_event;
pub mod backpack_change_event;
pub mod backpack_event;
pub mod book_dropship_event;
pub mod book_taxi_event;
pub mod bounty_event;
pub mod buy_ammo_event;
pub mod buy_drones_event;
pub mod buy_exploration_data_event;
pub mod buy_micro_resource_event;
pub mod buy_suit_event;
pub mod buy_trade_data_event;
pub mod buy_weapon_event;
pub mod cancel_dropship_event;
pub mod cancel_taxi_event;
pub mod cap_ship_bond_event;
pub mod cargo_depot_event;
pub mod cargo_event;
pub mod cargo_transfer_event;
pub mod carrier_bank_transfer_event;
pub mod carrier_buy_event;
pub mod carrier_cancel_decommission_event;
pub mod carrier_crew_services_event;
pub mod carrier_decommision_event;
pub mod carrier_deposit_fuel_event;
pub mod carrier_docking_permission_event;
pub mod carrier_finance_event;
pub mod carrier_jump_cancelled_event;
pub mod carrier_jump_event;
pub mod carrier_jump_request_event;
pub mod carrier_module_pack_event;
pub mod carrier_name_changed_event;
pub mod carrier_ship_pack_event;
pub mod carrier_stats_event;
pub mod carrier_trade_order_event;
pub mod change_crew_role_event;
pub mod clear_impound_event;
pub mod clear_saved_game_event;
pub mod codex_entry_event;
pub mod collect_cargo_event;
pub mod collect_items_event;
pub mod commander_event;
pub mod commit_crime_event;
pub mod community_goal_discard_event;
pub mod community_goal_event;
pub mod community_goal_join_event;
pub mod community_goal_reward_event;
pub mod continued_event;
pub mod create_suit_loadout_event;
pub mod crew_assign_event;
pub mod crew_fire_event;
pub mod crew_hire_event;
pub mod crew_launch_fighter_event;
pub mod crew_member_joins_event;
pub mod crew_member_quits_event;
pub mod crew_member_role_change_event;
pub mod crime_victim_event;
pub mod data_scanned_event;
pub mod datalink_scan_event;
pub mod datalink_voucher_event;
pub mod delete_suit_loadout_event;
pub mod died_event;
pub mod disbanded_squadron_event;
pub mod discovery_scan_event;
pub mod disembark_event;
pub mod dock_fighter_event;
pub mod dock_srv_event;
pub mod docked_event;
pub mod docking_cancelled_event;
pub mod docking_denied_event;
pub mod docking_granted_event;
pub mod docking_requested_event;
pub mod docking_timeout_event;
pub mod drop_items_event;
pub mod drop_ship_deploy_event;
pub mod eject_cargo_event;
pub mod embark_event;
pub mod end_crew_session_event;
pub mod engineer_contribution_event;
pub mod engineer_craft_event;
pub mod engineer_progress_event;
pub mod escape_interdiction_event;
pub mod faction_kill_bond_event;
pub mod fc_embark_event;
pub mod fetch_remote_module_event;
pub mod fighter_destroyed_event;
pub mod fighter_rebuilt_event;
pub mod file_header_event;
pub mod friends_event;
pub mod fsd_jump_event;
pub mod fsd_target_event;
pub mod fss_all_bodies_found_event;
pub mod fss_body_signals_event;
pub mod fss_discovery_scan_event;
pub mod fss_signal_discovered_event;
pub mod fuel_scoop_event;
pub mod hull_damage_event;
pub mod interdicted_event;
pub mod interdiction_event;
pub mod invited_to_squadron_event;
pub mod jet_cone_boost_event;
pub mod jet_cone_damage_event;
pub mod join_a_crew_event;
pub mod joined_squadron_event;
pub mod kick_crew_member_event;
pub mod kicked_from_squadron_event;
pub mod launch_drone_event;
pub mod launch_fighter_event;
pub mod launch_srv_event;
pub mod leave_body_event;
pub mod left_squadron_event;
pub mod liftoff_event;
pub mod load_game_event;
pub mod loadout_equip_module_event;
pub mod loadout_event;
pub mod loadout_remove_module_event;
pub mod location_event;
pub mod market_buy_event;
pub mod market_event;
pub mod market_sell_event;
pub mod mass_module_store_event;
pub mod material_collected_event;
pub mod material_discarded_event;
pub mod material_discovered_event;
pub mod material_trade_event;
pub mod materials_event;
pub mod mining_refined;
pub mod mission_abandoned_event;
pub mod mission_accepted_event;
pub mod mission_completed_event;
pub mod mission_failed_event;
pub mod mission_redirected_event;
pub mod missions_event;
pub mod module_buy_and_store_event;
pub mod module_buy_event;
pub mod module_retrieve_event;
pub mod module_sell_event;
pub mod module_sell_remote_event;
pub mod module_store_event;
pub mod module_swap_event;
pub mod multi_sell_exploration_data_event;
pub mod music_event;
pub mod nav_beacon_scan_event;
pub mod new_commander_event;
pub mod npc_crew_rank_event;
pub mod npc_crew_wage_paid_event;
pub mod outfitting_event;
pub mod passengers_event;
pub mod pay_bounties_event;
pub mod pay_fines_event;
pub mod powerplay_collect_event;
pub mod powerplay_defect_event;
pub mod powerplay_deliver_event;
pub mod powerplay_event;
pub mod powerplay_fast_track_event;
pub mod powerplay_join_event;
pub mod powerplay_leave_event;
pub mod powerplay_salary_event;
pub mod powerplay_vote_event;
pub mod progress_event;
pub mod promotion_event;
pub mod prospected_asteroid_event;
pub mod pvp_kill_event;
pub mod quit_a_crew_event;
pub mod rank_event;
pub mod reboot_repair_event;
pub mod receive_text_event;
pub mod redeem_voucher_event;
pub mod refuel_all_event;
pub mod refuel_partial_event;
pub mod rename_suit_loadout_event;
pub mod repair_all_event;
pub mod repair_drone_event;
pub mod repair_event;
pub mod reputation_event;
pub mod reservoir_replenished_event;
pub mod restock_vehicle_event;
pub mod resurrect_event;
pub mod saa_scan_complete_event;
pub mod saa_signals_found_event;
pub mod scan_bary_centre_event;
pub mod scan_event;
pub mod scan_organic_event;
pub mod scanned_event;
pub mod scientific_research_event;
pub mod screenshot_event;
pub mod search_and_rescue_event;
pub mod sell_drones_event;
pub mod sell_exploration_date_event;
pub mod sell_micro_resources_event;
pub mod sell_organic_data;
pub mod sell_ship_on_rebuy_event;
pub mod sell_suit_event;
pub mod sell_weapon_event;
pub mod send_text_event;
pub mod set_user_ship_name_event;
pub mod shared_bookmark_to_squadron_event;
pub mod shield_state_event;
pub mod ship_locker_event;
pub mod ship_redeemed;
pub mod ship_targeted_event;
pub mod shipyard_buy_event;
pub mod shipyard_event;
pub mod shipyard_new_event;
pub mod shipyard_redeem;
pub mod shipyard_sell_event;
pub mod shipyard_swap_event;
pub mod shipyard_transfer_event;
pub mod squadron_created_event;
pub mod squadron_demotion_event;
pub mod squadron_promotion_event;
pub mod squadron_startup_event;
pub mod srv_destroyed_event;
pub mod start_jump_event;
pub mod statistics_event;
pub mod stored_modules_event;
pub mod stored_ships_event;
pub mod suit_loadout_event;
pub mod supercruise_destination_drop_event;
pub mod supercruise_entry_event;
pub mod supercruise_exit_event;
pub mod switch_suit_loadout_event;
pub mod synthasis_event;
pub mod technology_broker_event;
pub mod touchdown_event;
pub mod trade_micro_resources_event;
pub mod transfer_micro_resources_event;
pub mod under_attack_event;
pub mod undocked_event;
pub mod upgrade_suit_event;
pub mod upgrade_weapon_event;
pub mod use_consumable_event;
pub mod uss_drop_event;
pub mod vehicle_switch_event;
pub mod wing_add_event;
pub mod wing_invite_event;
pub mod wing_join_event;
pub mod won_a_trophy_for_squadron_event;

#[cfg(feature = "legacy")]
pub mod legacy_liftoff_event;

#[cfg(feature = "legacy")]
pub mod legacy_touchdown_event;

/// Enum containing all the possible events that can be found in a [JournalFile].
///
/// > **Note** not all events might already be parsed or be parsed correctly. If you feel that
/// > an existing entry is not parsed correctly or if there is a missing entry, please open an issue
/// > on [GitHub](https://github.com/rster2002/ed-journals/issues/new).
#[derive(Debug, Serialize, Deserialize, Kinded, Clone, PartialEq)]
#[serde(tag = "event")]
#[cfg_attr(not(feature = "allow-unknown"), non_exhaustive)]
pub enum LogEventContent {
    // Startup
    Cargo(CargoEvent),
    ClearSavedGame(ClearSavedGameEvent),
    Commander(CommanderEvent),

    #[serde(rename = "Fileheader")]
    FileHeader(FileHeaderEvent),
    LoadGame(LoadGameEvent),
    Loadout(LoadoutEvent),
    Materials(MaterialsEvent),
    Missions(MissionsEvent),
    NewCommander(NewCommanderEvent),
    Passengers(PassengersEvent),
    Powerplay(PowerplayEvent),
    Progress(ProgressEvent),
    Rank(RankEvent),
    Reputation(ReputationEvent),
    Statistics(StatisticsEvent),

    // Travel
    ApproachBody(ApproachBodyEvent),
    Docked(DockedEvent),
    DockingCancelled(DockingCancelled),
    DockingDenied(DockingDeniedEvent),
    DockingGranted(DockingGrantedEvent),
    DockingRequested(DockingRequestedEvent),
    DockingTimeout(DockingTimeoutEvent),
    FSDJump(FSDJumpEvent),
    FSDTarget(FSDTargetEvent),
    LeaveBody(LeaveBodyEvent),
    Liftoff(LiftoffEvent),
    Location(LocationEvent),
    StartJump(StartJumpEvent),
    SupercruiseEntry(SupercruiseEntryEvent),
    SupercruiseExit(SupercruiseExitEvent),
    Touchdown(TouchdownEvent),
    Undocked(UndockedEvent),

    /// This event is fired when something changes in the `NavRoute.json` file and does not contain
    /// the route in the event.
    NavRoute,
    NavRouteClear,

    // Combat
    Bounty(BountyEvent),
    CapShipBond(CapShipBondEvent),
    Died(DiedEvent),
    EscapeInterdiction(EscapeInterdictionEvent),
    FactionKillBond(FactionKillBondEvent),
    FighterDestroyed(FighterDestroyedEvent),
    HeatDamage,
    HeatWarning,
    HullDamage(HullDamageEvent),
    Interdicted(InterdictedEvent),
    Interdiction(InterdictionEvent),
    PVPKill(PVPKillEvent),
    SRVDestroyed(SRVDestroyedEvent),
    ShieldState(ShieldStateEvent),
    ShipTargeted(ShipTargetedEvent),
    UnderAttack(UnderAttackEvent),

    // Exploration
    BuyExplorationData(BuyExplorationDataEvent),
    CodexEntry(CodexEntryEvent),
    DiscoveryScan(DiscoveryScanEvent),
    FSSAllBodiesFound(FSSAllBodiesFoundEvent),
    FSSBodySignals(FSSBodySignalsEvent),
    FSSDiscoveryScan(FSSDiscoveryScan),
    FSSSignalDiscovered(FSSSignalDiscoveredEvent),
    MaterialCollected(MaterialCollectedEvent),
    MaterialDiscarded(MaterialDiscarded),
    MaterialDiscovered(MaterialDiscoveredEvent),
    MultiSellExplorationData(MultiSellExplorationDataEvent),
    NavBeaconScan(NavBeaconScanEvent),
    SAAScanComplete(SAAScanCompleteEvent),
    SAASignalsFound(SAASignalsFoundEvent),
    Scan(ScanEvent),
    ScanBaryCentre(ScanBaryCentreEvent),
    SellExplorationData(SellExplorationDataEvent),
    Screenshot(ScreenshotEvent),

    // Trade
    AsteroidCracked(AsteroidCrackedEvent),
    BuyTradeData(BuyTradeDateEvent),
    CollectCargo(CollectCargoEvent),
    EjectCargo(EjectCargoEvent),
    MarketBuy(MarketBuyEvent),
    MarketSell(MarketSellEvent),
    MiningRefined(MiningRefinedEvent),

    // Station services
    BuyAmmo(BuyAmmoEvent),
    BuyDrones(BuyDronesEvent),
    CargoDepot(CargoDepotEvent),
    CommunityGoal(CommunityGoalEvent),
    CommunityGoalDiscard(CommunityGoalDiscardEvent),
    CommunityGoalJoin(CommunityGoalJoinEvent),
    CommunityGoalReward(CommunityGoalRewardEvent),
    CrewAssign(CrewAssignEvent),
    CrewFire(CrewFireEvent),
    CrewHire(CrewHireEvent),
    EngineerContribution(EngineerContributionEvent),
    EngineerCraft(EngineerCraftEvent),
    EngineerProgress(EngineerProgressEvent),
    FetchRemoteModule(FetchRemoteModuleEvent),
    Market(MarketEvent),
    MassModuleStore(MassModuleStoreEvent),
    MaterialTrade(MaterialTradeEvent),
    MissionAbandoned(MissionAbandonedEvent),
    MissionAccepted(MissionAcceptedEvent),
    MissionCompleted(MissionCompletedEvent),
    MissionFailed(MissionFailedEvent),
    MissionRedirected(MissionRedirectedEvent),
    ModuleBuy(ModuleBuyEvent),
    ModuleBuyAndStore(ModuleBuyAndStoreEvent),
    ModuleRetrieve(ModuleRetrieveEvent),
    ModuleSell(ModuleSellEvent),
    ModuleSellRemote(ModuleSellRemoteEvent),
    ModuleStore(ModuleStoreEvent),
    ModuleSwap(ModuleSwapEvent),
    Outfitting(OutfittingEvent),
    PayBounties(PayBountiesEvent),
    PayFines(PayFinesEvent),
    RedeemVoucher(RedeemVoucherEvent),
    RefuelAll(RefuelAllEvent),
    RefuelPartial(RefuelPartialEvent),
    Repair(RepairEvent),
    RepairAll(RepairAllEvent),
    RestockVehicle(RestockVehicleEvent),
    ScientificResearch(ScientificResearchEvent),
    SearchAndRescue(SearchAndRescueEvent),
    SellDrones(SellDronesEvent),
    SellShipOnRebuy(SellShipOnRebuyEvent),
    SetUserShipName(SetUserShipNameEvent),
    Shipyard(ShipyardEvent),
    ShipyardBuy(ShipyardBuyEvent),
    ShipyardNew(ShipyardNewEvent),
    ShipyardSell(ShipyardSellEvent),
    ShipyardSwap(ShipyardSwapEvent),
    ShipyardTransfer(ShipyardTransferEvent),
    ShipyardRedeem(ShipyardRedeem),
    ShipRedeemed(ShipRedeemed),
    StoredModules(StoredModulesEvent),
    StoredShips(StoredShipsEvent),
    TechnologyBroker(TechnologyBrokerEvent),
    ClearImpound(ClearImpoundEvent),

    // Powerplay
    PowerplayCollect(PowerplayCollectEvent),
    PowerplayDefect(PowerplayDefectEvent),
    PowerplayDeliver(PowerplayDeliverEvent),
    PowerplayFastTrack(PowerplayFastTrackEvent),
    PowerplayJoin(PowerplayJoinEvent),
    PowerplayLeave(PowerplayLeaveEvent),
    PowerplaySalary(PowerplaySalaryEvent),
    PowerplayVote(PowerplayVoteEvent),

    // Squadrons
    AppliedToSquadron(AppliedToSquadronEvent),
    DisbandedSquadron(DisbandedSquadronEvent),
    InvitedToSquadron(InvitedToSquadronEvent),
    JoinedSquadron(JoinedSquadronEvent),
    KickedFromSquadron(KickedFromSquadronEvent),
    LeftSquadron(LeftSquadronEvent),
    SharedBookmarkToSquadron(ShardedBookmarkToSquadronEvent),
    SquadronCreated(SquadronCreatedEvent),
    SquadronDemotion(SquadronDemotionEvent),
    SquadronPromotion(SquadronPromotionEvent),
    SquadronStartup(SquadronStartupEvent),
    WonATrophyForSquadron(WonATrophyForSquadronEvent),

    // Fleet carriers
    CarrierJump(CarrierJumpEvent),
    CarrierBuy(CarrierBuyEvent),
    CarrierStats(CarrierStatsEvent),
    CarrierJumpRequest(CarrierJumpRequestEvent),
    CarrierDecommission(CarrierDecommissionEvent),
    CarrierCancelDecommission(CarrierCancelDecommissionEvent),
    CarrierBankTransfer(CarrierBankTransferEvent),
    CarrierDepositFuel(CarrierDepositFuelEvent),
    CarrierCrewServices(CarrierCrewServicesEvent),
    CarrierFinance(CarrierFinanceEvent),
    CarrierShipPack(CarrierShipPackEvent),
    CarrierModulePack(CarrierModulePackEvent),
    CarrierTradeOrder(CarrierTradeOrderEvent),
    CarrierDockingPermission(CarrierDockingPermissionEvent),
    CarrierNameChange(CarrierNameChangeEvent),
    CarrierJumpCancelled(CarrierJumpCancelled),

    // Odyssey
    Backpack(BackpackEvent),
    BackpackChange(BackpackChangeEvent),
    BookDropship(BookDropshipEvent),
    BookTaxi(BookTaxiEvent),
    BuyMicroResources(BuyMicroResourceEvent),
    BuySuit(BuySuitEvent),
    BuyWeapon(BuyWeaponEvent),
    CancelDropship(CancelDropshipEvent),
    CancelTaxi(CancelTaxiEvent),
    CollectItems(CollectItemsEvent),
    CreateSuitLoadout(CreateSuitLoadoutEvent),
    DeleteSuitLoadout(DeleteSuitLoadoutEvent),
    Disembark(DisembarkEvent),
    DropItems(DropItemsEvent),
    DropshipDeploy(DropshipDeployEvent),
    Embark(EmbarkEvent),
    FCMaterials(FCEmbarkEvent),
    LoadoutEquipModule(LoadoutEquipModuleEvent),
    LoadoutRemoveModule(LoadoutRemoveModuleEvent),
    RenameSuitLoadout(RenameSuitLoadoutEvent),
    Resupply,
    ScanOrganic(ScanOrganicEvent),
    SellMicroResources(SellMicroResourcesEvent),
    SellOrganicData(SellOrganicDataEvent),
    SellSuit(SellSuitEvent),
    SellWeapon(SellWeaponEvent),
    ShipLocker(ShipLockerEvent),
    SwitchSuitLoadout(SwitchSuitLoadoutEvent),
    SuitLoadout(SuitLoadoutEvent),
    TransferMicroResources(TransferMicroResourcesEvent),
    TradeMicroResources(TradeMicroResourcesEvent),
    UpgradeSuit(UpgradeSuitEvent),
    UpgradeWeapon(UpgradeWeaponEvent),
    UseConsumable(UseConsumableEvent),

    // Other
    #[serde(rename = "AfmuRepairs")]
    AFMURepairs(AFMURepairsEvent),
    ApproachSettlement(ApproachSettlementEvent),
    CargoTransfer(CargoTransferEvent),
    ChangeCrewRole(ChangeCrewRoleEvent),
    CockpitBreached,
    CommitCrime(CommitCrimeEvent),
    Continued(ContinuedEvent),
    CrewLaunchFighter(CrewLaunchFighterEvent),
    CrewMemberJoins(CrewMemberJoinsEvent),
    CrewMemberQuits(CrewMemberQuitsEvent),
    CrewMemberRoleChange(CrewMemberRoleChangeEvent),
    CrimeVictim(CrimeVictimEvent),
    DataScanned(DataScannedEvent),
    DatalinkVoucher(DatalinkVoucherEvent),
    DatalinkScan(DatalinkScanEvent),
    DockFighter(DockFighterEvent),
    DockSRV(DockSRVEvent),
    EndCrewSession(EndCrewSessionEvent),
    FighterRebuilt(FighterRebuiltEvent),
    Friends(FriendsEvent),
    FuelScoop(FuelScoopEvent),
    JetConeBoost(JetConeBoostEvent),
    JetConeDamage(JetConeDamageEvent),
    JoinACrew(JoinACrewEvent),
    KickCrewMember(KickCrewMemberEvent),
    LaunchDrone(LaunchDroneEvent),
    LaunchFighter(LaunchFighterEvent),
    LaunchSRV(LaunchSRVEvent),

    /// This event is fired when something changes in the `ModulesInfo.json` file and does not
    /// contain any data itself.
    ModuleInfo,
    Music(MusicEvent),

    #[serde(rename = "NpcCrewPaidWage")]
    NPCCrewPaidWage(NPCCrewWagePaidEvent),

    #[serde(rename = "NpcCrewRank")]
    NPCCrewRank(NPCCrewRankEvent),
    Promotion(PromotionEvent),
    ProspectedAsteroid(ProspectedAsteroidEvent),
    QuitACrew(QuitACrewEvent),
    RebootRepair(RebootRepairEvent),
    ReceiveText(ReceiveTextEvent),
    RepairDrone(RepairDroneEvent),
    ReservoirReplenished(ReservoirReplenishedEvent),
    Resurrect(ResurrectEvent),
    Scanned(ScannedEvent),
    SelfDestruct,
    SendText(SendTextEvent),
    Shutdown,
    SupercruiseDestinationDrop(SupercruiseDestinationDropEvent),
    Synthesis(SynthesisEvent),
    SystemsShutdown,
    USSDrop(USSDropEvent),
    VehicleSwitch(VehicleSwitchEvent),
    WingAdd(WingAddEvent),
    WingInvite(WingInviteEvent),
    WingJoin(WingJoinEvent),
    WingLeave,

    // Legacy
    #[cfg(feature = "legacy")]
    #[serde(untagged)]
    LegacyLiftoffEvent(LegacyLiftoffEvent),

    #[cfg(feature = "legacy")]
    #[serde(untagged)]
    LegacyTouchdownEvent(LegacyTouchdownEvent),

    #[cfg(feature = "allow-unknown")]
    #[cfg_attr(docsrs, doc(cfg(feature = "allow-unknown")))]
    #[serde(untagged)]
    Unknown(Value),
}

impl LogEventContent {
    pub fn system_address(&self) -> Option<u64> {
        Some(match self {
            LogEventContent::Location(event) => event.location_info.system_address,
            LogEventContent::FSDJump(event) => event.system_info.system_address,
            LogEventContent::CarrierJump(event) => event.system_info.system_address,
            LogEventContent::ApproachSettlement(event) => event.system_address,
            LogEventContent::CarrierBuy(event) => event.system_address,
            LogEventContent::CarrierJumpRequest(event) => event.system_address,
            LogEventContent::CodexEntry(event) => event.system_address,
            LogEventContent::DiscoveryScan(event) => event.system_address,
            LogEventContent::Disembark(event) => event.system_address,
            LogEventContent::Docked(event) => event.system_address,
            LogEventContent::DropshipDeploy(event) => event.system_address,
            LogEventContent::Embark(event) => event.system_address,
            LogEventContent::FSSAllBodiesFound(event) => event.system_address,
            LogEventContent::FSSBodySignals(event) => event.system_address,
            LogEventContent::FSSDiscoveryScan(event) => event.system_address,
            LogEventContent::FSSSignalDiscovered(event) => event.system_address,
            LogEventContent::LeaveBody(event) => event.system_address,
            LogEventContent::Liftoff(event) => event.system_address,
            LogEventContent::NavBeaconScan(event) => event.system_address,
            LogEventContent::SAAScanComplete(event) => event.system_address,
            LogEventContent::SAASignalsFound(event) => event.system_address,
            LogEventContent::Scan(event) => event.system_address,
            LogEventContent::ScanBaryCentre(event) => event.system_address,
            LogEventContent::ScanOrganic(event) => event.system_address,
            LogEventContent::StartJump(event) => match event.jump {
                StartJumpType::Hyperspace { system_address, .. } => system_address,
                StartJumpType::Supercruise => return None,
            },
            LogEventContent::SupercruiseEntry(event) => event.system_address,
            LogEventContent::SupercruiseExit(event) => event.system_address,
            LogEventContent::Touchdown(event) => event.system_address,

            #[cfg(feature = "legacy")]
            LogEventContent::LegacyLiftoffEvent(event) => event.system_address?,

            #[cfg(feature = "legacy")]
            LogEventContent::LegacyTouchdownEvent(event) => event.system_address?,
            _ => return None,
        })
    }

    pub fn star_name(&self) -> Option<&str> {
        Some(match self {
            LogEventContent::Location(event) => &event.location_info.star_system,
            LogEventContent::FSDJump(event) => &event.system_info.star_system,
            LogEventContent::CarrierJump(event) => &event.system_info.star_system,
            LogEventContent::CarrierBuy(event) => &event.location,
            LogEventContent::CarrierJumpRequest(event) => &event.system_name,
            LogEventContent::CodexEntry(event) => &event.system,
            LogEventContent::Disembark(event) => &event.star_system,
            LogEventContent::Docked(event) => &event.star_system,
            LogEventContent::DropshipDeploy(event) => &event.star_system,
            LogEventContent::Embark(event) => &event.star_system,
            LogEventContent::FSSAllBodiesFound(event) => &event.system_name,
            LogEventContent::FSSDiscoveryScan(event) => &event.system_name,
            LogEventContent::LeaveBody(event) => &event.star_system,
            LogEventContent::Liftoff(event) => &event.star_system,
            LogEventContent::Scan(event) => &event.star_system,
            LogEventContent::ScanBaryCentre(event) => &event.star_system,
            LogEventContent::StartJump(event) => match &event.jump {
                StartJumpType::Hyperspace { star_system, .. } => star_system,
                StartJumpType::Supercruise => return None,
            },
            LogEventContent::SupercruiseEntry(event) => &event.star_system,
            LogEventContent::SupercruiseExit(event) => &event.star_system,
            LogEventContent::Touchdown(event) => &event.star_system,

            #[cfg(feature = "legacy")]
            LogEventContent::LegacyLiftoffEvent(event) => event.star_system.as_ref()?,

            #[cfg(feature = "legacy")]
            LogEventContent::LegacyTouchdownEvent(event) => event.star_system.as_ref()?,
            _ => return None,
        })
    }

    pub fn small_system_info(&self) -> Option<PartialSystemInfo> {
        let system_address = self.system_address()?;
        let star_name = self.star_name()?;

        Some(PartialSystemInfo {
            system_address,
            star_name: star_name.to_string(),
        })
    }

    pub fn body_id(&self) -> Option<u8> {
        Some(match self {
            LogEventContent::Location(event) => event.location_info.body_id,
            LogEventContent::FSDJump(event) => event.system_info.body_id,
            LogEventContent::CarrierJump(event) => event.system_info.body_id,
            LogEventContent::ApproachSettlement(event) => event.body_id,
            LogEventContent::CarrierJumpRequest(event) => event.body_id,
            LogEventContent::CodexEntry(event) => event.body_id?,
            LogEventContent::DropshipDeploy(event) => event.body_id,
            LogEventContent::FSSBodySignals(event) => event.body_id,
            LogEventContent::LeaveBody(event) => event.body_id,
            LogEventContent::SAAScanComplete(event) => event.body_id,
            LogEventContent::SAASignalsFound(event) => event.body_id,
            LogEventContent::ScanBaryCentre(event) => event.body_id,
            LogEventContent::Scan(event) => event.body_id,
            LogEventContent::Touchdown(event) => event.body_id,
            LogEventContent::ScanOrganic(event) => event.body,
            LogEventContent::Liftoff(event) => event.body_id,

            #[cfg(feature = "legacy")]
            LogEventContent::LegacyLiftoffEvent(event) => event.body_id?,

            #[cfg(feature = "legacy")]
            LogEventContent::LegacyTouchdownEvent(event) => event.body_id?,
            _ => return None,
        })
    }

    pub fn body_name(&self) -> Option<&str> {
        Some(match self {
            LogEventContent::Location(event) => &event.location_info.body,
            LogEventContent::FSDJump(event) => &event.system_info.body,
            LogEventContent::CarrierJump(event) => &event.system_info.body,
            LogEventContent::ApproachSettlement(event) => &event.body_name,
            LogEventContent::CarrierJumpRequest(event) => match &event.body {
                Some(name) => name,
                None => return None,
            },
            LogEventContent::DropshipDeploy(event) => &event.body,
            LogEventContent::FSSBodySignals(event) => &event.body_name,
            LogEventContent::LeaveBody(event) => &event.body,
            LogEventContent::SAAScanComplete(event) => &event.body_name,
            LogEventContent::Scan(event) => &event.body_name,
            LogEventContent::Touchdown(event) => &event.body,
            LogEventContent::Liftoff(event) => &event.body,

            #[cfg(feature = "legacy")]
            LogEventContent::LegacyLiftoffEvent(event) => event.body.as_ref()?,

            #[cfg(feature = "legacy")]
            LogEventContent::LegacyTouchdownEvent(event) => event.body.as_ref()?,
            _ => return None,
        })
    }
}