//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 loyalsoft. All rights reserved.
// Homepage: http://www.game7000.com/
// Feedback: http://www.game7000.com/
//------------------------------------------------------------
namespace GameFramework.Resource
{
///
/// 资源更新成功事件。
///
public sealed class ResourceUpdateSuccessEventArgs : GameFrameworkEventArgs
{
///
/// 初始化资源更新成功事件的新实例。
///
public ResourceUpdateSuccessEventArgs()
{
Name = null;
DownloadPath = null;
DownloadUri = null;
Length = 0;
CompressedLength = 0;
}
///
/// 获取资源名称。
///
public string Name
{
get;
private set;
}
///
/// 获取资源下载后存放路径。
///
public string DownloadPath
{
get;
private set;
}
///
/// 获取下载地址。
///
public string DownloadUri
{
get;
private set;
}
///
/// 获取资源大小。
///
public int Length
{
get;
private set;
}
///
/// 获取压缩后大小。
///
public int CompressedLength
{
get;
private set;
}
///
/// 创建资源更新成功事件。
///
/// 资源名称。
/// 资源下载后存放路径。
/// 资源下载地址。
/// 资源大小。
/// 压缩后大小。
/// 创建的资源更新成功事件。
public static ResourceUpdateSuccessEventArgs Create(string name, string downloadPath, string downloadUri, int length, int compressedLength)
{
ResourceUpdateSuccessEventArgs resourceUpdateSuccessEventArgs = ReferencePool.Acquire();
resourceUpdateSuccessEventArgs.Name = name;
resourceUpdateSuccessEventArgs.DownloadPath = downloadPath;
resourceUpdateSuccessEventArgs.DownloadUri = downloadUri;
resourceUpdateSuccessEventArgs.Length = length;
resourceUpdateSuccessEventArgs.CompressedLength = compressedLength;
return resourceUpdateSuccessEventArgs;
}
///
/// 清理资源更新成功事件。
///
public override void Clear()
{
Name = null;
DownloadPath = null;
DownloadUri = null;
Length = 0;
CompressedLength = 0;
}
}
}