From fa719d46b9fd1f08077bdbb4d87aa68502f74113 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 20 Jan 2024 15:18:12 -0800 Subject: [PATCH] Minor rename --- crates/content/src/lib.rs | 4 ++-- .../src/{animautomaton.rs => spriteautomaton.rs} | 4 ++-- crates/system/src/phys/objects/projectile.rs | 6 +++--- crates/system/src/phys/objects/ship.rs | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) rename crates/content/src/{animautomaton.rs => spriteautomaton.rs} (99%) diff --git a/crates/content/src/lib.rs b/crates/content/src/lib.rs index f08e416..96de355 100644 --- a/crates/content/src/lib.rs +++ b/crates/content/src/lib.rs @@ -3,9 +3,9 @@ //! This subcrate is responsible for loading, parsing, validating game content, //! which is usually stored in `./content`. -mod animautomaton; mod handle; mod part; +mod spriteautomaton; mod util; use anyhow::{bail, Context, Result}; @@ -20,9 +20,9 @@ use std::{ use toml; use walkdir::WalkDir; -pub use animautomaton::*; pub use handle::*; pub use part::*; +pub use spriteautomaton::*; mod syntax { use anyhow::{bail, Context, Result}; diff --git a/crates/content/src/animautomaton.rs b/crates/content/src/spriteautomaton.rs similarity index 99% rename from crates/content/src/animautomaton.rs rename to crates/content/src/spriteautomaton.rs index 23b2947..72f6f86 100644 --- a/crates/content/src/animautomaton.rs +++ b/crates/content/src/spriteautomaton.rs @@ -41,7 +41,7 @@ enum AnimDirection { /// Manages a single sprite's animation state. #[derive(Debug, Clone)] -pub struct AnimAutomaton { +pub struct SpriteAutomaton { /// The sprite we're animating sprite: SpriteHandle, @@ -71,7 +71,7 @@ pub struct AnimAutomaton { next_edge_override: Option, } -impl AnimAutomaton { +impl SpriteAutomaton { /// Create a new AnimAutomaton pub fn new(ct: &Content, sprite_handle: SpriteHandle) -> Self { let sprite = ct.get_sprite(sprite_handle); diff --git a/crates/system/src/phys/objects/projectile.rs b/crates/system/src/phys/objects/projectile.rs index 2f4810f..2d1100e 100644 --- a/crates/system/src/phys/objects/projectile.rs +++ b/crates/system/src/phys/objects/projectile.rs @@ -1,4 +1,4 @@ -use galactica_content::{AnimAutomaton, AnimationState, Content, FactionHandle, Projectile}; +use galactica_content::{AnimationState, Content, FactionHandle, Projectile, SpriteAutomaton}; use rand::Rng; use rapier2d::{dynamics::RigidBodyHandle, geometry::ColliderHandle}; @@ -9,7 +9,7 @@ pub struct PhysProjectile { pub content: Projectile, /// This projectile's sprite animation state - anim: AnimAutomaton, + anim: SpriteAutomaton, /// The remaining lifetime of this projectile, in seconds pub lifetime: f32, @@ -40,7 +40,7 @@ impl PhysProjectile { let size_rng = content.size_rng; let lifetime = content.lifetime; PhysProjectile { - anim: AnimAutomaton::new(ct, content.sprite), + anim: SpriteAutomaton::new(ct, content.sprite), rigid_body, collider, content, diff --git a/crates/system/src/phys/objects/ship.rs b/crates/system/src/phys/objects/ship.rs index 886754e..1d0bd56 100644 --- a/crates/system/src/phys/objects/ship.rs +++ b/crates/system/src/phys/objects/ship.rs @@ -1,5 +1,5 @@ use galactica_content::{ - AnimAutomaton, AnimationState, Content, EnginePoint, FactionHandle, OutfitHandle, ShipHandle, + AnimationState, Content, EnginePoint, FactionHandle, OutfitHandle, ShipHandle, SpriteAutomaton, }; use nalgebra::{point, vector, Rotation2, Vector2}; use rand::Rng; @@ -56,10 +56,10 @@ pub struct PhysSimShip { pub(crate) data: ShipData, /// This ship's sprite animation state - anim: AnimAutomaton, + anim: SpriteAutomaton, /// Animation state for each of this ship's engines - engine_anim: Vec<(EnginePoint, AnimAutomaton)>, + engine_anim: Vec<(EnginePoint, SpriteAutomaton)>, /// This ship's controls pub(crate) controls: ShipControls, @@ -83,7 +83,7 @@ impl PhysSimShip { ) -> Self { let ship_ct = ct.get_ship(handle); PhysSimShip { - anim: AnimAutomaton::new(ct, ship_ct.sprite), + anim: SpriteAutomaton::new(ct, ship_ct.sprite), rigid_body, collider, data: ShipData::new(ct, handle, faction, personality), @@ -273,7 +273,7 @@ impl PhysSimShip { .get_ship(self.data.get_content()) .engines .iter() - .map(|e| (e.clone(), AnimAutomaton::new(ct, flare))) + .map(|e| (e.clone(), SpriteAutomaton::new(ct, flare))) .collect(); } @@ -300,7 +300,7 @@ impl PhysSimShip { } /// Get this ship's engine animations - pub fn iter_engine_anim(&self) -> impl Iterator { + pub fn iter_engine_anim(&self) -> impl Iterator { self.engine_anim.iter() }