pub(crate) fn process_time(
  state: &mut crate::realm::RealmPuzzleState,
  time: &chrono::DateTime<chrono::Utc>,
  links: &mut std::collections::HashMap<crate::PlayerKey, puzzleverse_core::asset::rules::RealmLink>,
) {
  let mut events = Vec::new();
  for (piece_name, piece) in state.pieces.iter_mut().enumerate() {
    events.extend(piece.tick(time).drain(..).map::<Event, _>(|(name, value)| Event { sender: piece_name, name, value }))
  }
  process(state, links, events.drain(..))
}
/// Update puzzle piece states based on the tick of the clock
Update puzzle piece states based on the tick of the clock
Update puzzle piece states based on the tick of the clock
pub(crate) fn process_time(
  state: &mut crate::realm::RealmPuzzleState,
  time: &chrono::DateTime<chrono::Utc>,
  links: &mut std::collections::HashMap<crate::PlayerKey, puzzleverse_core::asset::rules::RealmLink>,
) {
  let mut events = Vec::new();
  for (piece_name, piece) in state.pieces.iter_mut().enumerate() {
    events.extend(piece.tick(time).drain(..).map::<Event, _>(|(name, value)| Event { sender: piece_name, name, value }))
  }
  process(state, links, events.drain(..))
}
pub ( crate ) fn process_time ( state : & mut crate :: realm :: RealmPuzzleState , time : & chrono :: DateTime < chrono :: Utc > , links : & mut std :: collections :: HashMap < crate :: PlayerKey , puzzleverse_core :: asset :: rules :: RealmLink > , ) { let mut events = Vec :: new ( ) ; for ( piece_name , piece ) in state . pieces . iter_mut ( ) . enumerate ( ) { events . extend ( piece . tick ( time ) . drain ( .. ) . map :: < Event , _ > ( | ( name , value ) | Event { sender : piece_name , name , value } ) ) } process ( state , links , events . drain ( .. ) ) }
Update puzzle piece states based on the tick of the clock
Update puzzle piece states based on the tick of the clock
state
&mut crate::realm::RealmPuzzleState
time
&chrono::DateTime<chrono::Utc>
links
&mut std::collections::HashMap<crate::PlayerKey, puzzleverse_core::asset::rules::RealmLink>
state
&mut crate::realm::RealmPuzzleState
time
&chrono::DateTime<chrono::Utc>
links
&mut std::collections::HashMap<crate::PlayerKey, puzzleverse_core::asset::rules::RealmLink>