Beispiel #1
0
		private Physics CreatePhysics(ErrorCallback errorCallback = null)
		{
			if (Physics.Instantiated)
				Assert.Fail("Physics is still created");

			if (errorCallback == null)
				errorCallback = _errorLog = new ErrorLog();

			if (_physics != null)
			{
				_physics.Dispose();
				_physics = null;
			}
			if (_foundation != null)
			{
				_foundation.Dispose();
				_foundation = null;
			}

			_foundation = new Foundation(errorCallback);

			_physics = new Physics(_foundation, checkRuntimeFiles: true);

			return _physics;
		}
		public void Dispose()
		{
			if (Foundation != null && !Foundation.Disposed)
				Foundation.Dispose();

			Foundation = null;
			Physics = null;
			Scene = null;
			ErrorOutput = null;
		}
Beispiel #3
0
		private Physics CreatePhysics(ErrorCallback errorCallback = null)
		{
			if (Physics.Instantiated)
				Assert.Fail("Physics is still created");

			if (errorCallback == null)
				errorCallback = _errorLog = new ErrorLog();

			var foundation = new Foundation(errorCallback);

			var physics = new Physics(foundation, checkRuntimeFiles: true);

			return physics;
		}
Beispiel #4
0
		public void CleanUp()
		{
			if (Physics.Instantiated)
				throw new Exception("After a test has run, the Physics singleton should have been disposed");

			ObjectTable.Clear();

			if (_errorLog != null && _errorLog.HasErrors)
			{
				Trace.TraceError("There were errors, check the error log");
			}

			_errorLog = null;
		}
Beispiel #5
0
		protected PhysicsAndSceneTestUnit CreatePhysicsAndScene()
		{
			_errorLog = new ErrorLog();

			var physics = CreatePhysics(_errorLog);

			var scene = physics.CreateScene();

			return new PhysicsAndSceneTestUnit()
			{
				Foundation = physics.Foundation,
				Physics = scene.Physics,
				Scene = scene,
				ErrorOutput = _errorLog
			};
		}