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