Design Suggestions

Apr 10, 2013 at 5:21 PM
Edited Apr 10, 2013 at 5:38 PM
I didn't read the previous discussion.It may have been mentioned

[assembly: AssemblyTitle("XNAFinalEngine")]
[assembly: AssemblyProduct("XNAFinalEngine")]
[assembly: AssemblyVersion("")]

public class GameObjectContentManager : Disposable
public void Unload()
        List<GameObject> gameObjectsTemporalList = new List<GameObject>(); 
        foreach (GameObject gameObject in gameObjectsTemporalList)
            //gameObject.ContentManager = null; //This may be redundant

public abstract class GameObject
   protected override void DisposeManagedResources()
        ContentManager = null;  //look here,set null twice
    public void Dispose()
        Dispose(true);// true

    private void Dispose(bool disposing)
        if (!disposed)
            if (disposing)//true,look here
                DisposeManagedResources();//look here
            disposed = true;
IF above is acceptable,
in class GameObject

public GameObjectContentManager ContentManager
        get { return contentManager; }
        internal set   //should switch to private set
            if (contentManager != null)
            contentManager = value;
            if (value != null)
Apr 13, 2013 at 2:23 AM
Edited Apr 16, 2013 at 4:27 AM
Rely ring
GameObject2D --> HudText --> HudElement -->Renderer-->GameObject2D
Shader --> Asset --> AssetContentManager --> Shader

This shows that the abstract level definition is not appropriate.

Ugly if means that propetry Transform should be statemented in base class GameObject.

public abstract class Renderer : Component
if (Owner is GameObject2D)
            ((GameObject2D)Owner).Transform.WorldMatrixChanged += OnWorldMatrixChanged;
            ((GameObject3D)Owner).Transform.WorldMatrixChanged += OnWorldMatrixChanged;

May 10, 2013 at 4:53 PM
Sorry for the delay. I was taking a big and deserved break from the project because of the changes in my life, positive changes by the way, a new work in a another country.

I have fixed the problems in the first post, thank you very much. In a couple of hours I will upload a new commit.
I understand the problem in the second post and I will try to fix it if possible but I am still not sure how to do it.

Sorry again for the delay. Bye. José.