[−][src]Struct amethyst_test::AmethystApplication
Builder for an Amethyst application.
This provides varying levels of setup so that users do not have to register common bundles.
Type Parameters
T
: Game data type that holds the common dispatcher.E
: Custom event type shared between states.
Implementations
impl AmethystApplication<GameData<'static, 'static>, StateEvent, StateEventReader>
[src]
pub fn blank(
) -> AmethystApplication<GameData<'static, 'static>, StateEvent, StateEventReader>
[src]
) -> AmethystApplication<GameData<'static, 'static>, StateEvent, StateEventReader>
Returns an Amethyst application without any bundles.
pub fn ui_base<B: BindingTypes>(
) -> AmethystApplication<GameData<'static, 'static>, StateEvent, StateEventReader>
[src]
) -> AmethystApplication<GameData<'static, 'static>, StateEvent, StateEventReader>
Returns an application with the Transform, Input, and UI bundles.
This also adds a ScreenDimensions
resource to the World
so that UI calculations can be
done.
pub fn assets_dir() -> Result<PathBuf, Error>
[src]
Returns a PathBuf
to <crate_dir>/assets
.
impl<E, R> AmethystApplication<GameData<'static, 'static>, E, R> where
E: Clone + Send + Sync + 'static,
R: Default,
[src]
E: Clone + Send + Sync + 'static,
R: Default,
pub fn build(
self
) -> Result<CoreApplication<'static, GameData<'static, 'static>, E, R>, Error> where
R: EventReader<'b, Event = E>,
[src]
self
) -> Result<CoreApplication<'static, GameData<'static, 'static>, E, R>, Error> where
R: EventReader<'b, Event = E>,
Returns the built Application.
If you are intending to run the Application
, you can use the run()
or run_isolated()
methods instead.
pub fn run(self) -> Result<(), Error> where
R: EventReader<'b, Event = E>,
[src]
R: EventReader<'b, Event = E>,
Runs the application and returns Ok(())
if nothing went wrong.
pub fn run_isolated(self) -> Result<(), Error> where
R: EventReader<'b, Event = E>,
[src]
R: EventReader<'b, Event = E>,
Run the application in a sub thread.
Historically this has been used for the following reasons:
- To avoid segmentation faults using X and mesa.
- To avoid multiple threads sharing the same memory in Vulkan.
This must NOT be used when including the AudioBundle
on Windows, as it causes a
segfault.
impl<T, E, R> AmethystApplication<T, E, R> where
T: GameUpdate + 'static,
E: Send + Sync + 'static,
R: 'static,
[src]
T: GameUpdate + 'static,
E: Send + Sync + 'static,
R: 'static,
pub fn with_custom_event_type<Evt, Rdr>(
self
) -> AmethystApplication<T, Evt, Rdr> where
Evt: Send + Sync + 'static,
Rdr: EventReader<'b, Event = Evt>,
[src]
self
) -> AmethystApplication<T, Evt, Rdr> where
Evt: Send + Sync + 'static,
Rdr: EventReader<'b, Event = Evt>,
Use the specified custom event type instead of ()
.
This must be invoked before any of the .with_*()
function calls as the custom event
type parameter is changed, so we are unable to bring any of the existing parameters across.
Type Parameters
Evt
: Type used for state events.Rdr
: Event reader of the state events.
pub fn with_bundle<B>(self, bundle: B) -> Self where
B: SystemBundle<'static, 'static> + Send + 'static,
[src]
B: SystemBundle<'static, 'static> + Send + 'static,
pub fn with_bundle_fn<FnBundle, B>(self, bundle_function: FnBundle) -> Self where
FnBundle: FnOnce() -> B + Send + 'static,
B: SystemBundle<'static, 'static> + 'static,
[src]
FnBundle: FnOnce() -> B + Send + 'static,
B: SystemBundle<'static, 'static> + 'static,
Adds a bundle to the list of bundles.
This provides an alternative to .with_bundle(B)
where B
is !Send
. The function that
instantiates the bundle must be Send
.
Parameters
bundle_function
: Function to instantiate the Bundle.
pub fn with_ui_bundles<B: BindingTypes>(self) -> Self
[src]
Registers InputBundle
and UiBundle
with this application.
This method is provided to avoid [stringly-typed][stringly] parameters for the Input and UI
bundles. We recommended that you use strong types instead of <StringBindings>
.
Type Parameters
B
: Type representing the input binding types.
pub fn with_resource<Res>(self, resource: Res) -> Self where
Res: Resource,
[src]
Res: Resource,
pub fn with_state<S, FnStateLocal>(self, state_fn: FnStateLocal) -> Self where
S: State<T, E> + 'static,
FnStateLocal: FnOnce() -> S + Send + Sync + 'static,
[src]
S: State<T, E> + 'static,
FnStateLocal: FnOnce() -> S + Send + Sync + 'static,
pub fn with_system<S, N>(self, system: S, name: N, deps: &[N]) -> Self where
S: for<'sys_local> System<'sys_local> + Send + 'static,
N: Into<String> + Clone,
[src]
S: for<'sys_local> System<'sys_local> + Send + 'static,
N: Into<String> + Clone,
Registers a System
into this application's GameData
.
Parameters
system
:System
to run.name
: Name to register the system with, used for dependency ordering.deps
: Names of systems that must run before this system.
pub fn with_system_desc<SD, S, N>(
self,
system_desc: SD,
name: N,
deps: &[N]
) -> Self where
SD: SystemDesc<'static, 'static, S> + Send + Sync + 'static,
S: for<'sys_local> System<'sys_local> + Send + 'static,
N: Into<String> + Clone,
[src]
self,
system_desc: SD,
name: N,
deps: &[N]
) -> Self where
SD: SystemDesc<'static, 'static, S> + Send + Sync + 'static,
S: for<'sys_local> System<'sys_local> + Send + 'static,
N: Into<String> + Clone,
Registers a System
into this application's GameData
.
Parameters
system_desc
: Descriptor to instantiate theSystem
.name
: Name to register the system with, used for dependency ordering.deps
: Names of systems that must run before this system.
pub fn with_thread_local<RNDesc, RN>(self, run_now_desc: RNDesc) -> Self where
RNDesc: RunNowDesc<'static, 'static, RN> + Send + Sync + 'static,
RN: for<'sys_local> RunNow<'sys_local> + Send + 'static,
[src]
RNDesc: RunNowDesc<'static, 'static, RN> + Send + Sync + 'static,
RN: for<'sys_local> RunNow<'sys_local> + Send + 'static,
Registers a thread local System
into this application's GameData
.
Parameters
run_now_desc
: Descriptor to instantiate the thread local system.
pub fn with_system_single<S, N>(self, system: S, name: N, deps: &[N]) -> Self where
S: for<'sys_local> System<'sys_local> + Send + Sync + 'static,
N: Into<String> + Clone,
[src]
S: for<'sys_local> System<'sys_local> + Send + Sync + 'static,
N: Into<String> + Clone,
Registers a System
to run in a CustomDispatcherState
.
This will run the system once in a dedicated State
, allowing you to inspect the effects of
the system after setting up the world to a desired state.
Parameters
system
:System
to run.name
: Name to register the system with, used for dependency ordering.deps
: Names of systems that must run before this system.
pub fn with_system_desc_single<SD, S, N>(
self,
system_desc: SD,
name: N,
deps: &[N]
) -> Self where
SD: SystemDesc<'static, 'static, S> + Send + Sync + 'static,
S: for<'sys_local> System<'sys_local> + Send + Sync + 'static,
N: Into<String> + Clone,
[src]
self,
system_desc: SD,
name: N,
deps: &[N]
) -> Self where
SD: SystemDesc<'static, 'static, S> + Send + Sync + 'static,
S: for<'sys_local> System<'sys_local> + Send + Sync + 'static,
N: Into<String> + Clone,
Registers a System
to run in a CustomDispatcherState
.
This will run the system once in a dedicated State
, allowing you to inspect the effects of
the system after setting up the world to a desired state.
Parameters
system_desc
: Descriptor to instantiate theSystem
.name
: Name to register the system with, used for dependency ordering.deps
: Names of systems that must run before this system.
pub fn with_fn<F>(self, func: F) -> Self where
F: FnOnce(&mut World) + Send + Sync + 'static,
[src]
F: FnOnce(&mut World) + Send + Sync + 'static,
pub fn with_setup<F>(self, setup_fn: F) -> Self where
F: FnOnce(&mut World) + Send + 'static,
[src]
F: FnOnce(&mut World) + Send + 'static,
Registers a function that sets up the World
.
This is an alias to .with_fn(F)
.
Parameters
setup_fn
: Function to execute.
pub fn with_effect<F>(self, effect_fn: F) -> Self where
F: FnOnce(&mut World) + Send + Sync + 'static,
[src]
F: FnOnce(&mut World) + Send + Sync + 'static,
Registers a function that executes a desired effect.
This is an alias to .with_fn(F)
.
Parameters
effect_fn
: Function that executes an effect.
pub fn with_assertion<F>(self, assertion_fn: F) -> Self where
F: FnOnce(&mut World) + Send + Sync + 'static,
[src]
F: FnOnce(&mut World) + Send + Sync + 'static,
Registers a function to assert an expected outcome.
This is an alias to .with_fn(F)
.
Parameters
assertion_fn
: Function that asserts the expected state.
Trait Implementations
impl<T, E, R> Debug for AmethystApplication<T, E, R> where
E: Send + Sync + 'static,
[src]
E: Send + Sync + 'static,
impl<T: Default, E: Default, R: Default> Default for AmethystApplication<T, E, R> where
E: Send + Sync + 'static,
[src]
E: Send + Sync + 'static,
fn default() -> AmethystApplication<T, E, R>
[src]
Auto Trait Implementations
impl<T, E, R> !RefUnwindSafe for AmethystApplication<T, E, R>
impl<T, E, R> !Send for AmethystApplication<T, E, R>
impl<T, E, R> !Sync for AmethystApplication<T, E, R>
impl<T, E, R> Unpin for AmethystApplication<T, E, R> where
E: Unpin,
R: Unpin,
T: Unpin,
E: Unpin,
R: Unpin,
T: Unpin,
impl<T, E, R> !UnwindSafe for AmethystApplication<T, E, R>
Blanket Implementations
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> Supports<T> for T
impl<T> TryDefault for T where
T: Default,
T: Default,
fn try_default() -> Result<T, String>
fn unwrap_default() -> Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,