pub trait RenderData {
type Move: Copy + Eq + Debug;
type Item: Copy + Eq + Debug;
type Species: Copy + Eq + Debug;
// Required methods
fn move_name(&self, m: Self::Move) -> &str;
fn move_pp(&self, m: Self::Move) -> (u8, u8);
fn move_type(&self, m: Self::Move) -> u8;
fn item_name(&self, i: Self::Item) -> &str;
fn species_name(&self, s: Self::Species) -> &str;
}Expand description
Provides render-time string and metadata lookups for game entities.
This trait abstracts the display layer so that the UI and renderer can query move names, item names, species names, and move metadata without depending on concrete data types. This enables the engine to remain generic across different RPG games.
Required Associated Types§
Required Methods§
Sourcefn move_pp(&self, m: Self::Move) -> (u8, u8)
fn move_pp(&self, m: Self::Move) -> (u8, u8)
Returns the PP (power points) for a move as (current_max, base_max).
Some moves have PP that can be boosted beyond their base value (e.g., via PP Up items), so both values are returned.
Sourcefn species_name(&self, s: Self::Species) -> &str
fn species_name(&self, s: Self::Species) -> &str
Returns the display name of a species.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".