using System;
using System.Collections.Generic;
using System.Text;

namespace CategoryTheory
{
    /// <summary>
    /// Wrapper of category object
    /// </summary>
    public class CategoryObjectWrapper : ICategoryObject
    {
        #region Fields

        /// <summary>
        /// The internal object
        /// </summary>
        protected ICategoryObject theObject;

        /// <summary>
        /// The associated object;
        /// </summary>
        object obj;
        #endregion

        #region ICategoryObject Members

        public ICategory Category
        {
            get { return theObject.Category; }
        }

        public ICategoryArrow Id
        {
            get { return theObject.Id; }
        }

        #endregion

        #region IAssociatedObject Members

        public object Object
        {
            get
            {
                return obj;
            }
            set
            {
                obj = value;
                if (theObject != null)
                {
                    theObject.Object = value;
                }
            }
        }

        #endregion 

        #region Specific Members

        /// <summary>
        /// The internal object
        /// </summary>
        public ICategoryObject TheObject
        {
            get
            {
                return theObject;
            }
        }

        #endregion
    }
}
