Main
using System;

namespace Libraries
{
    // Purpose:
    // Base class that handles game objects.  Objects can render, etc.
    public class Obj
    {
        public Obj()
        {
        }

        // Purpose:
        // Render function.  Draw the render object.
        // Make sure the cube.Paint() function is called elsewhere after calling this function.
        public virtual void Render(Sifteo.Cube cube)
        {
        }

        // Purpose:
        // Set the ID that represents the ID.  Can be null to make the object unnamed.
        // ID - ID to use for the object.
        public void SetID(string ID)
        {
            if (null != ID)
                m_ID = (string)ID.Clone();
            else
                m_ID = null;
        }

        // Purpose:
        // Retrive the ID asssociated with the sprite.  The string is the actual ID stored in the sprite, so don't change it unless you really need to.
        // Return:
        // Value is the ID of the obj if it has a ID set, null if not.
        public string GetID()
        {
            return m_ID;
        }

        /// String that represents the sprite.  Value is null if the sprite is unnamed.
        protected string m_ID;
    }
}

 
Website copyright (c) 2012 Benjamin Millek, all rights reserved.