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

[Serializable]
public class SceneSerializable
{
    public string GUID;
    public string Version;
    public string Date;
    public string Filename;
    public TimelineControllerSerializable Timeline;
    public List<ObjectContainerSerializable> Objects = new List<ObjectContainerSerializable>();

    public SceneSerializable() { }

    public SceneSerializable(SceneContainer scene)
    {
        this.Version = Application.version;
        this.Date = DateTime.Now.ToString("yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture); ;
        this.Timeline = new TimelineControllerSerializable(TimelineController.Instance);
        foreach (var obj in scene.AllObjects)
        {
            Objects.Add(obj.Serialize());
        }
    }
}
