pub fn execute(&mut self) -> BattleExecution
	{
		match self.processing
		{
			BattleInputState::Ready =>
			{
				if self.queue.ready()
				{
					let execution = self.execute_command();
					self.processing = BattleInputState::Processing;
					execution
				}
				else
				{
					BattleExecution::Waiting
				}
			}
			BattleInputState::Processing =>
			{
				let execution = self.execute_runner();
				if execution == BattleExecution::Ready
				{
					if self.queue.ready()
					{
						self.execute_command()
					}
					else if let CommandType::Turn = *self.runner.current_command()
					{
						let execution = self.execute_runner();
						if let BattleExecution::Ready = self.execute_runner()
						{
							self.execute_switch()
						}
						else
						{
							execution
						}
					}
					else
					{
						self.runner.command_add(CommandType::Turn);
						self.execute_runner()
					}
				}
				else
				{
					execution
				}
			}
			BattleInputState::Switching =>
			{
				self.execute_switch()
			}
			BattleInputState::Retreat(ref party_member) =>
			{
				BattleExecution::RetreatWaiting(BattlePartyMember
				{
					party: party_member.party,
					member: party_member.member,
				})
			}
		}
	}
/// Executes the next consecutive command effect. Returns the result of the command.
///
/// Execution goes as follows:
/// - Confirm that the queue is still ready to be consumed.
/// - Check if waiting for the user to switch party members.
/// - Run the battle runner.
/// - Allow the queue to be mutated.
///
Executes the next consecutive command effect. Returns the result of the command.
Execution goes as follows:
Confirm that the queue is still ready to be consumed.
Check if waiting for the user to switch party members.
Run the battle runner.
Allow the queue to be mutated.
Executes the next consecutive command effect . Returns the result of the command . Execution goes as follows : Confirm that the queue is still ready to be consumed . Check if waiting for the user to switch party members . Run the battle runner . Allow the queue to be mutated .
pub fn execute(&mut self) -> BattleExecution
	{
		match self.processing
		{
			BattleInputState::Ready =>
			{
				if self.queue.ready()
				{
					let execution = self.execute_command();
					self.processing = BattleInputState::Processing;
					execution
				}
				else
				{
					BattleExecution::Waiting
				}
			}
			BattleInputState::Processing =>
			{
				let execution = self.execute_runner();
				if execution == BattleExecution::Ready
				{
					if self.queue.ready()
					{
						self.execute_command()
					}
					else if let CommandType::Turn = *self.runner.current_command()
					{
						let execution = self.execute_runner();
						if let BattleExecution::Ready = self.execute_runner()
						{
							self.execute_switch()
						}
						else
						{
							execution
						}
					}
					else
					{
						self.runner.command_add(CommandType::Turn);
						self.execute_runner()
					}
				}
				else
				{
					execution
				}
			}
			BattleInputState::Switching =>
			{
				self.execute_switch()
			}
			BattleInputState::Retreat(ref party_member) =>
			{
				BattleExecution::RetreatWaiting(BattlePartyMember
				{
					party: party_member.party,
					member: party_member.member,
				})
			}
		}
	}
pub fn execute ( & mut self ) -> BattleExecution { match self . processing { BattleInputState :: Ready => { if self . queue . ready ( ) { let execution = self . execute_command ( ) ; self . processing = BattleInputState :: Processing ; execution } else { BattleExecution :: Waiting } } BattleInputState :: Processing => { let execution = self . execute_runner ( ) ; if execution == BattleExecution :: Ready { if self . queue . ready ( ) { self . execute_command ( ) } else if let CommandType :: Turn = * self . runner . current_command ( ) { let execution = self . execute_runner ( ) ; if let BattleExecution :: Ready = self . execute_runner ( ) { self . execute_switch ( ) } else { execution } } else { self . runner . command_add ( CommandType :: Turn ) ; self . execute_runner ( ) } } else { execution } } BattleInputState :: Switching => { self . execute_switch ( ) } BattleInputState :: Retreat ( ref party_member ) => { BattleExecution :: RetreatWaiting ( BattlePartyMember { party : party_member . party , member : party_member . member , } ) } } }
Executes the next consecutive command effect.
Executes the next consecutive command effect .
&mut self
&mut self