// -----------------------------------------------------------------------
//
// Copyright 2014 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Animation
{
using System;
///
/// Returns a linear for the specified type.
///
///
/// Unfortunately this class is needed as there's no way to create a true generic easing
/// function at compile time, as mathematical operators don't have an interface.
///
public static class LinearEasing
{
///
/// A linear easing function for the specified type.
///
/// The type.
/// An easing function.
public static IEasing For()
{
if (typeof(T) == typeof(double))
{
return (IEasing)new LinearDoubleEasing();
}
else
{
throw new NotSupportedException(string.Format(
"Don't know how to create a LinearEasing for type '{0}'.",
typeof(T).FullName));
}
}
}
}