Mercurial > touhou
comparison interpreters/src/th06/enemy.rs @ 787:7f9b3f5001c2
interpreters: Make Interpolator generic over N
This was a workaround for Rust < 1.51 which didn’t support const generics yet,
but we’ve had tat for close to five years now!
| author | Link Mauve <linkmauve@linkmauve.fr> |
|---|---|
| date | Mon, 15 Dec 2025 11:34:58 +0100 |
| parents | 21b186be2590 |
| children |
comparison
equal
deleted
inserted
replaced
| 786:7e940ebeb5fd | 787:7f9b3f5001c2 |
|---|---|
| 1 //! Module providing an Enemy struct, to be changed by EclRunner. | 1 //! Module providing an Enemy struct, to be changed by EclRunner. |
| 2 | 2 |
| 3 use touhou_formats::th06::anm0::Anm0; | 3 use touhou_formats::th06::anm0::Anm0; |
| 4 use touhou_formats::th06::ecl::Rank; | 4 use touhou_formats::th06::ecl::Rank; |
| 5 use crate::th06::anm0::{Sprite, AnmRunner}; | 5 use crate::th06::anm0::{Sprite, AnmRunner}; |
| 6 use crate::th06::interpolator::{Interpolator1, Interpolator2}; | 6 use crate::th06::interpolator::Interpolator; |
| 7 use touhou_utils::prng::Prng; | 7 use touhou_utils::prng::Prng; |
| 8 use std::cell::RefCell; | 8 use std::cell::RefCell; |
| 9 use std::collections::HashMap; | 9 use std::collections::HashMap; |
| 10 use std::rc::{Rc, Weak}; | 10 use std::rc::{Rc, Weak}; |
| 11 | 11 |
| 302 // Options. | 302 // Options. |
| 303 // TODO: actually a 8 element array. | 303 // TODO: actually a 8 element array. |
| 304 options: Vec<Element>, | 304 options: Vec<Element>, |
| 305 | 305 |
| 306 // Interpolators. | 306 // Interpolators. |
| 307 pub(crate) interpolator: Option<Interpolator2<f32>>, | 307 pub(crate) interpolator: Option<Interpolator<f32, 2>>, |
| 308 pub(crate) speed_interpolator: Option<Interpolator1<f32>>, | 308 pub(crate) speed_interpolator: Option<Interpolator<f32, 1>>, |
| 309 | 309 |
| 310 // Misc stuff, do we need them? | 310 // Misc stuff, do we need them? |
| 311 pub(crate) anm0: Weak<RefCell<[Anm0; 2]>>, | 311 pub(crate) anm0: Weak<RefCell<[Anm0; 2]>>, |
| 312 process: Rc<RefCell<Process>>, | 312 process: Rc<RefCell<Process>>, |
| 313 pub(crate) game: Weak<RefCell<Game>>, | 313 pub(crate) game: Weak<RefCell<Game>>, |
