using System;

namespace XGame.Framework.Assertions
{
    public class AssertionException : Exception
    {
        string m_UserMessage;

        public AssertionException(string message, string userMessage)
            : base(message)
        {
            m_UserMessage = userMessage;
        }

        public override string Message
        {
            get
            {
                var message = "【XGame Assert】 ";
                if (m_UserMessage != null)
                    message += m_UserMessage;
                message += "\n";
                message += base.Message;
                return message;
            }
        }
    }
}
