Neg_Utils/Achievments/AchievmentException.cs

44 lines
1.4 KiB
C#

using JetBrains.Annotations;
using System;
namespace NEG.Utils.Achievments
{
public class AchievmentException : ApplicationException
{
/// <summary>
/// Id of related achievment
/// </summary>
/// <seealso cref="AchievmentTypes.AchievmentData"/>
/// <seealso cref="AchievmentTypes.AchievmentDefinition"/>
public string Id { get; private set; }
public AchievmentException(string message, string achievmentId) : base(message)
{
Id = achievmentId;
}
}
public class AchievmentTypeException : AchievmentException
{
/// <summary>
/// Expected achievment type under <see cref="AchievmentException.Id"/>
/// </summary>
/// <seealso cref="AchievmentTypes.AchievmentData"/>
/// <seealso cref="AchievmentTypes.AchievmentDefinition"/>
public Type Expected { get; private set; }
/// <summary>
/// Actual achievment type under <see cref="AchievmentException.Id"/>
/// </summary>
/// <seealso cref="AchievmentTypes.AchievmentData"/>
/// <seealso cref="AchievmentTypes.AchievmentDefinition"/>
public Type Actual { get; private set; }
public AchievmentTypeException(string message, string achievmentId, Type expectedType, Type actualType) : base(message, achievmentId)
{
Expected = expectedType;
Actual = actualType;
}
}
}