Skip to main content

Object

Struct Object 

Source
pub struct Object { /* private fields */ }

Implementations§

Source§

impl Object

Source

pub fn new(object_id: i32, x: i32, y: i32) -> Self

Examples found in repository?
examples/print_object_string.rs (line 5)
4fn main() {
5    let mut object = Object::new(1, 10, 10);
6
7    object.set_property(ObjectCommonProperties::Color1, 3);
8
9    println!("{}", object.to_object_string());
10}
More examples
Hide additional examples
examples/print_level_string.rs (line 5)
4fn main() {
5    let object = Object::new(1, 20, 25);
6    let mut start_level_object = StartLevelString::new();
7
8    start_level_object.set_property(StartLevelStringKeys::Gamemode, 3);
9
10    println!("{}", start_level_object.to_start_level_string() + ";" + &*object.to_object_string())
11}
Source

pub fn to_object_string(&self) -> String

Examples found in repository?
examples/print_object_string.rs (line 9)
4fn main() {
5    let mut object = Object::new(1, 10, 10);
6
7    object.set_property(ObjectCommonProperties::Color1, 3);
8
9    println!("{}", object.to_object_string());
10}
More examples
Hide additional examples
examples/print_level_string.rs (line 10)
4fn main() {
5    let object = Object::new(1, 20, 25);
6    let mut start_level_object = StartLevelString::new();
7
8    start_level_object.set_property(StartLevelStringKeys::Gamemode, 3);
9
10    println!("{}", start_level_object.to_start_level_string() + ";" + &*object.to_object_string())
11}
Source

pub fn set_property( &mut self, id: impl PropertyID, value: impl PropertyValueType, )

Examples found in repository?
examples/print_object_string.rs (line 7)
4fn main() {
5    let mut object = Object::new(1, 10, 10);
6
7    object.set_property(ObjectCommonProperties::Color1, 3);
8
9    println!("{}", object.to_object_string());
10}
Source

pub fn remove_property(&mut self, id: impl PropertyID) -> Option<String>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.