#include "iostream"
using namespace std;

#include "Media.H"


int main()
	{
	Media med;
	int inp(0);
	while(inp<99){
	med.UpdateList();
//loop on all media
	cout<<"===========================all media=========================="<<endl;
	for(unsigned int i=0; i<med.GetMedia().size(); i++)
		{
		cout<<med.GetMedia()[i].GetName()<<" "<<med.GetMedia()[i].GetMountPoint()<<endl;
		}
	cout<<"====================mountable========================"<<endl;
	for(unsigned int i=0; i<med.GetMountableMedia().size(); i++)
		{
		cout<<i<<": "<<med.GetMountableMedia()[i].GetMountPoint()<<endl;
		}
	cout<<"====================unmountable========================"<<endl;
	for(unsigned int i=0; i<med.GetUnMountableMedia().size(); i++)
		{
		cout<<i + med.GetMountableMedia().size()<<": "<<med.GetUnMountableMedia()[i].GetMountPoint()<<endl;
		}
	cout<<endl;
	cout<<">"<<flush;
	cin>>inp;
	int index;
	if(inp>=med.GetMountableMedia().size())
		{
		index=inp-med.GetMountableMedia().size();
		if(index>=static_cast<int>(med.GetUnMountableMedia().size())) break;
		med.GetUnMountableMedia()[index].UnMount();
		continue;
		}
	med.GetMountableMedia()[inp].Mount();	
	}
	}
