Minor rename
parent
57f2b97f40
commit
fa719d46b9
|
@ -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};
|
||||
|
|
|
@ -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<SectionEdge>,
|
||||
}
|
||||
|
||||
impl AnimAutomaton {
|
||||
impl SpriteAutomaton {
|
||||
/// Create a new AnimAutomaton
|
||||
pub fn new(ct: &Content, sprite_handle: SpriteHandle) -> Self {
|
||||
let sprite = ct.get_sprite(sprite_handle);
|
|
@ -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,
|
||||
|
|
|
@ -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<Item = &(EnginePoint, AnimAutomaton)> {
|
||||
pub fn iter_engine_anim(&self) -> impl Iterator<Item = &(EnginePoint, SpriteAutomaton)> {
|
||||
self.engine_anim.iter()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue