Game Development Community

is it safe to remove persistenceManagerTest.cs?

by Ahsan Muzaheed · in Torque 3D Beginner · 09/01/2011 (7:05 am) · 4 replies

from persistenceManager.cpp,as far i have figure out that persistence Manager works to mark up object,variable etc as dirty.is it right?
is it used only by editor.not by game itself?
what means by dirty?

i have not found any function call from persistenceManagerTest.cs to anywhere.

in scripts of tools folder there is many new persistenceManager:
new PersistenceManager( ETerrainMaterialPersistMan );
new PersistenceManager( PE_EmitterSaver );
new PersistenceManager( PE_ParticleSaver );
new PersistenceManager(matEd_cubemapEdPerMan);
new PersistenceManager(matEd_PersistMan);
new PersistenceManager( GuiEditorProfilesPM );
and many more.
so it seems all editor have their own PersistenceManager.
i have tested by commenting
exec("./persistenceManagerTest.cs");
from core.cs.
have not found any side effect.
so why persistenceManagerTest.cs is needed?
is it safe to remove persistenceManagerTest.cs?

About the author

Torque 3D enthusiastic since 2010.Have been working in several T3D projects besides of Unreal Engine 4 and Unity 3D. NEED a hand with your project? SHoot me a mail. http://www.garagegames.com/community/forums /viewthread/138437/


#1
09/02/2011 (12:37 pm)
Greetings!

From persistenceManager.cpp we have some internal docs:

ConsoleDocClass( PersistenceManager,
				"@brief this class manages updating SimObjects in the file they were "
				"created in non-destructively (mostly aimed at datablocks and materials).\n\n"

				"Basic scripting interface:\n\n"
				"	- Creation: new PersistenceManager(FooManager);\n"
				"	- Flag objects as dirty: FooManager.setDirty(<object name or id>);\n"
				"	- Remove objects from dirty list: FooManager.removeDirty(<object name or id>);\n"
				"	- List all currently dirty objects: FooManager.listDirty();\n"
				"	- Check to see if an object is dirty: FooManager.isDirty(<object name or id>);\n"
				"	- Save dirty objects to their files: FooManager.saveDirty();\n\n"
				"@note Dirty objects don't update their files until saveDirty() is "
				"called so you can change their properties after you flag them as dirty\n\n"
				"@note Currently only used by editors, not intended for actual game development\n\n"
				"@ingroup Console\n"
				"@ingroup Editors\n"
				"@internal");

So yes, you are correct that the persistenceManager is only used for the tools. And as for core/scripts/client/persistenceManagerTest.cs, it looks like that is used to unit test the persistenceManager. So it should be safe to remove it from your project.

- Dave
#2
09/02/2011 (2:42 pm)
ow,thank u very much.i just wanted to sure it.
another unnecessary file will be delete.
#3
09/02/2011 (3:29 pm)
"unit test the persistenceManager" is not clear to me.can u explain a little more about it.or any guide to where i can found some thing more on persistenceManager.in present i am reading old posts on persistenceManager.but those r very hard to understand.if u can manage time then,otherwise no need to spend time.i am just curious to know them.that is not necessary now.


and
can anybody tell be what means by dirty?
and the way it is managed by engine.
#4
09/03/2011 (4:54 am)
dirty is usually a flag set to show that something has changed in that particular system and it needs reloading. I havent studied it in detail, but i'm assuming its part of the T3D system that allows you to change the assets on the fly and see the results as you edit them.

In the editor its used to check if youve made changes and should in theory stop you closing the editor without saving, it also enables the save menu option.