pub fn apply_event(
        &mut self,
        event: EventBusRequest,
        reactor: &mut EventReactor,
    ) -> EventOutcome {
        // handle all state change requests here
        // (better move specific state operations to state module though)
        match event {
            EventBusRequest::MoveTask { task, to } => self.handle_move_task(task, to),
            EventBusRequest::AssignTask { task, human_id } => self.assign_task(task, human_id),
            EventBusRequest::Tick => self.tick(reactor),
            EventBusRequest::AdvanceTutorial => self.advance_tutorial(),
            EventBusRequest::AddTask(task) => {
                self.add_task(task);
                EventOutcome::Update
            }
            EventBusRequest::NextMonth => self.next_month(),
            _ => EventOutcome::Nothing,
        }
    }
/// Apply the given request to the world state.
///
/// Returns false if the request was invalid.
Apply the given request to the world state.
Returns false if the request was invalid.
Apply the given request to the world state . Returns false if the request was invalid .
pub fn apply_event(
        &mut self,
        event: EventBusRequest,
        reactor: &mut EventReactor,
    ) -> EventOutcome {
        // handle all state change requests here
        // (better move specific state operations to state module though)
        match event {
            EventBusRequest::MoveTask { task, to } => self.handle_move_task(task, to),
            EventBusRequest::AssignTask { task, human_id } => self.assign_task(task, human_id),
            EventBusRequest::Tick => self.tick(reactor),
            EventBusRequest::AdvanceTutorial => self.advance_tutorial(),
            EventBusRequest::AddTask(task) => {
                self.add_task(task);
                EventOutcome::Update
            }
            EventBusRequest::NextMonth => self.next_month(),
            _ => EventOutcome::Nothing,
        }
    }
pub fn apply_event ( & mut self , event : EventBusRequest , reactor : & mut EventReactor , ) -> EventOutcome { // handle all state change requests here // (better move specific state operations to state module though) match event { EventBusRequest :: MoveTask { task , to } => self . handle_move_task ( task , to ) , EventBusRequest :: AssignTask { task , human_id } => self . assign_task ( task , human_id ) , EventBusRequest :: Tick => self . tick ( reactor ) , EventBusRequest :: AdvanceTutorial => self . advance_tutorial ( ) , EventBusRequest :: AddTask ( task ) => { self . add_task ( task ) ; EventOutcome :: Update } EventBusRequest :: NextMonth => self . next_month ( ) , _ => EventOutcome :: Nothing , } }
Apply the given request to the world state.
Apply the given request to the world state .
&mut self
event
EventBusRequest
reactor
&mut EventReactor
&mut self
event
EventBusRequest
reactor
&mut EventReactor