Skip to content

Commit bd1024e

Browse files
committed
Make some internal types private
1 parent d6de29e commit bd1024e

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/animator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub mod cache;
1+
pub(crate) mod cache;
22
mod iterator;
33

44
use std::{collections::HashMap, time::Duration};
@@ -45,7 +45,7 @@ struct AnimationInstance {
4545
/// The animator is responsible for playing animations as time advances.
4646
#[derive(Resource, Debug, Default, Reflect)]
4747
#[reflect(Resource, Debug, Default)]
48-
pub struct Animator {
48+
pub(crate) struct Animator {
4949
/// Instances of animations currently being played.
5050
/// Each animation instance is associated to an entity with a [SpritesheetAnimation] component.
5151
animation_instances: HashMap<Entity, AnimationInstance>,
@@ -54,7 +54,7 @@ pub struct Animator {
5454
/// A query data type for the [`Animator::update`] system.
5555
#[derive(QueryData)]
5656
#[query_data(mutable, derive(Debug))]
57-
pub struct SpritesheetAnimationQuery {
57+
pub(crate) struct SpritesheetAnimationQuery {
5858
entity: Entity,
5959
spritesheet_animation: &'static mut SpritesheetAnimation,
6060
sprite: Option<&'static mut Sprite>,

src/animator/cache.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
/// A pre-computed frame of animation, ready to be played back.
1515
#[derive(Debug, Clone, Reflect)]
1616
#[reflect(Debug)]
17-
pub struct CacheFrame {
17+
pub(crate) struct CacheFrame {
1818
pub atlas_index: usize,
1919
pub duration: Duration,
2020
pub clip_id: ClipId,
@@ -32,7 +32,7 @@ pub struct CacheFrame {
3232
/// - AnimationEnd after the last frame
3333
#[derive(Debug, Clone, PartialEq, Eq, Hash, Reflect)]
3434
#[reflect(Debug, PartialEq, Hash)]
35-
pub enum AnimationCacheEvent {
35+
pub(crate) enum AnimationCacheEvent {
3636
MarkerHit {
3737
marker_id: AnimationMarkerId,
3838
clip_id: ClipId,
@@ -54,7 +54,7 @@ pub enum AnimationCacheEvent {
5454
/// The idea is to cache for each frame its atlas index, duration and emitted events
5555
/// so that playing an animation becomes just a matter of iterating over this cache
5656
/// without re-evaluating all the animation parameters.
57-
pub struct AnimationCache {
57+
pub(crate) struct AnimationCache {
5858
/// All the frames
5959
pub frames: Vec<CacheFrame>,
6060

src/animator/iterator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::{
1414
/// Same as [CacheFrame] but with `animation_repetition`
1515
#[derive(Debug, Clone, Reflect)]
1616
#[reflect(Debug)]
17-
pub struct IteratorFrame {
17+
pub(crate) struct IteratorFrame {
1818
pub atlas_index: usize,
1919
pub duration: Duration,
2020
pub clip_id: ClipId,
@@ -28,7 +28,7 @@ pub struct IteratorFrame {
2828
/// The animation will promote them to regular AnimationEvents and add the information available at its level.
2929
#[derive(Debug, Clone, PartialEq, Eq, Hash, Reflect)]
3030
#[reflect(Debug, PartialEq, Hash)]
31-
pub enum AnimationIteratorEvent {
31+
pub(crate) enum AnimationIteratorEvent {
3232
MarkerHit {
3333
marker_id: AnimationMarkerId,
3434
animation_repetition: usize,
@@ -52,7 +52,7 @@ pub enum AnimationIteratorEvent {
5252
/// An iterator that advances an animation frame by frame.
5353
///
5454
/// `next()` will produce frames until the end of the animation.
55-
pub struct AnimationIterator {
55+
pub(crate) struct AnimationIterator {
5656
/// Reference to the animation cache that contains all the frames for one repetition of the animation
5757
cache: Arc<AnimationCache>,
5858

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
//! ```
7575
7676
pub mod animation;
77-
pub mod animator;
7877
pub mod clip;
7978
pub mod components;
8079
pub mod easing;
@@ -83,6 +82,7 @@ pub mod library;
8382
pub mod plugin;
8483
pub mod spritesheet;
8584

85+
mod animator;
8686
mod systems;
8787

8888
pub mod prelude {

src/plugin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ use crate::{
1212
systems::{sprite3d, spritesheet_animation},
1313
};
1414

15-
/// Set for systems that update the animation state.
15+
/// Set for systems that update animations
1616
#[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)]
1717
pub struct AnimationSystemSet;
1818

19-
/// Set for systems that update the sprite state.
19+
/// Set for systems that manage 3D sprites
2020
#[derive(Debug, PartialEq, Eq, Clone, Hash, SystemSet)]
2121
pub struct Sprite3dSystemSet;
2222

0 commit comments

Comments
 (0)