Project Description
Xtengine makes it easier for XNA developers to develop in a compositional manner.
You'll no longer have to write specific game classes with deep hierarchies or hardcode to load levels. It's developed in C# with XNA 4.0, with WP7 in mind.

To use:

Create an instance of ComponentManager, optionally passing in additional Assembly objects that contain component types.
    AssemblyTunnel componentAssemblyTunnel = new AssemblyTunnel();
    Assembly[] componentAssemblies = new Assembly[] { componentAssemblyTunnel.Assembly };

    componentManager = new ComponentManager(componentAssemblies);

Create an interface and class pair for a component, tagging the class with an attribute.
    public enum TypeOfZombie

    public interface IZombieType : IXTengineComponent
        TypeOfZombie Type { get; set; }

    public class ZombieType : XTengineComponentBase, IZombieType
        private TypeOfZombie type;

        void IXTengineComponent.Attach() { }

        void IXTengineComponent.Update() { }

        void IXTengineComponent.Detach() { }

        TypeOfZombie IZombieType.Type
            get { return this.type; }
            set { this.type = value; }

From there you can create entities, add components, and add them to a save-able level.
    Level testLevel = new Level("TestLevel");
    testLevel.Load(componentManager); //if you have previously saved
    XTengineObject testZombie = new XTengineObject();
    IZombieType zombieTypeComponent = testZombie.AddComponent<IZombieType>();
    zombieTypeComponent.Type = TypeOfZombie.Mauled;


Last edited Nov 20, 2010 at 3:11 PM by ColesyM, version 2