[−][src]Struct tiny_rpg::entity::EntityBuilder
Builds an instance of Entity. Requires a position to be set, in order to place the entity. A lot of premade Entities exist in Entity, they don't use the builder for now, but soon should.
Methods
impl EntityBuilder
[src]
pub fn set_position(self, point: Point) -> Self
[src]
Set the position of an Entity using a Point. Position is the top left of an object. lower values are upward, higher values are downward for y. Lower values are left, higher values are right for y.
pub fn set_xy(self, x: i32, y: i32) -> Self
[src]
Same as set_position except instead of using a Point, you can simply use x and y.
pub fn set_dimension(self, dimension: Dimension) -> Self
[src]
Set the width and height of an entity by a Dimension.
pub fn set_size(self, width: u32, height: u32) -> Self
[src]
Set the width and height of an entity using u32 values.
pub fn set_abilities(self, abilities: Vec<Ability>) -> Self
[src]
Give the entity builder a vector of abilities to have.
Trait Implementations
impl Builder for EntityBuilder
[src]
type product = Entity
fn new() -> EntityBuilder
[src]
Creates a new instance of EntityBuilder with some defaults. Still need to specify a position.
fn build(self) -> Result<Entity, BuilderError>
[src]
Creates an instance of Entity from EntityBuilder.
Auto Trait Implementations
impl Sync for EntityBuilder
impl Unpin for EntityBuilder
impl Send for EntityBuilder
impl UnwindSafe for EntityBuilder
impl RefUnwindSafe for EntityBuilder
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,