Example #1
0
 public TBattleRecord(List <MatchUser> users, string battleId = null)
 {
     if (users == null || users.Count == 0)
     {
         return;
     }
     BattleId      = string.IsNullOrEmpty(battleId) ? Guid.NewGuid().ToString("N") : battleId;
     BattleVersion = BattleService.BATTLE_VERSION;
     BattleSeed    = BattleService.GenerateSeed();
     BattleType    = users[0].BattleType;
     PlayerList    = users.Select(u => new TBattlePlayer(u)).ToList();
     FrameCount    = -1;
     IsRealTime    = !users.Any(u => u.IsRobot);
     BattleResult  = null;
     SnapShot      = null;
 }
Example #2
0
 public TBattlePlayer(MatchUser user)
 {
     if (user == null)
     {
         return;
     }
     PlayerId      = user.UserId;
     PlayerName    = user.UserName;
     PlayerLevel   = user.CurLevel;
     ServerId      = user.ServerId;
     PlayerSeed    = BattleService.GenerateSeed();
     TowerPool     = user.TowerPool;
     Hero          = user.Hero;
     CriticalScale = user.CriticalScale;
     PlayerFrame   = new TBattlePlayerFrame()
     {
         FrameList = new List <TBattleFrame>()
     };
     PlayerAI = user.PlayerAI;
     FieldId  = user.FieldId;
 }