pub struct Pet {
pub template_id: PetId,
pub name: I18nString,
pub icon_path: String,
pub rarity: PetRarity,
pub level: i64,
pub shards_amount: i64,
pub active_ability_id: Option<AbilityId>,
pub passive_ability_id: Option<AbilityId>,
pub stats: Vec<PetComputedSecondaryStat>,
}Fields§
§template_id: PetId§name: I18nString§icon_path: String§rarity: PetRarity§level: i64§shards_amount: i64§active_ability_id: Option<AbilityId>§passive_ability_id: Option<AbilityId>§stats: Vec<PetComputedSecondaryStat>Implementations§
Source§impl Pet
impl Pet
pub fn from_template( template: &PetTemplate, rarity: PetRarity, level: i64, shards_amount: i64, ) -> Self
pub fn recompute_stats(&mut self, template: &PetTemplate)
Trait Implementations§
Source§impl CustomType for Pet
impl CustomType for Pet
Source§fn build(builder: TypeBuilder<'_, Self>)
fn build(builder: TypeBuilder<'_, Self>)
Builds the custom type for use with the [
Engine]. Read moreSource§impl<'de> Deserialize<'de> for Pet
impl<'de> Deserialize<'de> for Pet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromWasmAbi for Petwhere
Self: DeserializeOwned,
impl FromWasmAbi for Petwhere
Self: DeserializeOwned,
Source§impl JsonSchema for Pet
impl JsonSchema for Pet
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl OptionFromWasmAbi for Petwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for Petwhere
Self: DeserializeOwned,
Source§impl RefFromWasmAbi for Petwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for Petwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
The Wasm ABI type references to
Self are recovered from.Source§impl Tsify for Pet
impl Tsify for Pet
const DECL: &'static str = "export interface Pet {\n template_id: PetId;\n name: I18nString;\n icon_path: string;\n rarity: PetRarity;\n level: number;\n shards_amount: number;\n active_ability_id: AbilityId | null;\n passive_ability_id: AbilityId | null;\n stats: PetComputedSecondaryStat[];\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorFromWasmAbi for Petwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for Petwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
impl Eq for Pet
impl StructuralPartialEq for Pet
Auto Trait Implementations§
impl Freeze for Pet
impl RefUnwindSafe for Pet
impl Send for Pet
impl Sync for Pet
impl Unpin for Pet
impl UnwindSafe for Pet
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more