if( type == "i" ) { INT32 data; archive.read( QString( "pv%1" ).arg( i ), data ); PyTuple_SetItem( args, i, PyInt_FromLong( data ) ); }  else if( type == "s" ) { QString data; archive.read( QString( "pv%1" ).arg( i ), data ); PyTuple_SetItem( args, i, PyString_FromString( data.latin1() ) ); } else PyTuple_SetItem( args, i, PyFalse ); } } else if( archive.isWritting() ) { archive.write( "functionname",	functionName ); archive.write( "dispelfunc", dispelFunc_ ); archive.write( "dispelid",	dispelId_ );  archive.write( "pcount", PyTuple_Size( args ) );   for( UINT32 i = 0; i < PyTuple_Size( args ); ++i ) { if( PyInt_Check( PyTuple_GetItem( args, i ) ) ) { archive.write( QString( "pt%1" ).arg( i ), QString( "i" ) ); archive.write( QString( "pv%1" ).arg( i ), (int)PyInt_AsLong( PyTuple_GetItem( args, i ) ) ); } else if( PyString_Check( PyTuple_GetItem( args, i ) ) ) { archive.write( QString( "pt%1" ).arg( i ), QString( "s" ) ); archive.write( QString( "pv%1" ).arg( i ), PyString_AsString( PyTuple_GetItem( args, i ) ) ); }  else archive.write( QString( "pt%1" ).arg( i ), QString( "n" ) ); } }  cTempEffect::Serialize( archive ); }
cTempEffect::Serialize( archive ); }
	void Serialize( ISerialization &archive )	{		if( archive.isReading() )		{			archive.read( "functionname",	functionName );			archive.read( "dispelfunc", dispelFunc_ );			archive.read( "dispelid", dispelId_ );			UINT32 pCount;			QString type;			archive.read( "pcount", pCount );			args = PyTuple_New( pCount );			for( UINT32 i = 0; i < pCount; ++i )			{				archive.read( QString( "pt%1" ).arg( i ), type );				// Read an integer				if( type == "i" )				{					INT32 data;					archive.read( QString( "pv%1" ).arg( i ), data );					PyTuple_SetItem( args, i, PyInt_FromLong( data ) );				}				// Read a string				else if( type == "s" )				{					QString data;					archive.read( QString( "pv%1" ).arg( i ), data );					PyTuple_SetItem( args, i, PyString_FromString( data.latin1() ) );				}				else					PyTuple_SetItem( args, i, PyFalse );			}				}		else if( archive.isWritting() )		{			archive.write( "functionname",	functionName );			archive.write( "dispelfunc", dispelFunc_ );			archive.write( "dispelid",	dispelId_ );			archive.write( "pcount", PyTuple_Size( args ) );			// Serialize the py object			for( UINT32 i = 0; i < PyTuple_Size( args ); ++i )			{				if( PyInt_Check( PyTuple_GetItem( args, i ) ) )				{					archive.write( QString( "pt%1" ).arg( i ), QString( "i" ) );					archive.write( QString( "pv%1" ).arg( i ), (int)PyInt_AsLong( PyTuple_GetItem( args, i ) ) );				}				else if( PyString_Check( PyTuple_GetItem( args, i ) ) )				{					archive.write( QString( "pt%1" ).arg( i ), QString( "s" ) );					archive.write( QString( "pv%1" ).arg( i ), PyString_AsString( PyTuple_GetItem( args, i ) ) );				}				// Something we can't save -> Py_None on load				else					archive.write( QString( "pt%1" ).arg( i ), QString( "n" ) );			}		}		cTempEffect::Serialize( archive );	}