[][src]Struct tiny_rpg::entity::EntityBuilder

pub struct EntityBuilder { /* fields omitted */ }

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

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]