Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Reduce visibility of various types and fields #2690

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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