Initialize
Last updated
Was this helpful?
Was this helpful?
PositionedObject positionedObjectInstance = new PositionedObject();
SpriteManager.AddPositionedObject(positionedObjectInstance);
// This will clear the PositionedObject's ListsBelongingTo. This means that the PositionedObject will
// no longer know that it belongs to the engine, so it will not be able to remove itself from the engine.
positionedObjectInstance.Initialize();
// This call will not do anything!
SpriteManager.RemovePositionedObject(positionedObjectInstance);
// If you want to test it, try this:
if(SpriteManager.ManagedPositionedObjects.Contains(positionedObjectInstance))
{
throw new Exception("The PositionedObject wasn't removed!");
}