// Copyright (c) 2021 Dominic Masters
// 
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT

#pragma once
#include <dawn/dawn.h>

/**
 * Initializes a timeline back to its default state.
 * 
 * @param timeline Timeline to initialize.
 */
void timelineInit(timeline_t *timeline);

/**
 * Ticks the timeline. This can be done using any delta.
 * 
 * @param timeline Timeline to tick
 * @param delta Delta to tick.
 */
void timelineUpdate(timeline_t *timeline, float delta);

/**
 * Returns true if every action in the timeline has finished.
 * 
 * @param timeline Timeline to check
 * @return True if finished, otherwise false.
 */
bool timelineIsFinished(timeline_t *timeline);

/**
 * Adds an action to the timeline. This will initialize the action callbacks to
 * NULL, you will need to initialize your own callbacks.
 * 
 * @param timeline Timeline to add to.
 * @param start Start time.
 * @param duration Duration time
 * @return Pointer to the timeline action or NULL if the list is full.
 */
timelineaction_t * timelineAddAction(timeline_t *timeline, float start,
  float duration
);