Skip to content

Commit

Permalink
limit visibility of exports from modules
Browse files Browse the repository at this point in the history
  • Loading branch information
cdsupina committed Oct 5, 2024
1 parent 1aad702 commit 462b642
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/loot/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! Exposes resources with methods to compute loot drops from killed mobs.
use bevy::prelude::{App, EventWriter, Plugin, Resource, Vec2};
use consumable::ConsumableLootDrop;
use ron::de::from_bytes;
use serde::Deserialize;
use std::collections::HashMap;
Expand All @@ -9,7 +10,7 @@ mod consumable;

use crate::spawnable::SpawnConsumableEvent;

pub use self::consumable::*;
pub(crate) use self::consumable::DropListType;

pub(super) struct LootPlugin;

Expand Down
7 changes: 5 additions & 2 deletions src/spawnable/behavior_sequence.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use super::{
mob::BehaviorSequenceTracker, mob::MobBehavior, mob::MobComponent, mob::MobSegmentComponent,
mob::MobSegmentControlBehavior, SpawnableBehavior, SpawnableComponent,
mob::{
BehaviorSequenceTracker, MobBehavior, MobComponent, MobSegmentComponent,
MobSegmentControlBehavior,
},
SpawnableBehavior, SpawnableComponent,
};
use bevy::{
prelude::{Entity, Event, EventReader, EventWriter, Query, Res, Resource},
Expand Down
2 changes: 1 addition & 1 deletion src/spawnable/consumable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{

mod behavior;

pub use self::behavior::{consumable_execute_behavior_system, ConsumableBehavior};
pub(crate) use self::behavior::{consumable_execute_behavior_system, ConsumableBehavior};

use thetawave_interface::spawnable::AttractToClosestPlayerComponent;

Expand Down
8 changes: 5 additions & 3 deletions src/spawnable/mob/mob_segment/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ use crate::{
};

mod behavior;
pub use self::behavior::*;

use super::{
ColliderData, CompoundColliderData, JointType, MobSegmentAnchorPointData, MobSpawner,
MobSpawnerData,
};
pub(in crate::spawnable) use behavior::{
mob_segment_apply_disconnected_behaviors_system, mob_segment_execute_behavior_system,
MobSegmentBehavior,
};

#[derive(Resource, Deserialize)]
pub struct MobSegmentsResource {
Expand Down Expand Up @@ -79,7 +81,7 @@ impl From<&MobSegmentData> for MobSegmentComponent {
MobSegmentComponent {
mob_segment_type: mob_segment_data.mob_segment_type.clone(),
collision_damage: mob_segment_data.collision_damage,
collision_sound: mob_segment_data.collision_sound.clone(),
collision_sound: mob_segment_data.collision_sound,
defense_interaction: mob_segment_data.defense_interaction.clone(),
consumable_drops: mob_segment_data.consumable_drops.clone(),
behaviors: mob_segment_data.behaviors.clone(),
Expand Down
10 changes: 9 additions & 1 deletion src/spawnable/mob/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use bevy_rapier2d::{
LockedAxes, Restitution, RevoluteJointBuilder, RigidBody, Velocity,
},
};
use mob_segment::{spawn_mob_segment, MobSegmentBehavior};
use serde::Deserialize;
use std::collections::{hash_map::Entry, HashMap};

Expand All @@ -30,7 +31,14 @@ use crate::{

mod behavior;
mod mob_segment;
pub use self::{behavior::*, mob_segment::*};
pub(crate) use self::mob_segment::MobSegmentComponent;
pub(in crate::spawnable) use self::{
behavior::{mob_execute_behavior_system, MobBehavior, MobSegmentControlBehavior},
mob_segment::{
mob_segment_apply_disconnected_behaviors_system, mob_segment_execute_behavior_system,
MobSegmentsResource,
},
};

use super::{behavior_sequence::MobBehaviorSequenceType, InitialMotion};
use crate::collision::{
Expand Down
14 changes: 8 additions & 6 deletions src/spawnable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ use self::{
};

// TODO: move to interface, or change to use events for sending information between modules
pub use self::behavior::SpawnableBehavior;
pub use self::behavior_sequence::{BehaviorSequenceResource, MobBehaviorUpdateEvent};
pub use self::consumable::{
pub(crate) use self::behavior::SpawnableBehavior;
pub(crate) use self::behavior_sequence::{BehaviorSequenceResource, MobBehaviorUpdateEvent};
pub(crate) use self::consumable::{
ConsumableComponent, ConsumableData, ConsumableResource, SpawnConsumableEvent,
};
pub use self::effect::{EffectsResource, SpawnEffectEvent};
pub use self::mob::{BossComponent, BossesDestroyedEvent, MobComponent, MobSegmentComponent};
pub use self::projectile::{
pub(crate) use self::effect::{EffectsResource, SpawnEffectEvent};
pub(crate) use self::mob::{
BossComponent, BossesDestroyedEvent, MobComponent, MobSegmentComponent,
};
pub(crate) use self::projectile::{
FireWeaponEvent, ProjectileComponent, ProjectileData, ProjectileResource,
};

Expand Down
4 changes: 3 additions & 1 deletion src/spawnable/projectile/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ use crate::{

mod behavior;

pub use self::behavior::{projectile_execute_behavior_system, ProjectileBehavior};
pub(in crate::spawnable) use self::behavior::{
projectile_execute_behavior_system, ProjectileBehavior,
};

use super::{mob::ColliderData, InitialMotion};

Expand Down

0 comments on commit 462b642

Please sign in to comment.