| using System.Collections.Generic;  | 
| using System;  | 
| using LitJson;  | 
| using UnityEngine;  | 
|   | 
|   | 
| public struct Dungeon  | 
| {  | 
|     public int mapId;  | 
|     public int lineId;  | 
|   | 
|     public Dungeon(int _mapId, int _lineId)  | 
|     {  | 
|         this.mapId = _mapId;  | 
|         this.lineId = _lineId;  | 
|     }  | 
|   | 
|     public static bool operator ==(Dungeon _lhs, Dungeon _rhs)  | 
|     {  | 
|         return _lhs.mapId == _rhs.mapId && _lhs.lineId == _rhs.lineId;  | 
|     }  | 
|   | 
|     public static bool operator !=(Dungeon _lhs, Dungeon _rhs)  | 
|     {  | 
|         return _lhs.mapId != _rhs.mapId || _lhs.lineId != _rhs.lineId;  | 
|     }  | 
|   | 
| }  | 
|   | 
| public class DungeonResult  | 
| {  | 
|     public int conWinCnt;  //胜利的场数  | 
|     public int extraExp; //额外的经验加成  | 
|     public int extraExpPoint;//额外的经验点数  | 
|     public int score; //获得积分   | 
|     public int extrScore; //额外获得积分  | 
|   | 
|     public int addScore; //增加的积分,有正负  | 
|     public int updScore; //更新后的积分  | 
|     public int curOrder; // 之前排名  | 
|     public int updOrder; //更新后排名  | 
|   | 
|     public int quickPass; //快速通关  | 
|     public int isSweep;  | 
|     public int dataMapID;  | 
|     public int lineID;  | 
|     public int upPer;  | 
|     public int costTime; //毫秒  | 
|     public int isPass;  | 
|     public int isAssist;  | 
|     public int rank;  | 
|     public int grade;  | 
|     public int gradeExp;  | 
|     public int gradeExpPoint;  | 
|     public int scoreExp;  | 
|     public int scoreExpPoint;  | 
|     public int npcTotal;  | 
|     public int expPoint;  | 
|     public int exp;  | 
|     public DungeonGotMoney[] money;  | 
|     public int runeEssence;  | 
|     public int runeMagicEssence;  | 
|     public ServerItem[] itemInfo;  | 
|     public ServerItem[] succItemInfo;  | 
|     public ServerItem[] AuctionItem;  | 
|     public ServerItem[] firstPassItem;  | 
|     public int[] xianyuanCoin;  | 
|     public int sp;  | 
|     public int startRewardLineID;  | 
|     public int enterLV;  | 
|     public int leaderID;  | 
|     public int wheel;  | 
|     public Dictionary<string, AssistPlayer> helpPlayer;  | 
|     public int memberCnt;  | 
|     public uint ownerID;  | 
|     public string ownerName;  | 
|     public int isWin;  | 
|   | 
|     public long totalExp  | 
|     {  | 
|         get  | 
|         {  | 
|             return (long)((ulong)exp + (ulong)expPoint * Constants.ExpPointValue);  | 
|         }  | 
|     }  | 
|   | 
|     public long extraTotalExp  | 
|     {  | 
|         get { return (long)((ulong)extraExp + (ulong)extraExpPoint * Constants.ExpPointValue); }  | 
|     }  | 
|   | 
|     public long totalScoreExp  | 
|     {  | 
|         get { return (long)((ulong)scoreExp + (ulong)scoreExpPoint * Constants.ExpPointValue); }  | 
|     }  | 
|   | 
|     public long totalGradeExp  | 
|     {  | 
|         get { return (long)((ulong)gradeExp + (ulong)gradeExpPoint * Constants.ExpPointValue); }  | 
|     }  | 
| }  | 
|   | 
|   | 
| public class DungeonMissionData  | 
| {  | 
|     public int lineID;  | 
|     public int missionID;  | 
|     public int step;  | 
|     public int wheel;  | 
|     public int expPoint;  | 
|     public int exp;  | 
|     public int grade;  | 
|     public int npcTotal;  | 
|     public int npcTotalNeed;  | 
|     public int hasCollect;  | 
|     public int passAllCnt;  | 
|     public DungeonNPCInfo[] npc;  | 
|     public DungeonGotMoney[] money;  | 
|     public int score;  | 
|     public int remainHPPer;  | 
|     public int hpReduceSpeed;  | 
|     public int talkOver;  | 
|     public int winCnt;  | 
|     public int KillBOSS;  | 
|     public DungeonHurt[] hurtInfo;  | 
|     public int myHurt;  | 
|     public int myHurtEx;  | 
|     public int myRank;  | 
|     public int myMenberCnt;  | 
|     public string topName;  | 
|     public int topScore;  | 
|     public int isFullExp;  | 
|     public int leaderID;  | 
|     public FairyFeastRank[] familyPartyRank;  | 
|     public FairyFeastTop familyPartyTop;  | 
|     public int topPlayerID;  | 
|     public int enemyID;  | 
|     public int hasSit;  | 
|     public int isHelp;  | 
|     public int helpCount;  | 
|     public int[] relation;   | 
|     public int roundNum;            //跨服1Vs1 当前回合  | 
|     public int[] roundWinerIDList;  //跨服1Vs1 回合胜利的Id列表  | 
|     public int prepareTime;     //跨服1Vs1 回合结束倒计时  | 
|     public int isStart;        //跨服1Vs1回合开始  | 
|     public int PlayerEnterMap; //判断玩家ID不是自己则清除等待时间显示  | 
|     public int IsEncourage;//是否鼓舞  | 
|     public long totalExp  | 
|     {  | 
|         get  | 
|         {  | 
|             return (long)((ulong)exp + (ulong)expPoint * Constants.ExpPointValue);  | 
|         }  | 
|     }  | 
|   | 
|     public long myHurtTotal  | 
|     {  | 
|         get  | 
|         {  | 
|             return (long)((ulong)myHurt + (ulong)myHurtEx * Constants.ExpPointValue);  | 
|         }  | 
|     }  | 
| }  | 
|   | 
| public struct DungeonNPCInfo  | 
| {  | 
|     public int NPCID;  | 
|     public int killCnt;  | 
|     public int HPPer;  | 
| }  | 
|   | 
| public struct DungeonGotMoney  | 
| {  | 
|     public int moneyType;  | 
|     public int moneyValue;  | 
| }  | 
|   | 
| public struct DungeonHurt  | 
| {  | 
|     public string playerName;  | 
|     public int hurt;  | 
|     public int rank;  | 
|     public int hurtEx;  | 
|     public long totalHurt  | 
|     {  | 
|         get  | 
|         {  | 
|             return (long)((ulong)hurt + (ulong)hurtEx * Constants.ExpPointValue);  | 
|         }  | 
|     }  | 
| }  | 
|   | 
| public struct FairyFeastRank  | 
| {  | 
|     public int rank;  | 
|     public string name;  | 
|     public int cnt;  | 
| }  | 
|   | 
| public struct FairyFeastTop  | 
| {  | 
|     public string name;  | 
|     public int cnt;  | 
| }  | 
|   | 
| public struct ServerItem  | 
| {  | 
|     public int ItemID;  | 
|     public int Count;  | 
|     public int IsAuctionItem;  | 
|     public string UserData;  | 
| }  | 
|   | 
| public struct AssistPlayer  | 
| {  | 
|     public string Name;  | 
|     public int LV;  | 
|     public int Job;  | 
|     public int Face;  | 
|     public int FacePic;  | 
|     public int Relation;  | 
|     public int RealmLV;  | 
|     public int FightPower;  | 
| }  | 
|   | 
| public class DungeonRecord  | 
| {  | 
|     public int id { get; private set; }                        //副本id  | 
|     public int enterTimes { get; private set; }        //当日进入次数  | 
|     public int buyTimes { get; private set; }              //当日已购买次数  | 
|     public int extraTimes { get; private set; }           //使用物品增加的额外次数  | 
|     public int recoverTimes { get; private set; }        //找回次数  | 
|     public Dictionary<int, int> lineGrades;             //副本线路对应星级值列表  | 
|     public int enterCntTotal { get; private set; }        //找回次数  | 
|   | 
|     public int passLineID;  | 
|   | 
|     // public DungeonRecord(HA320_tagMCPlayerFBInfoData.tagMCFBInfo _serverInfo)  | 
|     // {  | 
|     //     this.id = (int)_serverInfo.FBID;  | 
|     //     this.enterTimes = (int)_serverInfo.EnterCnt;  | 
|     //     this.recoverTimes = (int)_serverInfo.RecoverCnt;  | 
|     //     this.extraTimes = (int)_serverInfo.ItemAddCnt;  | 
|     //     this.lineGrades = new Dictionary<int, int>();  | 
|     //     this.passLineID = (int)_serverInfo.PassLineID;  | 
|     //     for (int i = 0; i < _serverInfo.PassGrade.Length; i++)  | 
|     //     {  | 
|     //         var tempValue = (int)_serverInfo.PassGrade[i];  | 
|     //         for (int j = 0; j < 9; j++)  | 
|     //         {  | 
|     //             var a = MathUtility.Power(10, j);  | 
|     //             var b = MathUtility.Power(10, j + 1);  | 
|     //             this.lineGrades[i * 9 + j] = (tempValue % b) / a;  | 
|     //         }  | 
|     //     }  | 
|     //     this.enterCntTotal = (int)_serverInfo.EnterCntTotal;  | 
|     // }  | 
|   | 
|     public DungeonRecord(HA3BD_tagMCBuyEnterInfo.tagMCBuyInfo _serverInfo)  | 
|     {  | 
|         this.id = (int)_serverInfo.FBID;  | 
|         this.buyTimes = _serverInfo.BuyCount;  | 
|     }  | 
|   | 
|     // public void UpdateRecord(HA320_tagMCPlayerFBInfoData.tagMCFBInfo _serverInfo)  | 
|     // {  | 
|     //     this.enterTimes = (int)_serverInfo.EnterCnt;  | 
|     //     this.recoverTimes = (int)_serverInfo.RecoverCnt;  | 
|     //     this.extraTimes = (int)_serverInfo.ItemAddCnt;  | 
|     //     this.passLineID = (int)_serverInfo.PassLineID;  | 
|     //     for (int i = 0; i < _serverInfo.PassGrade.Length; i++)  | 
|     //     {  | 
|     //         var tempValue = (int)_serverInfo.PassGrade[i];  | 
|     //         for (int j = 0; j < 9; j++)  | 
|     //         {  | 
|     //             var a = MathUtility.Power(10, j);  | 
|     //             var b = MathUtility.Power(10, j + 1);  | 
|     //             this.lineGrades[i * 9 + j] = (tempValue % b) / a;  | 
|     //         }  | 
|     //     }  | 
|     //     this.enterCntTotal = (int)_serverInfo.EnterCntTotal;  | 
|     // }  | 
|   | 
|     public void UpdateRecord(HA3BD_tagMCBuyEnterInfo.tagMCBuyInfo _serverInfo)  | 
|     {  | 
|         this.buyTimes = _serverInfo.BuyCount;  | 
|     }  | 
|   | 
| }  | 
|   | 
| public class DungeonEnterCoolDown  | 
| {  | 
|     public int mapId;  | 
|     public int level;  | 
|     public int duration;  | 
|     public int clearCoolDownCost;  | 
|     public DateTime endCoolDownTime;  | 
|   | 
|     public void SetEnterTime(uint tick)  | 
|     {  | 
|         endCoolDownTime = TimeUtility.GetTime(tick);  | 
|         endCoolDownTime = endCoolDownTime.AddTicks(duration * TimeSpan.TicksPerSecond);  | 
|     }  | 
|   | 
|     public int suplursSeconds  | 
|     {  | 
|         get  | 
|         {  | 
|             return Mathf.Max(0, (int)(endCoolDownTime - TimeUtility.ServerNow).TotalSeconds);  | 
|         }  | 
|     }  | 
| }  | 
|   | 
| public struct DungeonTarget  | 
| {  | 
|     public DungeonTargetType targetType;  | 
|     public int targetCondition;  | 
|     public int targetValue;  | 
|   | 
|     public DungeonTarget(DungeonTargetType _type, int _condition, int _targetValue)  | 
|     {  | 
|         this.targetType = _type;  | 
|         this.targetCondition = _condition;  | 
|         this.targetValue = _targetValue;  | 
|     }  | 
|   | 
| }  |