generated from ElnuDev/rust-project
Remove non-blocking events
This commit is contained in:
parent
77bc3b4b09
commit
333dde95f7
2 changed files with 1 additions and 8 deletions
|
@ -21,7 +21,7 @@ impl State {
|
|||
pub fn next(&mut self) -> Option<Event> {
|
||||
while let Some(command) = self.next_command() {
|
||||
let event = command.execute();
|
||||
if event.as_ref().map_or(false, |event| event.is_blocking()) {
|
||||
if let Some(_) = event {
|
||||
return event;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,13 +11,6 @@ pub enum Event {
|
|||
}
|
||||
|
||||
impl Event {
|
||||
pub fn is_blocking(&self) -> bool {
|
||||
use Event::*;
|
||||
match self {
|
||||
Say { .. } => true,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process(mut self, context: &Rc<RefCell<CommandBlock>>) -> Self {
|
||||
use Event::*;
|
||||
match &mut self {
|
||||
|
|
Loading…
Add table
Reference in a new issue