pub struct SessionPacket { /* private fields */ }
Expand description
Packet containing data about the current session
The session packet provides information about the current session, for example weather and temperature as well as settings like the type of safety car in use.
Implementations§
Source§impl SessionPacket
impl SessionPacket
Sourcepub fn new(
header: Header,
weather: Weather,
track_temperature: i8,
air_temperature: i8,
total_laps: u8,
track_length: u16,
session_type: Session,
track: Track,
formula: Formula,
time_left: Duration,
duration: Duration,
pit_speed_limit: u8,
game_paused: bool,
is_spectating: bool,
spectator_car_index: VehicleIndex,
sli_pro_support: bool,
marshal_zones: Vec<MarshalZone>,
safety_car: SafetyCar,
network_session: bool,
) -> Self
pub fn new( header: Header, weather: Weather, track_temperature: i8, air_temperature: i8, total_laps: u8, track_length: u16, session_type: Session, track: Track, formula: Formula, time_left: Duration, duration: Duration, pit_speed_limit: u8, game_paused: bool, is_spectating: bool, spectator_car_index: VehicleIndex, sli_pro_support: bool, marshal_zones: Vec<MarshalZone>, safety_car: SafetyCar, network_session: bool, ) -> Self
Constructs a new SessionPacket
.
Source§impl SessionPacket
impl SessionPacket
Sourcepub fn track_temperature(&self) -> i8
pub fn track_temperature(&self) -> i8
Returns the track temperature in degrees celsius.
Sourcepub fn air_temperature(&self) -> i8
pub fn air_temperature(&self) -> i8
Returns the air temperature in degrees celsius.
Sourcepub fn total_laps(&self) -> u8
pub fn total_laps(&self) -> u8
Returns the total number of laps in this race.
Sourcepub fn track_length(&self) -> u16
pub fn track_length(&self) -> u16
Returns the length of the race track in metres.
Sourcepub fn session_type(&self) -> Session
pub fn session_type(&self) -> Session
Returns the type of the current session.
Sourcepub fn pit_speed_limit(&self) -> u8
pub fn pit_speed_limit(&self) -> u8
Returns the pit speed limit in kilometers per hour.
Sourcepub fn game_paused(&self) -> bool
pub fn game_paused(&self) -> bool
Returns whether the game is paused right now.
Sourcepub fn is_spectating(&self) -> bool
pub fn is_spectating(&self) -> bool
Returns whether the player is spectating the session.
Sourcepub fn spectator_car_index(&self) -> VehicleIndex
pub fn spectator_car_index(&self) -> VehicleIndex
Returns the index of the car being spectated.
Sourcepub fn sli_pro_support(&self) -> bool
pub fn sli_pro_support(&self) -> bool
Returns whether the support for SLI Pro is active.
Sourcepub fn safety_car(&self) -> SafetyCar
pub fn safety_car(&self) -> SafetyCar
Returns the type of safety car that is used in the session.
Sourcepub fn network_session(&self) -> bool
pub fn network_session(&self) -> bool
Returns whether the session is a multiplayer session.
Source§impl SessionPacket
impl SessionPacket
Sourcepub fn marshal_zones(&self) -> &Vec<MarshalZone>
pub fn marshal_zones(&self) -> &Vec<MarshalZone>
Returns the marshal zones around the track.
Trait Implementations§
Source§impl Clone for SessionPacket
impl Clone for SessionPacket
Source§fn clone(&self) -> SessionPacket
fn clone(&self) -> SessionPacket
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more