[][src]Struct keeshond::scene::Scene

pub struct Scene<T: SceneType + 'static> { /* fields omitted */ }

A world in which Entities, Components, and ThinkerSystems/DrawerSystems reside.

Implementations

impl<T: SceneType + 'static> Scene<T>[src]

pub fn new() -> Self[src]

Creates a new Scene

pub fn component_control(&self) -> &ComponentControl[src]

Returns a reference to the control used to access ComponentStores. You normally don't need to call this yourself.

pub fn component_control_mut(&mut self) -> &mut ComponentControl[src]

Returns a mutable reference to the control used to access ComponentStores. You normally don't need to call this yourself.

pub fn register_component_type<C: Component + 'static>(&mut self) -> bool[src]

pub fn add_component<C: Component + 'static>(
    &mut self,
    entity: &Entity,
    component: C
) -> bool
[src]

Attaches a Component to the given Entity. Returns true if successful.

pub fn remove_component<C: Component + 'static>(
    &mut self,
    entity: &Entity
) -> bool
[src]

Detaches a Component from the given Entity. Returns true if successful.

pub fn add_entity(&mut self) -> Entity[src]

Creates a new Entity within the scene, returning its handler.

pub fn remove_entity(&mut self, entity: &Entity) -> bool[src]

Removes the Entity with the given handle from the scene. Returns true if successful.

pub fn has_entity(&self, entity: &Entity) -> bool[src]

Returns true if the scene has the given Entity.

pub fn spawn(
    &mut self,
    spawnable_id: T::SpawnableIdType,
    game: &mut GameControl,
    x: f64,
    y: f64,
    args: &[SpawnArg]
)
[src]

pub fn add_thinker_system(&mut self, system: Box<dyn ThinkerSystem<T>>)[src]

Adds the given ThinkerSystem to the scene

pub fn add_drawer_system(&mut self, system: Box<dyn DrawerSystem>)[src]

Adds the given DrawerSystem to the scene

Trait Implementations

impl<T: SceneType + 'static> BaseScene for Scene<T>[src]

fn think(&mut self, game: &mut GameControl)[src]

Processes all the ThinkerSystems in this scene. You normally do not need to call this yourself, as the Gameloop handles this for you.

fn start(&mut self, game: &mut GameControl) -> bool[src]

Allows all the ThinkerSystems to process their "start of scene" actions. You normally do not need to call this yourself, as the Gameloop handles this for you.

fn end(&mut self, game: &mut GameControl) -> bool[src]

Allows all the ThinkerSystems to process their "end of scene" actions. You normally do not need to call this yourself, as the Gameloop handles this for you.

fn draw(
    &mut self,
    drawing: &mut Box<dyn DrawControl>,
    transform: &DrawTransform,
    interpolation: f32
)
[src]

Processes all the DrawerSystems in this scene. You normally do not need to call this yourself, as the Gameloop handles this for you.

fn entity_count(&self) -> usize[src]

Returns the number of Entities in the scene

fn component_count(&self) -> usize[src]

Returns the number of Components in the scene

Auto Trait Implementations

impl<T> !RefUnwindSafe for Scene<T>

impl<T> !Send for Scene<T>

impl<T> !Sync for Scene<T>

impl<T> Unpin for Scene<T> where
    T: Unpin

impl<T> !UnwindSafe for Scene<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.