cs162/assignments/assignment1/magic.cpp
/*********************************************************************
 * ** Function: create_fire
 * ** Description: This function creates an array of spells and holds all of the spells under the fire effect
 * ** Parameters: int fires, spell *spell_list_temp, int numb_spells
 * ** Pre-Conditions: user has logged in and begun sorting
 * ** Post-Conditions: adds all fire spells to the fire array
 * *********************************************************************/
create_fire
Description: This function creates an array of spells and holds all of the spells under the fire effect
Parameters: int fires, spell *spell_list_temp, int numb_spells
Pre-Conditions: user has logged in and begun sorting
Post-Conditions: adds all fire spells to the fire array
create_fire Description : This function creates an array of spells and holds all of the spells under the fire effect Parameters : int fires spell * spell_list_temp int numb_spells Pre - Conditions : user has logged in and begun sorting Post - Conditions : adds all fire spells to the fire array
spell * create_fire(int fires, spell *spell_list_temp, int numb_spells) {
	spell *fire = new spell[fires];
	int index2 = 0;
	for(int i = 0; i < numb_spells; i++) {
		if(spell_list_temp[i].effect == "fire") {
			fire[index2] = spell_list_temp[i];
			index2++;
		}
	}
	return fire;
}
spell * create_fire ( int fires , spell * spell_list_temp , int numb_spells ) { spell * fire = new spell [ fires ] ; int index2 = 0 ; for ( int i = 0 ; i < numb_spells ; i ++ ) { if ( spell_list_temp [ i ] . effect == " " ) { fire [ index2 ] = spell_list_temp [ i ] ; index2 ++ ; } } return fire ; }
** Function: create_fire
 ** Description: This function creates an array of spells and holds all of the spells under the fire effect
 ** Parameters: int fires, spell *spell_list_temp, int numb_spells
 ** Pre-Conditions: user has logged in and begun sorting
 ** Post-Conditions: adds all fire spells to the fire array
** Function : create_fire ** Description : This function creates an array of spells and holds all of the spells under the fire effect ** Parameters : int fires spell * spell_list_temp int numb_spells ** Pre - Conditions : user has logged in and begun sorting ** Post - Conditions : adds all fire spells to the fire array