pub struct AbilityStoneSockets(pub BTreeMap<AbilityId, BTreeMap<AbilityStoneSocketIndex, AbilityStoneId>>);Expand description
Socketed ability stones: ability -> socket index -> stone template.
Tuple Fields§
§0: BTreeMap<AbilityId, BTreeMap<AbilityStoneSocketIndex, AbilityStoneId>>Implementations§
Source§impl AbilityStoneSockets
impl AbilityStoneSockets
pub fn get( &self, ability_id: AbilityId, socket_index: AbilityStoneSocketIndex, ) -> Option<AbilityStoneId>
pub fn set( &mut self, ability_id: AbilityId, socket_index: AbilityStoneSocketIndex, stone_id: AbilityStoneId, )
pub fn clear_socket( &mut self, ability_id: AbilityId, socket_index: AbilityStoneSocketIndex, ) -> Option<AbilityStoneId>
Sourcepub fn sockets_of(
&self,
ability_id: AbilityId,
) -> impl Iterator<Item = (AbilityStoneSocketIndex, AbilityStoneId)> + '_
pub fn sockets_of( &self, ability_id: AbilityId, ) -> impl Iterator<Item = (AbilityStoneSocketIndex, AbilityStoneId)> + '_
Every stone socketed into ability_id, in socket order.
Sourcepub fn is_socketed_in(
&self,
ability_id: AbilityId,
stone_id: AbilityStoneId,
) -> bool
pub fn is_socketed_in( &self, ability_id: AbilityId, stone_id: AbilityStoneId, ) -> bool
Whether stone_id already occupies a socket of ability_id. A stone
template may hold at most one socket per ability (stub rule: it stops a
single copy from filling all four sockets of one ability).
Trait Implementations§
Source§impl Clone for AbilityStoneSockets
impl Clone for AbilityStoneSockets
Source§fn clone(&self) -> AbilityStoneSockets
fn clone(&self) -> AbilityStoneSockets
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AbilityStoneSockets
impl Debug for AbilityStoneSockets
Source§impl Default for AbilityStoneSockets
impl Default for AbilityStoneSockets
Source§fn default() -> AbilityStoneSockets
fn default() -> AbilityStoneSockets
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AbilityStoneSockets
impl<'de> Deserialize<'de> for AbilityStoneSockets
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 AbilityStoneSocketswhere
Self: DeserializeOwned,
impl FromWasmAbi for AbilityStoneSocketswhere
Self: DeserializeOwned,
Source§impl JsonSchema for AbilityStoneSockets
impl JsonSchema for AbilityStoneSockets
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 AbilityStoneSocketswhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for AbilityStoneSocketswhere
Self: DeserializeOwned,
Source§impl PartialEq for AbilityStoneSockets
impl PartialEq for AbilityStoneSockets
Source§impl RefFromWasmAbi for AbilityStoneSocketswhere
Self: DeserializeOwned,
impl RefFromWasmAbi for AbilityStoneSocketswhere
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§type Anchor = SelfOwner<AbilityStoneSockets>
type Anchor = SelfOwner<AbilityStoneSockets>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl Serialize for AbilityStoneSockets
impl Serialize for AbilityStoneSockets
Source§impl Tsify for AbilityStoneSockets
impl Tsify for AbilityStoneSockets
const DECL: &'static str = "/**\n * Socketed ability stones: ability -> socket index -> stone template.\n */\nexport type AbilityStoneSockets = Record<AbilityId, Record<AbilityStoneSocketIndex, AbilityStoneId>>;"
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 AbilityStoneSocketswhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for AbilityStoneSocketswhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl WasmDescribeVector for AbilityStoneSockets
impl WasmDescribeVector for AbilityStoneSockets
impl Eq for AbilityStoneSockets
impl StructuralPartialEq for AbilityStoneSockets
Auto Trait Implementations§
impl Freeze for AbilityStoneSockets
impl RefUnwindSafe for AbilityStoneSockets
impl Send for AbilityStoneSockets
impl Sync for AbilityStoneSockets
impl Unpin for AbilityStoneSockets
impl UnwindSafe for AbilityStoneSockets
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