using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using UnityEngine;
using UnityEngine.Networking.Types;

[Serializable]
public class KF3SceneSerializable : SceneSerializable
{
    public List<FrameContent> Frames = new List<FrameContent>();

    public KF3SceneSerializable() { }

    public KF3SceneSerializable(KF3SceneContainer scene)
    {
        this.Version = Application.version;
        this.Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture); ;
        this.Timeline = new TimelineControllerSerializable(TimelineController.Instance);
        this.Frames = scene.Frames.Select(f => new FrameContent(f)).ToList();
        foreach(var obj in scene.AllObjects)
        {
            Objects.Add(obj.Serialize() as KF3ObjectContainerSerializable);
        }
    }
}
