Option Strict On
Option Explicit On

Namespace Nexamas.UI.Motion

    ''' <summary>
    ''' Snapshot of a timeline at a deterministic point in time. Renderers consume these facts without owning easing math.
    ''' </summary>
    Friend NotInheritable Class MASMotionFrame

        Friend Sub New(elapsedMs As Integer,
                       durationMs As Integer,
                       linearProgress As Single,
                       easedProgress As Single,
                       value As Single,
                       state As MASMotionPlaybackState)
            Me.ElapsedMs = elapsedMs
            Me.DurationMs = durationMs
            Me.LinearProgress = linearProgress
            Me.EasedProgress = easedProgress
            Me.Value = value
            Me.State = state
        End Sub

        Friend ReadOnly Property ElapsedMs As Integer

        Friend ReadOnly Property DurationMs As Integer

        Friend ReadOnly Property LinearProgress As Single

        Friend ReadOnly Property EasedProgress As Single

        Friend ReadOnly Property Value As Single

        Friend ReadOnly Property State As MASMotionPlaybackState

        Friend ReadOnly Property IsComplete As Boolean
            Get
                Return State = MASMotionPlaybackState.Completed OrElse State = MASMotionPlaybackState.Cancelled
            End Get
        End Property

    End Class

End Namespace
