pub enum ProgramFrame {
Source(SourceFrame),
NotConverted {
why: String,
},
}Expand description
core.program_frame: the coordinate frame the source’s game programs compute in, stated by the reader that keeps
them. The world is in core’s frame (crate::frame); a source’s programs compute in the frame their game’s data is
in, which its reader converted the world out of. A consumer that runs them on the world converts every value they
read into their frame by its kind (SpatialKind) and reads what they write in it, so the programs compute as they
do in the game. There is no default: a reader states one form or the other, an identity included
(Source(SourceFrame::WORLD) for programs that compute in core’s frame).
Variants§
Source(SourceFrame)
The programs compute in this frame: world = frame(program), as the reader converted the source’s data.
NotConverted
The frame the programs compute in is not established for this source, or a consumer’s conversion into it is
not checked: a consumer feeds them world values unconverted and shows why with every view of them. why names
the world, what is known of its frame and on what evidence, and what is missing.
Implementations§
Source§impl ProgramFrame
impl ProgramFrame
Sourcepub fn frame(&self) -> Option<&SourceFrame>
pub fn frame(&self) -> Option<&SourceFrame>
The frame values are converted into, where one is stated.
Sourcepub fn state(self, world: &mut World) -> Result<(), String>
pub fn state(self, world: &mut World) -> Result<(), String>
State this as the world’s program frame, from a reader or pass that keeps the source’s programs: inserted where the world has none, kept where it has the same, refused where it has another (two producers of one world’s programs disagreeing on the frame they compute in).
Trait Implementations§
Source§impl Clone for ProgramFrame
impl Clone for ProgramFrame
Source§impl Debug for ProgramFrame
impl Debug for ProgramFrame
Source§impl PartialEq for ProgramFrame
impl PartialEq for ProgramFrame
Source§impl Resource for ProgramFrame
impl Resource for ProgramFrame
const NAME: &'static str = "core.program_frame"
const VERSION: u32 = 1
Source§fn references(&self, _out: &mut Vec<Entity>)
fn references(&self, _out: &mut Vec<Entity>)
out. A resource holding entity references must declare
every one of them and implement Resource::retain_references.Source§fn retain_references(&mut self, _keep: &dyn Fn(Entity) -> bool)
fn retain_references(&mut self, _keep: &dyn Fn(Entity) -> bool)
keep refuses (set it to “none”). The world calls it whenever entities
leave it (World::despawn, World::retain, World::move_components) and on the copy a
World::subset or World::split_off part gets, so a resource never refers to an entity its world lacks.