Struct pill_engine::game::Engine [−][src]
pub struct Engine { /* fields omitted */ }
Expand description
Heart of Pill Engine
Implementations
Pill Engine game API
Adds game-defined system to the game update phase
Removes game-defined system
Toggles game-defined system
Returns EntityBuilder, allowing for handy entity creation
pub fn remove_entity(
&mut self,
entity_handle: EntityHandle,
scene_handle: SceneHandle
) -> Result<()>
pub fn register_component<T>(&mut self, scene_handle: SceneHandle) -> Result<()> where
T: Component<Storage = ComponentStorage<T>>,
pub fn register_component<T>(&mut self, scene_handle: SceneHandle) -> Result<()> where
T: Component<Storage = ComponentStorage<T>>,
Registers new component type in scene specified with scene handle
pub fn add_component_to_entity<T>(
&mut self,
scene_handle: SceneHandle,
entity_handle: EntityHandle,
component: T
) -> Result<()> where
T: Component<Storage = ComponentStorage<T>>,
pub fn add_component_to_entity<T>(
&mut self,
scene_handle: SceneHandle,
entity_handle: EntityHandle,
component: T
) -> Result<()> where
T: Component<Storage = ComponentStorage<T>>,
Adds new component to the entity specified with scene and entity handle
pub fn remove_component_from_entity<T>(
&mut self,
scene_handle: SceneHandle,
entity_handle: EntityHandle
) -> Result<()> where
T: Component<Storage = ComponentStorage<T>>,
pub fn remove_component_from_entity<T>(
&mut self,
scene_handle: SceneHandle,
entity_handle: EntityHandle
) -> Result<()> where
T: Component<Storage = ComponentStorage<T>>,
Removes component from the entity specified with scene and entity handle
pub fn add_global_component<T>(&mut self, component: T) -> Result<()> where
T: GlobalComponent<Storage = GlobalComponentStorage<T>>,
pub fn add_global_component<T>(&mut self, component: T) -> Result<()> where
T: GlobalComponent<Storage = GlobalComponentStorage<T>>,
Adds global component to engine
pub fn get_global_component<T>(&self) -> Result<&T> where
T: GlobalComponent<Storage = GlobalComponentStorage<T>>,
pub fn get_global_component<T>(&self) -> Result<&T> where
T: GlobalComponent<Storage = GlobalComponentStorage<T>>,
Returns global component
pub fn get_global_component_mut<T>(&mut self) -> Result<&mut T> where
T: GlobalComponent<Storage = GlobalComponentStorage<T>>,
pub fn get_global_component_mut<T>(&mut self) -> Result<&mut T> where
T: GlobalComponent<Storage = GlobalComponentStorage<T>>,
Returns global mutable component
pub fn remove_global_component<T>(&mut self) -> Result<()> where
T: GlobalComponent<Storage = GlobalComponentStorage<T>>,
pub fn remove_global_component<T>(&mut self) -> Result<()> where
T: GlobalComponent<Storage = GlobalComponentStorage<T>>,
Removes global component from the engine
pub fn iterate_one_component<A>(
&self
) -> Result<impl Iterator<Item = (EntityHandle, &A)>> where
A: Component<Storage = ComponentStorage<A>>,
pub fn iterate_one_component<A>(
&self
) -> Result<impl Iterator<Item = (EntityHandle, &A)>> where
A: Component<Storage = ComponentStorage<A>>,
Returns iterator for specified component
Additionally returns entity handle to matching entities
pub fn iterate_one_component_mut<A>(
&mut self
) -> Result<impl Iterator<Item = (EntityHandle, &mut A)>> where
A: Component<Storage = ComponentStorage<A>>,
pub fn iterate_one_component_mut<A>(
&mut self
) -> Result<impl Iterator<Item = (EntityHandle, &mut A)>> where
A: Component<Storage = ComponentStorage<A>>,
Returns iterator for specified component mutable
Additionally returns entity handle to matching entities
pub fn iterate_two_components<A, B>(
&self
) -> Result<impl Iterator<Item = (EntityHandle, &A, &B)>> where
A: Component<Storage = ComponentStorage<A>>,
B: Component<Storage = ComponentStorage<B>>,
pub fn iterate_two_components<A, B>(
&self
) -> Result<impl Iterator<Item = (EntityHandle, &A, &B)>> where
A: Component<Storage = ComponentStorage<A>>,
B: Component<Storage = ComponentStorage<B>>,
Returns iterator for specified component pair
Iterator fetches specified components only for those entities which have them all Additionally returns entity handle to matching entities
pub fn iterate_two_components_mut<A, B>(
&mut self
) -> Result<impl Iterator<Item = (EntityHandle, &mut A, &mut B)>> where
A: Component<Storage = ComponentStorage<A>>,
B: Component<Storage = ComponentStorage<B>>,
pub fn iterate_two_components_mut<A, B>(
&mut self
) -> Result<impl Iterator<Item = (EntityHandle, &mut A, &mut B)>> where
A: Component<Storage = ComponentStorage<A>>,
B: Component<Storage = ComponentStorage<B>>,
Returns iterator for specified component pair mutable
Iterator fetches specified components only for those entities which have them all Additionally returns entity handle to matching entities
pub fn iterate_three_components<A, B, C>(
&self
) -> Result<impl Iterator<Item = (EntityHandle, &A, &B, &C)>> where
A: Component<Storage = ComponentStorage<A>>,
B: Component<Storage = ComponentStorage<B>>,
C: Component<Storage = ComponentStorage<C>>,
pub fn iterate_three_components<A, B, C>(
&self
) -> Result<impl Iterator<Item = (EntityHandle, &A, &B, &C)>> where
A: Component<Storage = ComponentStorage<A>>,
B: Component<Storage = ComponentStorage<B>>,
C: Component<Storage = ComponentStorage<C>>,
Returns iterator for specified component triple
Iterator fetches specified components only for those entities which have them all Additionally returns entity handle to matching entities
pub fn iterate_three_components_mut<A, B, C>(
&mut self
) -> Result<impl Iterator<Item = (EntityHandle, &mut A, &mut B, &mut C)>> where
A: Component<Storage = ComponentStorage<A>>,
B: Component<Storage = ComponentStorage<B>>,
C: Component<Storage = ComponentStorage<C>>,
pub fn iterate_three_components_mut<A, B, C>(
&mut self
) -> Result<impl Iterator<Item = (EntityHandle, &mut A, &mut B, &mut C)>> where
A: Component<Storage = ComponentStorage<A>>,
B: Component<Storage = ComponentStorage<B>>,
C: Component<Storage = ComponentStorage<C>>,
Returns iterator for specified component triple mutable
Iterator fetches specified components only for those entities which have them all Additionally returns entity handle to matching entities
Returns handle to the scene specified by its name
Returns handle to the active scene
pub fn register_resource_type<T>(
&mut self,
max_resource_count: usize
) -> Result<()> where
T: Resource<Storage = ResourceStorage<T>>,
pub fn add_resource<T>(&mut self, resource: T) -> Result<T::Handle> where
T: Resource<Storage = ResourceStorage<T>>,
pub fn get_resource<'a, T>(
&'a self,
resource_handle: &'a T::Handle
) -> Result<&'a T> where
T: Resource<Storage = ResourceStorage<T>>,
pub fn get_resource_by_name<T>(&self, name: &str) -> Result<&T> where
T: Resource<Storage = ResourceStorage<T>>,
pub fn get_resource_by_name<T>(&self, name: &str) -> Result<&T> where
T: Resource<Storage = ResourceStorage<T>>,
Returns resource specified by its name
pub fn get_resource_handle<T>(&self, name: &str) -> Result<T::Handle> where
T: Resource<Storage = ResourceStorage<T>>,
pub fn get_resource_handle<T>(&self, name: &str) -> Result<T::Handle> where
T: Resource<Storage = ResourceStorage<T>>,
Returns handle to resource specified by the name of this resource
pub fn get_resource_mut<'a, T>(
&'a mut self,
resource_handle: &'a T::Handle
) -> Result<&'a mut T> where
T: Resource<Storage = ResourceStorage<T>>,
pub fn get_resource_by_name_mut<T>(&mut self, name: &str) -> Result<&mut T> where
T: Resource<Storage = ResourceStorage<T>>,
pub fn get_resource_by_name_mut<T>(&mut self, name: &str) -> Result<&mut T> where
T: Resource<Storage = ResourceStorage<T>>,
Returns mutable resource specified by its name