public int MiltaryTimeSort(Miltary x, Miltary y) { if (x.Time > y.Time) { return(-1); } else { return(1); } }
public void ShowParticularMilrary(Miltary miltary, RepeatedField <ParticularMiltary> miltarySmallInfos) { Show(); mIdText.text = "No." + miltary.RoomNumber; mTimeText.text = TimeTool.ConvertLongToTimeDesc(miltary.Time); Transform nameParent = mPlayerNameText.transform.parent; nameParent.CreatorChildCount(miltary.PlayerInofs.Count); for (int i = 0; i < miltary.PlayerInofs.Count; i++) { nameParent.GetChild(i).GetComponent <Text>().text = miltary.PlayerInofs[i].Name; } mParticularMiltaryItemGo.transform.parent .CreatorChildAndAddItem <ParticularMiltaryItem, ParticularMiltary>(miltarySmallInfos); }
//存储大局战绩记录 public static async Task SaveTotalMiltary(this FiveStarRoom fiveStarRoom) { //只有房卡才记录 如果一局小局信息都没有 就不用保存大局录像了 if (fiveStarRoom.RoomType != RoomType.RoomCard || fiveStarRoom.ParticularMiltarys.Count == 0) { return; } Miltary miltary = ComponentFactory.Create <Miltary>(); miltary.MiltaryId = FiveStarRoomComponent.Ins.GetMiltaryVideoId(); //大局录像Id miltary.RoomNumber = fiveStarRoom.RoomId; //房号 miltary.FriendCircleId = fiveStarRoom.FriendsCircleId; //所属亲友ID miltary.ToyGameId = ToyGameId.CardFiveStar; //游戏类型 miltary.Time = TimeTool.GetCurrenTimeStamp(); //当前时间 miltary.PlayerInofs = fiveStarRoom.GetMiltaryPlayerInfo(); //玩家信息 for (int i = 0; i < miltary.PlayerInofs.Count; i++) { miltary.PlayerUserIds.Add(miltary.PlayerInofs[i].UserId); } fiveStarRoom.SaveMiltarySmallInfo(miltary.MiltaryId); await FiveStarRoomComponent.Ins.SaveVideo(miltary);//存储大局战绩到数据库 miltary.Dispose(); }