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

namespace Motion6D
{
    public class PositionCollection : Position, IPositionCollection
    {
        #region Fields

        protected List<IPosition> positions = new List<IPosition>();

        #endregion

        #region IPositionCollection Members

        ICollection<IPosition> IPositionCollection.Positions
        {
            get { return positions; }
        }

        #endregion

        #region Overriden Members

        public override IReferenceFrame Parent
        {
            get
            {
                return base.Parent;
            }
            set
            {
                base.Parent = value;
                foreach (IPosition p in positions)
                {
                    p.Parent = value;
                }
            }
        }

        public override void Update()
        {
            base.Update();
            foreach (IPosition p in positions)
            {
                p.Update();
            }
        }

        #endregion
    }
}
