pub struct KonnektorenAssetRegistry {
pub challenges: HashMap<String, Handle<ChallengeAsset>>,
pub levels: HashMap<String, Handle<LevelAsset>>,
pub loaded_challenges: HashMap<String, bool>,
pub loaded_levels: HashMap<String, bool>,
pub challenge_holders: HashMap<String, Handle<ChallengeAsset>>,
pub level_holders: HashMap<String, Handle<LevelAsset>>,
}
Expand description
Central registry for all Konnektoren assets Maps logical IDs to asset handles for easy access
Fields§
§challenges: HashMap<String, Handle<ChallengeAsset>>
§levels: HashMap<String, Handle<LevelAsset>>
§loaded_challenges: HashMap<String, bool>
§loaded_levels: HashMap<String, bool>
§challenge_holders: HashMap<String, Handle<ChallengeAsset>>
§level_holders: HashMap<String, Handle<LevelAsset>>
Implementations§
Source§impl KonnektorenAssetRegistry
impl KonnektorenAssetRegistry
Sourcepub fn register_challenge(&mut self, id: String, handle: Handle<ChallengeAsset>)
pub fn register_challenge(&mut self, id: String, handle: Handle<ChallengeAsset>)
Register a challenge asset with a logical ID
Sourcepub fn register_level(&mut self, id: String, handle: Handle<LevelAsset>)
pub fn register_level(&mut self, id: String, handle: Handle<LevelAsset>)
Register a level asset with a logical ID
Sourcepub fn get_challenge_handle(&self, id: &str) -> Option<&Handle<ChallengeAsset>>
pub fn get_challenge_handle(&self, id: &str) -> Option<&Handle<ChallengeAsset>>
Get a challenge handle by ID
Sourcepub fn get_level_handle(&self, id: &str) -> Option<&Handle<LevelAsset>>
pub fn get_level_handle(&self, id: &str) -> Option<&Handle<LevelAsset>>
Get a level handle by ID
Sourcepub fn is_challenge_loaded(&self, id: &str) -> bool
pub fn is_challenge_loaded(&self, id: &str) -> bool
Check if a challenge is loaded
Sourcepub fn is_level_loaded(&self, id: &str) -> bool
pub fn is_level_loaded(&self, id: &str) -> bool
Check if a level is loaded
Sourcepub fn get_loaded_challenges(&self) -> Vec<String>
pub fn get_loaded_challenges(&self) -> Vec<String>
Get all loaded challenge IDs
Sourcepub fn get_loaded_levels(&self) -> Vec<String>
pub fn get_loaded_levels(&self) -> Vec<String>
Get all loaded level IDs
Sourcepub fn are_all_assets_loaded(&self) -> bool
pub fn are_all_assets_loaded(&self) -> bool
Check if all registered assets are loaded
Sourcepub fn get_loading_progress(&self) -> f32
pub fn get_loading_progress(&self) -> f32
Get loading progress (0.0 to 1.0)
Trait Implementations§
Source§impl Debug for KonnektorenAssetRegistry
impl Debug for KonnektorenAssetRegistry
Source§impl Default for KonnektorenAssetRegistry
impl Default for KonnektorenAssetRegistry
Source§fn default() -> KonnektorenAssetRegistry
fn default() -> KonnektorenAssetRegistry
Returns the “default value” for a type. Read more
impl Resource for KonnektorenAssetRegistry
Auto Trait Implementations§
impl Freeze for KonnektorenAssetRegistry
impl !RefUnwindSafe for KonnektorenAssetRegistry
impl Send for KonnektorenAssetRegistry
impl Sync for KonnektorenAssetRegistry
impl Unpin for KonnektorenAssetRegistry
impl !UnwindSafe for KonnektorenAssetRegistry
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Convert the source color to the destination color using the specified
method
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Convert the source color to the destination color using the bradford
method by default
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self
using default()
.
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Convert into T with values clamped to the color defined bounds Read more
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Convert into T. The resulting color might be invalid in its color space Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
Convert into T, returning ok if the color is inside of its defined
range, otherwise an
OutOfBounds
error is returned which contains
the unclamped color. Read more