pub struct ArtifactStone {
pub template_id: ArtifactStoneTemplateId,
pub level: i64,
pub copies: i64,
pub socket: Option<ArtifactSocketSlot>,
pub law_target: Option<LawTemplateId>,
}Expand description
One artifact stone the player owns, and the socket it currently sits in.
The socket lives on the stone, exactly like crate::stones::Stone, so a
socketed stone never leaves the collection and cannot be lost by any
operation — including swapping the worn artifact, which does not read this
list at all.
Fields§
§template_id: ArtifactStoneTemplateId§level: i64§copies: i64Raw copies banked against this stone, spendable on the next level.
socket: Option<ArtifactSocketSlot>Some while socketed. One instance means one socket.
law_target: Option<LawTemplateId>The law a right-column (Law) stone acts on. None for every Aspect
stone, and for a Law stone the player has not pointed anywhere yet — such
a stone is inert, exactly like an empty socket.
The reference is to the LAW, never to a bridge or a link. A bridge
has no id of its own (character_law_bridges is keyed by the law pair)
and v0.2 gives a law exactly one partner
(mechanics::cores::MAX_BRIDGES_PER_LAW, validate_new_bridge), so “the
bridge that law X is in” is an unambiguous address built out of one law
id. The consequence is deliberate and load-bearing rather than an
accident of the encoding: if the player tears down the chosen law’s
bridge and builds it a new one, the stone follows onto the new bridge by
itself. Nothing points at the old link, so nothing has to be re-pointed.
Cleared when the chosen law leaves its slot (the monolith’s unslot),
so a stone can never hold a reference to a law that is not on a core.
Implementations§
Source§impl ArtifactStone
impl ArtifactStone
pub const fn new(template_id: ArtifactStoneTemplateId) -> Self
pub const fn is_socketed(&self) -> bool
Trait Implementations§
Source§impl Clone for ArtifactStone
impl Clone for ArtifactStone
Source§fn clone(&self) -> ArtifactStone
fn clone(&self) -> ArtifactStone
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArtifactStone
impl Debug for ArtifactStone
Source§impl<'de> Deserialize<'de> for ArtifactStone
impl<'de> Deserialize<'de> for ArtifactStone
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>,
Source§impl From<ArtifactStone> for JsValuewhere
ArtifactStone: Serialize,
impl From<ArtifactStone> for JsValuewhere
ArtifactStone: Serialize,
Source§fn from(value: ArtifactStone) -> Self
fn from(value: ArtifactStone) -> Self
Source§impl FromWasmAbi for ArtifactStonewhere
Self: DeserializeOwned,
impl FromWasmAbi for ArtifactStonewhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for ArtifactStonewhere
ArtifactStone: Serialize,
impl IntoWasmAbi for ArtifactStonewhere
ArtifactStone: Serialize,
Source§impl JsonSchema for ArtifactStone
impl JsonSchema for ArtifactStone
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl OptionFromWasmAbi for ArtifactStonewhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for ArtifactStonewhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for ArtifactStonewhere
ArtifactStone: Serialize,
impl OptionIntoWasmAbi for ArtifactStonewhere
ArtifactStone: Serialize,
Source§impl PartialEq for ArtifactStone
impl PartialEq for ArtifactStone
Source§impl RefFromWasmAbi for ArtifactStonewhere
Self: DeserializeOwned,
impl RefFromWasmAbi for ArtifactStonewhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
Self are recovered from.Source§type Anchor = SelfOwner<ArtifactStone>
type Anchor = SelfOwner<ArtifactStone>
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 ArtifactStone
impl Serialize for ArtifactStone
Source§impl Tsify for ArtifactStone
impl Tsify for ArtifactStone
const DECL: &'static str = "/**\n * One artifact stone the player owns, and the socket it currently sits in.\n *\n * The socket lives on the stone, exactly like [`crate::stones::Stone`], so a\n * socketed stone never leaves the collection and cannot be lost by any\n * operation \u{2014} including swapping the worn artifact, which does not read this\n * list at all.\n */\nexport interface ArtifactStone {\n template_id: ArtifactStoneTemplateId;\n level: number;\n /**\n * Raw copies banked against this stone, spendable on the next level.\n */\n copies: number;\n /**\n * `Some` while socketed. One instance means one socket.\n */\n socket: ArtifactSocketSlot | null;\n /**\n * The law a right-column (Law) stone acts on. `None` for every Aspect\n * stone, and for a Law stone the player has not pointed anywhere yet \u{2014} such\n * a stone is inert, exactly like an empty socket.\n *\n * **The reference is to the LAW, never to a bridge or a link.** A bridge\n * has no id of its own (`character_law_bridges` is keyed by the law pair)\n * and v0.2 gives a law exactly one partner\n * (`mechanics::cores::MAX_BRIDGES_PER_LAW`, `validate_new_bridge`), so \\\"the\n * bridge that law X is in\\\" is an unambiguous address built out of one law\n * id. The consequence is deliberate and load-bearing rather than an\n * accident of the encoding: **if the player tears down the chosen law\\\'s\n * bridge and builds it a new one, the stone follows onto the new bridge by\n * itself.** Nothing points at the old link, so nothing has to be re-pointed.\n *\n * Cleared when the chosen law leaves its slot (the monolith\\\'s `unslot`),\n * so a stone can never hold a reference to a law that is not on a core.\n */\n law_target: LawTemplateId | null;\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 ArtifactStonewhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for ArtifactStonewhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for ArtifactStonewhere
ArtifactStone: Serialize,
impl VectorIntoWasmAbi for ArtifactStonewhere
ArtifactStone: Serialize,
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for ArtifactStone
impl WasmDescribeVector for ArtifactStone
impl Eq for ArtifactStone
impl StructuralPartialEq for ArtifactStone
Auto Trait Implementations§
impl Freeze for ArtifactStone
impl RefUnwindSafe for ArtifactStone
impl Send for ArtifactStone
impl Sync for ArtifactStone
impl Unpin for ArtifactStone
impl UnwindSafe for ArtifactStone
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§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> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.