namespace XGame.Framework.Asset
{
    internal class AssetAsyncAgent : IAssetAsyncAgent
    {
        public IAssetAsync AssetAsync { get; private set; }

        public AgentStatus Start(IAssetAsync assetAsync)
        {
            //Assert.IsNotNull(assetAsync);
            if (assetAsync == null)
                return AgentStatus.Done;
            assetAsync.Start();
            return assetAsync.IsCompleted ? AgentStatus.Done : AgentStatus.CanResume;
        }

        public void Stop()
        {
            if (AssetAsync != null && AssetAsync.IsCompleted)
            {

            }
            AssetAsync = null;
        }
        public void Dispose()
        {
            AssetAsync = null;
        }
    }
}

