pub enum ResourceFileWrapper {
Path(PathBuf),
StringId {
id: String,
res_full_name: String,
res_type: ResourceType,
},
U32Id {
id: u32,
res_full_name: String,
res_type: ResourceType,
},
}Expand description
A wrapper to a real or imaginary resource file, a “wrapper” that can be either an id (string or u32) or a real file in the filesystem
If you made an imaginary resource file, make sure for the filename of a file that corresponds
to imaginary resource file to have the same name as the id’s res_full_name
This enum is made so that swrs is portable and can be used across platforms with very little to no tweaking
Variants§
Path(PathBuf)
A real path to a real file in the filesystem. swrs will use its path to determine what type of resource this is, filename as the resource name. and swrs will do a check if this file exists
StringId
An imaginary file that is identified with a string
Fields
res_full_name: StringThe resource file name, with its extension. This is used to match with the resources used within this sketchware project.
please make sure the filename of the file that corresponds to this matches with this
res_type: ResourceTypeU32Id
An imaginary file that is identified with an unsigned 32-bit integer
Implementations§
Source§impl ResourceFileWrapper
impl ResourceFileWrapper
pub fn get_full_name(&self) -> String
Sourcepub fn make_random_id(
res_full_name: String,
res_type: ResourceType,
) -> ResourceFileWrapper
pub fn make_random_id( res_full_name: String, res_type: ResourceType, ) -> ResourceFileWrapper
Generates a random ResourceFileWrapper::U32Id with the provided resource name and type
Trait Implementations§
Source§impl Clone for ResourceFileWrapper
impl Clone for ResourceFileWrapper
Source§fn clone(&self) -> ResourceFileWrapper
fn clone(&self) -> ResourceFileWrapper
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceFileWrapper
impl Debug for ResourceFileWrapper
Source§impl PartialEq for ResourceFileWrapper
impl PartialEq for ResourceFileWrapper
Source§fn eq(&self, other: &ResourceFileWrapper) -> bool
fn eq(&self, other: &ResourceFileWrapper) -> bool
self and other values to be equal, and is used by ==.