mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
Reduce visibility of various types and fields (#2690)
See the individual commits.
This commit is contained in:
parent
9788b386c7
commit
d84c7f9066
3 changed files with 15 additions and 15 deletions
|
@ -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 {
|
||||
|
|
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue