|
|
|
@ -78,7 +78,7 @@ impl CommandContext {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl CommandBlock {
|
|
|
|
|
pub fn next<'a>(&mut self, self_rc: &Rc<RefCell<Self>>) -> Option<CommandContext> {
|
|
|
|
|
pub fn next(&mut self, self_rc: &Rc<RefCell<Self>>) -> Option<CommandContext> {
|
|
|
|
|
let mut next = match self.next {
|
|
|
|
|
Some(next) => next,
|
|
|
|
|
None => return None,
|
|
|
|
@ -98,7 +98,7 @@ impl CommandBlock {
|
|
|
|
|
next += 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
BlockElement::Block(block) => match block.borrow_mut().next(&block) {
|
|
|
|
|
BlockElement::Block(block) => match block.borrow_mut().next(block) {
|
|
|
|
|
Some(context_command) => {
|
|
|
|
|
result = Some(context_command);
|
|
|
|
|
break;
|
|
|
|
@ -133,7 +133,7 @@ impl CommandBlock {
|
|
|
|
|
|
|
|
|
|
pub fn get_root(&self, self_rc: &Rc<RefCell<Self>>) -> Rc<RefCell<Self>> {
|
|
|
|
|
if let Some(parent) = &self.parent {
|
|
|
|
|
parent.borrow().get_root(&parent)
|
|
|
|
|
parent.borrow().get_root(parent)
|
|
|
|
|
} else {
|
|
|
|
|
self_rc.clone()
|
|
|
|
|
}
|
|
|
|
|