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