fn battle_prompt_switch(battle: &Battle, active: usize, party: usize, back: bool) -> usize
{
	loop
	{
		terminal::clear();
		display_active(battle, active);
		display_party(&battle.state().parties()[party], back);
		println!("\nChoose a party member to switch to:");
		let member_count = battle.state().parties()[party].member_count();
		let input_count = member_count + if back
		{
			1
		}
		else
		{
			0
		};

		let input = terminal::input_range(input_count) - 1;
		if (!back || input != input_count) && battle.state().parties()[0].member_is_active(input)
		{
			println!("Cannot switch to a member who is already active.");
			terminal::wait();
			continue;
		}
		return input;
	}
}
/// Prompts the user to switch party members and returns the selected member if possible.
///
/// If `back` is true, then the user will be able to select an input equal to the number of party
/// members indicating that the user does not want to switch anymore.
///
Prompts the user to switch party members and returns the selected member if possible.
If `back` is true, then the user will be able to select an input equal to the number of party
members indicating that the user does not want to switch anymore.
Prompts the user to switch party members and returns the selected member if possible . If ` back ` is true then the user will be able to select an input equal to the number of party members indicating that the user does not want to switch anymore .
fn battle_prompt_switch(battle: &Battle, active: usize, party: usize, back: bool) -> usize
{
	loop
	{
		terminal::clear();
		display_active(battle, active);
		display_party(&battle.state().parties()[party], back);
		println!("\nChoose a party member to switch to:");
		let member_count = battle.state().parties()[party].member_count();
		let input_count = member_count + if back
		{
			1
		}
		else
		{
			0
		};
		let input = terminal::input_range(input_count) - 1;
		if (!back || input != input_count) && battle.state().parties()[0].member_is_active(input)
		{
			println!("Cannot switch to a member who is already active.");
			terminal::wait();
			continue;
		}
		return input;
	}
}
fn battle_prompt_switch ( battle : & Battle , active : usize , party : usize , back : bool ) -> usize { loop { terminal :: clear ( ) ; display_active ( battle , active ) ; display_party ( & battle . state ( ) . parties ( ) [ party ] , back ) ; println ! ( " \n " ) ; let member_count = battle . state ( ) . parties ( ) [ party ] . member_count ( ) ; let input_count = member_count + if back { 1 } else { 0 } ; let input = terminal :: input_range ( input_count ) - 1 ; if ( ! back || input != input_count ) && battle . state ( ) . parties ( ) [ 0 ] . member_is_active ( input ) { println ! ( " " ) ; terminal :: wait ( ) ; continue ; } return input ; } }
Prompts the user to switch party members and returns the selected member if possible.
Prompts the user to switch party members and returns the selected member if possible .
battle
&Battle
active
usize
party
usize
back
bool
battle
&Battle
active
usize
party
usize
back
bool