Reduce visibility of various types and fields (#2690)

See the individual commits.
This commit is contained in:
bjorn3 2021-08-19 20:02:25 +00:00
parent 9788b386c7
commit d84c7f9066
3 changed files with 15 additions and 15 deletions

View File

@ -110,8 +110,8 @@ struct TableInfo {
} }
pub(crate) struct ArchetypeSwapRemoveResult { pub(crate) struct ArchetypeSwapRemoveResult {
pub swapped_entity: Option<Entity>, pub(crate) swapped_entity: Option<Entity>,
pub table_row: usize, pub(crate) table_row: usize,
} }
pub(crate) struct ArchetypeComponentInfo { pub(crate) struct ArchetypeComponentInfo {

View File

@ -61,12 +61,12 @@ impl Default for BoxedRunCriteria {
} }
impl 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.criteria_system = Some(criteria_system);
self.initialized = false; 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 let Some(ref mut run_criteria) = self.criteria_system {
if !self.initialized { if !self.initialized {
run_criteria.initialize(world); run_criteria.initialize(world);
@ -99,16 +99,16 @@ pub(crate) enum RunCriteriaInner {
} }
pub(crate) struct RunCriteriaContainer { pub(crate) struct RunCriteriaContainer {
pub should_run: ShouldRun, pub(crate) should_run: ShouldRun,
pub inner: RunCriteriaInner, pub(crate) inner: RunCriteriaInner,
pub label: Option<BoxedRunCriteriaLabel>, pub(crate) label: Option<BoxedRunCriteriaLabel>,
pub before: Vec<BoxedRunCriteriaLabel>, pub(crate) before: Vec<BoxedRunCriteriaLabel>,
pub after: Vec<BoxedRunCriteriaLabel>, pub(crate) after: Vec<BoxedRunCriteriaLabel>,
archetype_generation: ArchetypeGeneration, archetype_generation: ArchetypeGeneration,
} }
impl RunCriteriaContainer { impl RunCriteriaContainer {
pub fn from_descriptor(descriptor: RunCriteriaDescriptor) -> Self { pub(crate) fn from_descriptor(descriptor: RunCriteriaDescriptor) -> Self {
Self { Self {
should_run: ShouldRun::Yes, should_run: ShouldRun::Yes,
inner: match descriptor.system { inner: match descriptor.system {
@ -122,21 +122,21 @@ impl RunCriteriaContainer {
} }
} }
pub fn name(&self) -> Cow<'static, str> { pub(crate) fn name(&self) -> Cow<'static, str> {
match &self.inner { match &self.inner {
RunCriteriaInner::Single(system) => system.name(), RunCriteriaInner::Single(system) => system.name(),
RunCriteriaInner::Piped { 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 { match &mut self.inner {
RunCriteriaInner::Single(system) => system.initialize(world), RunCriteriaInner::Single(system) => system.initialize(world),
RunCriteriaInner::Piped { 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 archetypes = world.archetypes();
let new_generation = archetypes.generation(); let new_generation = archetypes.generation();
let old_generation = std::mem::replace(&mut self.archetype_generation, new_generation); let old_generation = std::mem::replace(&mut self.archetype_generation, new_generation);

View File

@ -36,7 +36,7 @@ pub(super) struct ExclusiveSystemContainer {
} }
impl ExclusiveSystemContainer { impl ExclusiveSystemContainer {
pub fn from_descriptor(descriptor: ExclusiveSystemDescriptor) -> Self { pub(super) fn from_descriptor(descriptor: ExclusiveSystemDescriptor) -> Self {
ExclusiveSystemContainer { ExclusiveSystemContainer {
system: descriptor.system, system: descriptor.system,
run_criteria_index: None, run_criteria_index: None,
@ -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 &mut self.system
} }
} }