using System.Collections;
using System.Collections.Generic;
using System.Drawing;

namespace Icarus.Graphics.Animation
{
	public class Frameset
	{
		/**
		 * The list of frames in this frameset.
		 */
		private List<IFrame> m_FrameList;

		/**
		 * Performs some necessary initialization.
		 */
		public Frameset()
		{
			m_FrameList = new List<IFrame>();
		}

		/**
		 * Returns the number of frames in the frameset.
		 */
		public int getFrameCount()
		{
			return m_FrameList.Count;
		}

		/**
		 * Adds a new frame to the frameset and returns the current number of frames in the frameset.
		 */
		public int addFrame(IFrame frame)
		{
			m_FrameList.Add(frame);

			return this.getFrameCount();
		}

		/**
		 * Adds a new frame to the frameset and returns the current number of frames in the frameset.
		 */
		public int addFrame(Bitmap img, Point anchor)
		{
			IFrame new_frame = AnimationFactory.getInstance().makeBlankFrame();
			new_frame.initialize(anchor, img);

			return this.addFrame(new_frame);
		}

		/**
		 * Returns the frame at the specified index.
		 */
		public IFrame getFrameAt(int index)
		{
			return m_FrameList[index];
		}
	}
}
