Skip to content

Commit

Permalink
🔀 Merge pull request #86 from rster2002/rename-to-partials
Browse files Browse the repository at this point in the history
Rename small module to partials
  • Loading branch information
rster2002 committed Aug 7, 2024
2 parents a4eb7b5 + 5564049 commit 8898538
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub use modules::outfitting;
pub use modules::ship;
pub use modules::ship_locker;
pub use modules::shipyard;
pub use modules::small;
pub use modules::partials;
pub use modules::state;
pub use modules::station;
pub use modules::status;
Expand Down
4 changes: 2 additions & 2 deletions src/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ pub mod station;
/// player can encounter.
pub mod thargoid;

/// This module contains 'small' models that are used to create representations for certain things
/// This module contains partial models that are used to create representations for certain things
/// without needing to include all the information as it can differ quite a bit between the
/// different events of the game.
pub mod small;
pub mod partials;

/// Sometimes the game reuses certain events and instead of 'ship' data it sets Odyssey related
/// data. These mixed data types handle these differences.
Expand Down
18 changes: 9 additions & 9 deletions src/modules/logs/content/log_event_content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ use crate::logs::content::log_event_content::community_goal_event::CommunityGoal
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::small::SmallSystemInfo;
use crate::modules::partials::PartialSystemInfo;

pub mod afmu_repairs_event;
pub mod applied_to_squadron_event;
Expand Down Expand Up @@ -860,14 +860,14 @@ impl LogEventContent {
})
}

pub fn small_system_info(&self) -> Option<SmallSystemInfo> {
match (self.system_address(), self.star_name()) {
(Some(system_address), Some(star_name)) => Some(SmallSystemInfo {
system_address,
star_name: star_name.to_string(),
}),
(_, _) => 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> {
Expand Down
3 changes: 3 additions & 0 deletions src/modules/partials/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub use models::small_system_info::PartialSystemInfo;

mod models;
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use serde::Serialize;

#[derive(Debug, Serialize)]
pub struct SmallSystemInfo {
pub struct PartialSystemInfo {
pub system_address: u64,
pub star_name: String,
}
3 changes: 0 additions & 3 deletions src/modules/small/mod.rs

This file was deleted.

4 changes: 2 additions & 2 deletions src/modules/state/models/carrier_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use serde::Serialize;
use crate::logs::carrier_stats_event::CarrierStatsEvent;
use crate::logs::{LogEvent, LogEventContent};
use crate::logs::carrier_jump_request_event::CarrierJumpRequestEvent;
use crate::small::SmallSystemInfo;
use crate::partials::PartialSystemInfo;
use crate::state::models::feed_result::FeedResult;

#[derive(Serialize)]
pub struct CarrierState {
pub stats: CarrierStatsEvent,
pub flight_history: Vec<SmallSystemInfo>,
pub flight_history: Vec<PartialSystemInfo>,
pub last_location_update: DateTime<Utc>,
pub scheduled_jump: Option<CarrierJumpRequestEvent>,
pub scrap_time: Option<DateTime<Utc>>,
Expand Down

0 comments on commit 8898538

Please sign in to comment.