pub struct GameLogic { /* private fields */ }
Trait Implementations§
Source§impl IGameLogic for GameLogic
impl IGameLogic for GameLogic
Source§fn transition_states(
&mut self,
inputs: &[InputFiltered],
win_offset: (i32, i32),
win_size: (u32, u32),
) -> GameStateChangePending
fn transition_states( &mut self, inputs: &[InputFiltered], win_offset: (i32, i32), win_size: (u32, u32), ) -> GameStateChangePending
computes changed game state given user inputs and current game state
type EventInput = InputFiltered
type EventRender = Event
type GameState = GameState
type GameStateChangePending = GameStateChangePending
type GameStateChangeApply = GameStateChangeApply
type ComputeUnit = ComputeUnit
type ComputeSchedule = ComputeSchedule
Source§type RenderObj = RenderObj
type RenderObj = RenderObj
transform a high level renderobj representation into render commands / elements
fn new() -> GameLogic
fn get_states(&mut self) -> &Self::GameState
fn get_states_mut(&mut self) -> &mut Self::GameState
fn set_continue_compute(&mut self, b: bool)
Source§fn continue_compute(&mut self) -> bool
fn continue_compute(&mut self) -> bool
compute constraints per cycle
Source§fn get_computations(
&mut self,
_changed_game_state: &GameStateChangePending,
) -> Vec<ComputeUnit>
fn get_computations( &mut self, _changed_game_state: &GameStateChangePending, ) -> Vec<ComputeUnit>
get what to compute based on changed game state
Source§fn schedule_computes(
&mut self,
_computes: Vec<ComputeUnit>,
) -> Vec<Self::ComputeSchedule>
fn schedule_computes( &mut self, _computes: Vec<ComputeUnit>, ) -> Vec<Self::ComputeSchedule>
schedule computations
Source§fn get_renderable_components(&mut self) -> Vec<RenderObj>
fn get_renderable_components(&mut self) -> Vec<RenderObj>
get all renderable objects from current game state
Source§fn filter_renderables(&mut self, _r: Vec<RenderObj>) -> Vec<RenderObj>
fn filter_renderables(&mut self, _r: Vec<RenderObj>) -> Vec<RenderObj>
do optimization on renderable objects
fn should_exit(&mut self) -> bool
Source§fn process_input_events(
&mut self,
e: &[Self::EventInput],
win_offset: (i32, i32),
win_size: (u32, u32),
) -> (Vec<Self::EventRender>, bool)
fn process_input_events( &mut self, e: &[Self::EventInput], win_offset: (i32, i32), win_size: (u32, u32), ) -> (Vec<Self::EventRender>, bool)
default implementation
Auto Trait Implementations§
impl Freeze for GameLogic
impl RefUnwindSafe for GameLogic
impl Send for GameLogic
impl Sync for GameLogic
impl Unpin for GameLogic
impl UnwindSafe for GameLogic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more