Beispiel #1
0
    private void GetMusicGameRankingData(SendRankRes res)
    {
        // res = new SendRankRes()
        // {
        //  MusicId = 1001,
        //  MyRank = 999,
        //  MyRating = 1,
        //  MyScore = 666,
        //  Ret = 1,
        //  Infos = { res.Infos }
        // };
        // for (int i = 0; i < 100 - res.Infos.Count; i++)
        // {
        //  RankInfoPB pb = new RankInfoPB()
        //  {
        //      Ranking = i,
        //      Rating = 8,
        //      Score = Random.Range(0, 2000),
        //      UseIcon = "{\"avatarBox\":60000,\"avatar\":342411}",
        //      UseName = "Name_" + Random.Range(0, 2000),
        //      UserId = 1,
        //  };
        //  res.Infos.Add(pb);
        // }

        _model.InitOpenRanking(res);

        View.SetData(_model.GetCurRankings(), _model.GetMyCurRanking(), _model.GetSongIndexMax());
        LoadingOverlay.Instance.Hide();
    }
Beispiel #2
0
    public MyRankingVO(int myRank, int myRating, SendRankRes res)
    {
        MyRank = myRank;
        if (myRating < 1)
        {
            MyRating = "";
        }
        else
        {
            MyRating = RankingVO.RATINGS[myRating];
        }

        Score = res.MyScore;
        if (myRank != -1)
        {
            IsRank = true;
        }                                            //不等于-1 ,说明上榜了
        if (res.MyScore != -1)
        {
            IsPlay = true;
        }                                                //不等于-1,说明玩过,有分数

        Name = GlobalData.PlayerModel.PlayerVo.UserName;

        IconPath  = GlobalData.DiaryElementModel.GetHeadPath(GlobalData.PlayerModel.PlayerVo.UserOther.Avatar, ElementTypePB.Avatar);
        FramePath = GlobalData.DiaryElementModel.GetHeadPath(GlobalData.PlayerModel.PlayerVo.UserOther.AvatarBox, ElementTypePB.AvatarBox);

        MusicInfoPB musicInfoPb = GlobalData.TrainingRoomModel.GetMusicInfoPbById(res.MusicId);

        MusicName = musicInfoPb?.MusicName;

        MusicCoverPath = "TrainingRoom/cover2/" + res.MusicId;
    }
Beispiel #3
0
    public void InitOpenRanking(SendRankRes res)
    {
        _myRankingVo = new MyRankingVO(res.MyRank, res.MyRating, res);

        _rankings = new List <RankingVO>();

        foreach (var t in res.Infos)
        {
            RankingVO vo = new RankingVO(t);
            _rankings.Add(vo);
        }
    }