Skip to content

Commit

Permalink
Reduce visibility of various types and fields (#2690)
Browse files Browse the repository at this point in the history
See the individual commits.
  • Loading branch information
bjorn3 committed Aug 19, 2021
1 parent 9788b38 commit d84c7f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/archetype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ struct TableInfo {
}

pub(crate) struct ArchetypeSwapRemoveResult {
pub swapped_entity: Option<Entity>,
pub table_row: usize,
pub(crate) swapped_entity: Option<Entity>,
pub(crate) table_row: usize,
}

pub(crate) struct ArchetypeComponentInfo {
Expand Down
22 changes: 11 additions & 11 deletions crates/bevy_ecs/src/schedule/run_criteria.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ impl Default for BoxedRunCriteria {
}

impl BoxedRunCriteria {
pub fn set(&mut self, criteria_system: BoxedSystem<(), ShouldRun>) {
pub(crate) fn set(&mut self, criteria_system: BoxedSystem<(), ShouldRun>) {
self.criteria_system = Some(criteria_system);
self.initialized = false;
}

pub fn should_run(&mut self, world: &mut World) -> ShouldRun {
pub(crate) fn should_run(&mut self, world: &mut World) -> ShouldRun {
if let Some(ref mut run_criteria) = self.criteria_system {
if !self.initialized {
run_criteria.initialize(world);
Expand Down Expand Up @@ -99,16 +99,16 @@ pub(crate) enum RunCriteriaInner {
}

pub(crate) struct RunCriteriaContainer {
pub should_run: ShouldRun,
pub inner: RunCriteriaInner,
pub label: Option<BoxedRunCriteriaLabel>,
pub before: Vec<BoxedRunCriteriaLabel>,
pub after: Vec<BoxedRunCriteriaLabel>,
pub(crate) should_run: ShouldRun,
pub(crate) inner: RunCriteriaInner,
pub(crate) label: Option<BoxedRunCriteriaLabel>,
pub(crate) before: Vec<BoxedRunCriteriaLabel>,
pub(crate) after: Vec<BoxedRunCriteriaLabel>,
archetype_generation: ArchetypeGeneration,
}

impl RunCriteriaContainer {
pub fn from_descriptor(descriptor: RunCriteriaDescriptor) -> Self {
pub(crate) fn from_descriptor(descriptor: RunCriteriaDescriptor) -> Self {
Self {
should_run: ShouldRun::Yes,
inner: match descriptor.system {
Expand All @@ -122,21 +122,21 @@ impl RunCriteriaContainer {
}
}

pub fn name(&self) -> Cow<'static, str> {
pub(crate) fn name(&self) -> Cow<'static, str> {
match &self.inner {
RunCriteriaInner::Single(system) => system.name(),
RunCriteriaInner::Piped { system, .. } => system.name(),
}
}

pub fn initialize(&mut self, world: &mut World) {
pub(crate) fn initialize(&mut self, world: &mut World) {
match &mut self.inner {
RunCriteriaInner::Single(system) => system.initialize(world),
RunCriteriaInner::Piped { system, .. } => system.initialize(world),
}
}

pub fn update_archetypes(&mut self, world: &World) {
pub(crate) fn update_archetypes(&mut self, world: &World) {
let archetypes = world.archetypes();
let new_generation = archetypes.generation();
let old_generation = std::mem::replace(&mut self.archetype_generation, new_generation);
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_ecs/src/schedule/system_container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub(super) struct ExclusiveSystemContainer {
}

impl ExclusiveSystemContainer {
pub fn from_descriptor(descriptor: ExclusiveSystemDescriptor) -> Self {
pub(super) fn from_descriptor(descriptor: ExclusiveSystemDescriptor) -> Self {
ExclusiveSystemContainer {
system: descriptor.system,
run_criteria_index: None,
Expand All @@ -49,7 +49,7 @@ impl ExclusiveSystemContainer {
}
}

pub fn system_mut(&mut self) -> &mut Box<dyn ExclusiveSystem> {
pub(super) fn system_mut(&mut self) -> &mut Box<dyn ExclusiveSystem> {
&mut self.system
}
}
Expand Down

0 comments on commit d84c7f9

Please sign in to comment.