[][src]Struct evolution::food::Food

pub struct Food {
    pub radius: f32,
    pub pos: Point2<f32>,
    pub color: [f32; 4],
}

An edible entity for fish

Fields

radius: f32

The radius of the displayed circle, representing the piece of food.

pos: Point2<f32>

The 2D position of the food (the food's location is in relation to its center)

color: [f32; 4]

The RGBA color of the food.

Methods

impl Food[src]

pub fn new(pos: Point2<f32>) -> Self[src]

pub fn draw(&self, ctx: &mut Context) -> GameResult[src]

Draws the circle representing the piece of food in the ggez window

Trait Implementations

impl Entity for Food[src]

fn pos(&self) -> Point2<f32>[src]

Returns a reference to the piece of food's position

fn radius(&self) -> f32[src]

Returns the radius of the piece of food

Auto Trait Implementations

impl Send for Food

impl Sync for Food

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]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,