//Loops through all the queued moves and calls a function for each, passing the move and up to 8 pointer arguments to that function.

void move_queue :: loop ( void ( * callback_func ) ( move * , void * , void * , void * , void * , void * , void * , void * , void * ) , void * arg1, void * arg2, void * arg3, void * arg4, void * arg5, void * arg6, void * arg7, void * arg8 )

{

if ( tail == NULL )

cout << "Warning: no data in queue given to loop function! Doing nothing..." << endl ;

else

{

move * temp = tail ;

while ( temp ! = NULL )

{

callback_func ( temp, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 ) ;

temp = temp - > next ;

}

}

}

void move_queue :: loop ( void ( * callback_func ) ( move * , void * , void * , void * , void * , void * , void * , void * ) , void * arg1, void * arg2, void * arg3, void * arg4, void * arg5, void * arg6, void * arg7 )

{

if ( tail == NULL )

cout << "Warning: no data in queue given to loop function! Doing nothing..." << endl ;

else

{

move * temp = tail ;

while ( temp ! = NULL )

{

callback_func ( temp, arg1, arg2, arg3, arg4, arg5, arg6, arg7 ) ;

temp = temp - > next ;

}

}

}

void move_queue :: loop ( void ( * callback_func ) ( move * , void * , void * , void * , void * , void * , void * ) , void * arg1, void * arg2, void * arg3, void * arg4, void * arg5, void * arg6 )

{

if ( tail == NULL )

cout << "Warning: no data in queue given to loop function! Doing nothing..." << endl ;

else

{

move * temp = tail ;

while ( temp ! = NULL )

{

callback_func ( temp, arg1, arg2, arg3, arg4, arg5, arg6 ) ;

temp = temp - > next ;

}

}

}

void move_queue :: loop ( void ( * callback_func ) ( move * , void * , void * , void * , void * , void * ) , void * arg1, void * arg2, void * arg3, void * arg4, void * arg5 )

{

if ( tail == NULL )

cout << "Warning: no data in queue given to loop function! Doing nothing..." << endl ;

else

{

move * temp = tail ;

while ( temp ! = NULL )

{

callback_func ( temp, arg1, arg2, arg3, arg4, arg5 ) ;

temp = temp - > next ;

}

}

}

void move_queue :: loop ( void ( * callback_func ) ( move * , void * , void * , void * , void * ) , void * arg1, void * arg2, void * arg3, void * arg4 )

{

if ( tail == NULL )

cout << "Warning: no data in queue given to loop function! Doing nothing..." << endl ;

else

{

move * temp = tail ;

while ( temp ! = NULL )

{

callback_func ( temp, arg1, arg2, arg3, arg4 ) ;

temp = temp - > next ;

}

}

}

void move_queue :: loop ( void ( * callback_func ) ( move * , void * , void * , void * ) , void * arg1, void * arg2, void * arg3 )

{

if ( tail == NULL )

cout << "Warning: no data in queue given to loop function! Doing nothing..." << endl ;

else

{

move * temp = tail ;

while ( temp ! = NULL )

{

callback_func ( temp, arg1, arg2, arg3 ) ;

temp = temp - > next ;

}

}

}

void move_queue :: loop ( void ( * callback_func ) ( move * , void * , void * ) , void * arg1, void * arg2 )

{

if ( tail == NULL )

cout << "Warning: no data in queue given to loop function! Doing nothing..." << endl ;

else

{

move * temp = tail ;

while ( temp ! = NULL )

{

callback_func ( temp, arg1, arg2 ) ;

temp = temp - > next ;

}

}

}

void move_queue :: loop ( void ( * callback_func ) ( move * , void * ) , void * arg1 )

{

if ( tail == NULL )

cout << "Warning: no data in queue given to loop function! Doing nothing..." << endl ;

else

{

move * temp = tail ;

while ( temp ! = NULL )

{

callback_func ( temp, arg1 ) ;

temp = temp - > next ;

}

}

}

void move_queue :: loop ( void ( * callback_func ) ( move * ) )

{

if ( tail == NULL )

cout << "Warning: no data in queue given to loop function! Doing nothing..." << endl ;

else

{

move * temp = tail ;

while ( temp ! = NULL )

{

callback_func ( temp ) ;

temp = temp - > next ;

}

}