﻿/*----------------------------------------------------------------
            // Copyright © 2014-2016 Air2000
            // 
            // FileName: IScene.cs
			// Describle:
			// Created By:  Wells Hsu
			// Date&Time:  10/3 星期一 17:11:12
            // Modify History:
            //
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace Air2000
{
    public delegate void PostSceneWasReadyDelegate(object level);
    public abstract class Scene<T1, T2> : Theme<T1, T2>, IScene
       where T1 : Scene<T1, T2>
       where T2 : ScenePerformer<T1, T2>
    {
        public event PostSceneWasReadyDelegate PostReady;
        public bool IsReady = false;

        public virtual bool InSceneReady()
        {
            if (CharacterProvider.TaskCount == 0 && ResProvider.TaskCount == 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        public virtual void SceneReady()
        {
            IsReady = true;
            if (PostReady != null)
            {
                PostReady(this);
            }
        }
    }
}
