pub struct GameObjectEntity<T: GameObjectDerived> {
id: u32,
entity: Option<T>,
}
Fields§
§id: u32
§entity: Option<T>
Implementations§
Source§impl<T: GameObjectDerived + FromGameObject> GameObjectEntity<T>
impl<T: GameObjectDerived + FromGameObject> GameObjectEntity<T>
pub fn new(id: u32) -> Self
pub fn get_id(&self) -> u32
Sourcepub fn get_unique_identifier(&self) -> (u32, &'static str)
pub fn get_unique_identifier(&self) -> (u32, &'static str)
Get the unique identifier of the object. This is a tuple of the id and the type name.
pub fn init( &mut self, base: &HashMap<String, SaveFileValue>, game_state: &mut GameState, ) -> Result<(), ParsingError>
pub fn inner(&self) -> Option<&T>
pub fn inner_mut(&mut self) -> Option<&mut T>
pub fn replace(&mut self, entity: T)
Trait Implementations§
Source§impl<T: Debug + GameObjectDerived> Debug for GameObjectEntity<T>
impl<T: Debug + GameObjectDerived> Debug for GameObjectEntity<T>
Source§impl<T: GameObjectDerived + ProceduralPath + FromGameObject> GetPath for GameObjectEntity<T>
impl<T: GameObjectDerived + ProceduralPath + FromGameObject> GetPath for GameObjectEntity<T>
Source§impl<T: GameObjectDerived + FromGameObject> Hash for GameObjectEntity<T>
impl<T: GameObjectDerived + FromGameObject> Hash for GameObjectEntity<T>
Source§impl<T: GameObjectDerived + FromGameObject> PartialEq for GameObjectEntity<T>
impl<T: GameObjectDerived + FromGameObject> PartialEq for GameObjectEntity<T>
Source§impl Renderable for GameObjectEntity<Character>
impl Renderable for GameObjectEntity<Character>
Source§fn get_template() -> &'static str
fn get_template() -> &'static str
Returns the template file name.
This method is used to retrieve the template from the [Environment] object in the Renderer object.
Source§impl Renderable for GameObjectEntity<Culture>
impl Renderable for GameObjectEntity<Culture>
Source§fn get_template() -> &'static str
fn get_template() -> &'static str
Returns the template file name.
This method is used to retrieve the template from the [Environment] object in the Renderer object.
Source§impl Renderable for GameObjectEntity<Dynasty>
impl Renderable for GameObjectEntity<Dynasty>
Source§fn get_template() -> &'static str
fn get_template() -> &'static str
Returns the template file name.
This method is used to retrieve the template from the [Environment] object in the Renderer object.
Source§impl Renderable for GameObjectEntity<Faith>
impl Renderable for GameObjectEntity<Faith>
Source§fn get_template() -> &'static str
fn get_template() -> &'static str
Returns the template file name.
This method is used to retrieve the template from the [Environment] object in the Renderer object.
Source§impl Renderable for GameObjectEntity<House>
impl Renderable for GameObjectEntity<House>
Source§fn get_template() -> &'static str
fn get_template() -> &'static str
Returns the template file name.
This method is used to retrieve the template from the [Environment] object in the Renderer object.
Source§impl Renderable for GameObjectEntity<Title>
impl Renderable for GameObjectEntity<Title>
Source§fn get_template() -> &'static str
fn get_template() -> &'static str
Returns the template file name.
This method is used to retrieve the template from the [Environment] object in the Renderer object.
Source§impl<T> Serialize for GameObjectEntity<T>where
T: Serialize + GameObjectDerived,
impl<T> Serialize for GameObjectEntity<T>where
T: Serialize + GameObjectDerived,
impl<T: GameObjectDerived + FromGameObject> Eq for GameObjectEntity<T>
Auto Trait Implementations§
impl<T> Freeze for GameObjectEntity<T>where
T: Freeze,
impl<T> RefUnwindSafe for GameObjectEntity<T>where
T: RefUnwindSafe,
impl<T> Send for GameObjectEntity<T>where
T: Send,
impl<T> Sync for GameObjectEntity<T>where
T: Sync,
impl<T> Unpin for GameObjectEntity<T>where
T: Unpin,
impl<T> UnwindSafe for GameObjectEntity<T>where
T: UnwindSafe,
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
§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
§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
Compare self to
key
and return true
if they are equal.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