using System;

namespace CodeGenerator
{
	public class GraphException : Exception
	{
		public enum GraphExceptionType
		{
			Cicles,
			NoBaseFactors,
			SelfDependentFactor
		}

		private GraphExceptionType typeOfMe;

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="type"></param>
		public GraphException(GraphExceptionType type)
		{
			typeOfMe = type;
		}

		public override string Message
		{
			get
			{
				switch (typeOfMe)
				{
					case GraphExceptionType.Cicles:
						return "There are cicles in the graph";
					case GraphExceptionType.NoBaseFactors:
						return "Some factorsList have no references to base factorsList. They can't be evaluated.";
					case GraphExceptionType.SelfDependentFactor:
						return "There is self-Dependent factor.";
				}
				return base.Message;
			}
		}
	}
}