pub struct Info { /* private fields */ }
Expand description
Holds information about the Game
Implementations§
Source§impl Info
impl Info
Sourcepub fn new(
name: &str,
steps_per_second: i32,
number_of_players: i32,
input: InputDeviceType,
) -> Self
pub fn new( name: &str, steps_per_second: i32, number_of_players: i32, input: InputDeviceType, ) -> Self
Create a new structure of info about the game being played
§Arguments
name
- The title of the gamesteps_per_second
- The number of times Game::Step() should be called per secondnumber_of_players
- How many players this games should haveinput
- The device type to use for each player
Sourcepub fn step_interval(&self) -> u32
pub fn step_interval(&self) -> u32
Gets time between steps of the game, in nanoseconds
pub fn steps_per_second(&self) -> u32
Sourcepub fn steps_per_second_to_interval(steps: i32) -> u32
pub fn steps_per_second_to_interval(steps: i32) -> u32
Converts from steps per second to a time interval in nanoseconds
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Info
impl<'de> Deserialize<'de> for Info
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Info
impl RefUnwindSafe for Info
impl Send for Info
impl Sync for Info
impl Unpin for Info
impl UnwindSafe for Info
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