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

#pragma once
#include "visualnovel/events/animation/VisualNovelSimpleAnimationEvent.hpp"

namespace Dawn {
  class VisualNovelFadeEvent : public VisualNovelSimpleAnimationEvent<float_t> {
    protected:
      struct Color color;
      bool_t fadeIn;
      float_t duration;

      void onStart(IVisualNovelEvent *previous) override;

    public:
      /**
       * Create a new visual novel event for fading the screen in/out.
       * 
       * @param man Manager that this VN event belongs to.
       * @param color Color to fade to/from.
       * @param fadeIn True to make the color go from 0 to 1 opacity.
       * @param ease Easing function to use.
       * @param duration How long does the fade take.
       */
      VisualNovelFadeEvent(
        VisualNovelManager *man,
        struct Color color,
        bool_t fadeIn,
        easefunction_t *ease,
        float_t duration
      );
  };
}