Request (Resolved) Директива undef

Автор темы #1
Дата рег
19 Фев 2011
Сообщения
197
Симпатии
72
Прошу добавить директиву undef для исключения идентификаторов объявленых через define.
 
Автор темы #3
Дата рег
19 Фев 2011
Сообщения
197
Симпатии
72
?
Код:
// FOS Server
Module Master = null;
 
void ModuleInit()
{
	__EventFinish.Subscribe( OnFinish ); // Некорретная остановка сервера при отсутствии этого ивента.
	@Master = @Module();
}
 
void OnFinish( )
{
	Log( "Finish" );
}
 
# define CONSTRUCT_STR "Construct"
# undef CONSTRUCT_STR
 
class Module
{
	Module( )
	{
		Log( CONSTRUCT_STR );
		OnInit( );
	}
 
	~Module( )
	{
		Log( "Destruct");
	}
 
	void OnInit( )
	{
		__EventGenerateWorld.Subscribe( EventGenerateWorldFunc( @this.OnGenerateWorld ) );
		__EventFinish.Subscribe( EventFinishFunc( @this.OnFinish ) );
		__EventCritterInit.SubscribeToFirstTime( true, EventCritterInitFunc( @this.OnCritterFirstInit ) );
	}
 
	void OnFinish( )
	{
		Log( "ThisFinish" );
		/*__EventGenerateWorld.Unsubscribe( EventGenerateWorldFunc( @this.OnGenerateWorld ) );
		  __EventFinish.Unsubscribe( EventFinishFunc( @this.OnFinish ) );
		  __EventCritterInit.UnsubscribeFromFirstTime( true, EventCritterInitFunc( @this.OnCritterFirstInit ) );
		  @Master = null;*/
	}
 
	void OnGenerateWorld( )
	{
		Log( "this Generated" );
	}
 
	void OnCritterFirstInit( Critter critter, bool firstTime )
	{
		Log( "OnCritterFirstInit");
	}
}
Код:
// FOS Server
Module Master = null;
 
void ModuleInit()
{
	__EventFinish.Subscribe( OnFinish ); // Некорретная остановка сервера при отсутствии этого ивента.
	@Master = @Module();
}
 
void OnFinish( )
{
	Log( "Finish" );
}
 
# define CONSTRUCT_STR
# undef CONSTRUCT_STR
 
class Module
{
# ifdef CONSTRUCT_STR
	Module( )
	{
		Log( "Construct" );
		OnInit( );
	}
# endif
	~Module( )
	{
		Log( "Destruct");
	}
 
	void OnInit( )
	{
		__EventGenerateWorld.Subscribe( EventGenerateWorldFunc( @this.OnGenerateWorld ) );
		__EventFinish.Subscribe( EventFinishFunc( @this.OnFinish ) );
		__EventCritterInit.SubscribeToFirstTime( true, EventCritterInitFunc( @this.OnCritterFirstInit ) );
	}
 
	void OnFinish( )
	{
		Log( "ThisFinish" );
		/*__EventGenerateWorld.Unsubscribe( EventGenerateWorldFunc( @this.OnGenerateWorld ) );
		  __EventFinish.Unsubscribe( EventFinishFunc( @this.OnFinish ) );
		  __EventCritterInit.UnsubscribeFromFirstTime( true, EventCritterInitFunc( @this.OnCritterFirstInit ) );
		  @Master = null;*/
	}
 
	void OnGenerateWorld( )
	{
		Log( "this Generated" );
	}
 
	void OnCritterFirstInit( Critter critter, bool firstTime )
	{
		Log( "OnCritterFirstInit");
	}
}


[00:087] FOnline server, version 809.
[00:088] *** Starting initialization ***
[00:472] Storage : Initialize at 'JSON Storage'.
[00:472] Script system initialization...
[00:495] Reload scripts...
[00:583] Reload scripts complete.
[00:583] Script system initialization complete.
[00:583] Load language packs...
[00:585] Load language packs complete, count 1.
[00:585] Reload client scripts...
[00:589] Reload scripts...
[00:719] Reload scripts complete.
[00:751] Reload client scripts complete.
[00:751] Load dialogs...
[00:754] Load dialogs complete, count 0.
[00:754] Load prototypes...
[00:772] Load prototypes complete, count 17.
[00:773] Load hashes...
[02:259] Load hashes complete.
[02:259] Load deferred calls...
[02:259] Load deferred calls complete, count 0.
[02:259] Test : Construct
[02:259] Generate update files...
[05:200] Generate update files complete.
[05:214] Load entities...
[05:214] Load entities complete.
[05:215] Link maps...
[05:215] Link maps complete.
[05:215] Link npc...
[05:215] Link npc complete.
[05:215] Link items...
[05:215] Link items complete.
[05:215] Init entities after load...
[05:215] Init entities after load complete.
[05:215] Starting server on port 4005 and 4006.
[05:216] *** Starting game loop ***