using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace Thousandto.Update.Xml
{
///
/// 数据模型,
///
public class DataModel
{
//老凡仙用的,服务器ip,用于返回玩家本地ip
public string ServerIp { get; set; }
public string ServerPort { get; set; }
//LSIP
public string LoginIp { get; set; }
public string LoginPort { get; set; }
//执行端下载地址
public string ClientUrl { get; set; }
//基础资源列表
public List VersionModelBaseList { get; set; }
//补丁资源列表
public List VersionModelPatchList { get; set; }
//语言
public string Language { get; set; }
//最新的执行端版本
public string AppVersion { get; set; }
//大版本号
public string BigAppVersion { get; set; }
//小版本号
public string SmallAppVersion { get; set; }
//执行端大小
public string AppSize { get; set; }
//服务器列表,原来的设计,现在不用了
public string ServerList { get; set; }
//最新的补丁版本
public string PatchVersion { get; set; }
//是否使用强制更新,默认为true
public bool EnableForceUpdate { get; set; }
//最新版本的补丁
private VersionModel _LastVersionPatch;
public VersionModel LastVersionPatch
{
get
{
if (_LastVersionPatch == null && VersionModelPatchList.Count > 0)
{
_LastVersionPatch = VersionModelPatchList[VersionModelPatchList.Count - 1];
}
return _LastVersionPatch;
}
}
public DataModel()
{
EnableForceUpdate = true;
VersionModelBaseList = new List();
VersionModelPatchList = new List();
}
//基础资源按照段号排序,从小到大
public void SortBaseVersion()
{
VersionModelPatchList.Sort(compare);
VersionModelBaseList.Sort(compare);
}
private int compare(VersionModel t1, VersionModel t2)
{
return (t1.ToVersion.CompareTo(t2.ToVersion));
}
}
}