// Copyright (c) Craftwork Games. All rights reserved.
// Licensed under the MIT license.
// See LICENSE file in the project root for full license information.
using MonoGame.Extended.Particles.Data;
namespace MonoGame.Extended.Particles.Modifiers.Interpolators;
///
/// Represents a base class for all particle interpolators.
///
///
/// Interpolators are specialized modifiers that gradually change particle properties
/// based on a normalized time value (between 0.0 and 1.0) over the particle's lifetime.
/// This enables smooth transitions between initial and final states, such as color fades,
/// size changes, or opacity adjustments.
///
public abstract class Interpolator
{
///
/// Gets or sets the display name of this interpolator.
///
public string Name { get; set; }
///
/// Gets or sets a value that indicates if this interpolator is enabled.
///
///
/// This value determines if this interpolator is enabled. When an interpolator is disabled, the interpolator is
/// not applied to the modifier.
///
public bool Enabled { get; set; }
///
/// Initializes a new instance of the class.
///
protected Interpolator()
{
Name = GetType().Name;
Enabled = true;
}
///
/// Updates a single particle property based on the interpolation amount.
///
/// The normalized interpolation amount (from 0.0 to 1.0).
/// A pointer to the particle to update.
///
/// This method is called for each particle during its lifetime. The
/// parameter represents the particle's age as a fraction of its total lifespan.
///
public abstract unsafe void Update(float amount, Particle* particle);
}