| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- using Game.Config;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Networking;
- public class DownloadDataEntity : GameData<DownloadDataEntity>
- {
- public string FullName;
- public string MD5;
- public ulong Size;
- //public string Version;
- public DownloadTaskState State;
- public Action<DownloadTask> Callback;
- public Action<DownloadTask> UpDateCallback;
- public override string FlieName()
- {
- return "mainfest";
- }
- public override bool SetFields(string fieldname, string value)
- {
- bool ret = base.SetFields(fieldname, value);
- if (!ret)
- {
- switch (fieldname)
- {
- case "FullName":
- {
- FullName = value;
- ret = true;
- }
- ; break;
- case "MD5":
- {
- MD5 = value;
- ret = true;
- }
- ; break;
- case "Size":
- {
- Size = ulong.Parse(value);
- ret = true;
- }
- ; break;
- }
- }
- return ret;
- }
- public override string GetFieldValue(string fieldname)
- {
- string ret = "";
- switch (fieldname)
- {
- case "ID":
- {
- ret = ID.ToString();
- }
- ; break;
- case "FullName":
- {
- ret = FullName;
- }
- ; break;
- case "MD5":
- {
- ret = MD5;
- }
- ; break;
- case "Size":
- {
- ret = Size.ToString();
- }
- ; break;
- }
- return ret;
- }
- public DownloadDataEntity()
- {
- FullName = "";
- MD5 = "";
- Size = 0;
- // Version = "";
- State = DownloadTaskState.None;
- }
- public static void OnCsvLoad(CsvReader csvReader)
- {
- DownloadDataEntity.Onload_SetField(csvReader);
- }
- }
|