Struct tiny_terminal_snake::Status
source · pub struct Status {
pub snake: Rc<RefCell<Snake>>,
pub food: (usize, usize),
pub speed_defer: f32,
pub snake_last_len: usize,
pub win: bool,
pub lose: bool,
}
Fields§
§snake: Rc<RefCell<Snake>>
§food: (usize, usize)
§speed_defer: f32
§snake_last_len: usize
§win: bool
§lose: bool
Trait Implementations§
source§impl Widget<Status> for Frame
impl Widget<Status> for Frame
source§fn event(
&mut self,
ctx: &mut EventCtx<'_, '_>,
event: &Event,
data: &mut Status,
_env: &Env
)
fn event( &mut self, ctx: &mut EventCtx<'_, '_>, event: &Event, data: &mut Status, _env: &Env )
need this function for handling the arrow keys.
source§fn lifecycle(
&mut self,
_ctx: &mut LifeCycleCtx<'_, '_>,
_event: &LifeCycle,
_data: &Status,
_env: &Env
)
fn lifecycle( &mut self, _ctx: &mut LifeCycleCtx<'_, '_>, _event: &LifeCycle, _data: &Status, _env: &Env )
Handle a life cycle notification. Read more