Exemplo n.º 1
0
    private void UpdateMainArenaDataUI()
    {
        if (mModule == null)
        {
            return;
        }

        mTimer = mModule.GetTimer(mPlayerDataModule.GetArenaLastTime());

        UpdateTimer();

        if (mPlayerDataModule.GetArenaCurRank() == uint.MaxValue)
        {
            mRankingText.text = StringHelper.GetString("arena_outofrank");
        }
        else
        {
            mRankingText.text = (mPlayerDataModule.GetArenaCurRank() + 1).ToString();
        }

        mScoreText.text = mPlayerDataModule.GetArenaScore().ToString();

        mLeftTimesText.text = mPlayerDataModule.GetArenaLeftTimes().ToString() + StringHelper.GetString("times");

        mRankLevelText.text = mModule.GetRankLevelStringByRanking(mPlayerDataModule.GetArenaCurRank());
    }
Exemplo n.º 2
0
    public int GetAwardByIdx(int idx)
    {
        if (mSimpleData == null || mSimpleData.Count <= idx)
        {
            return(0);
        }

        uint curRank = mDataModule.GetArenaCurRank();

        ArenaRandomTableItem  randomRes = null;
        IDictionaryEnumerator itr       = DataManager.ArenaRandomTable.GetEnumerator();

        while (itr.MoveNext())
        {
            ArenaRandomTableItem randomItem = itr.Value as ArenaRandomTableItem;
            if (curRank >= randomItem.mHighestRank)
            {
                randomRes = randomItem;
                break;
            }
        }
//      foreach(ArenaRandomTableItem randomItem in DataManager.ArenaRandomTable.Values)
//      {
//          if(curRank >= randomItem.mHighestRank)
//          {
//              randomRes = randomItem;
//              break;
//          }
//      }

        if (randomRes == null)
        {
            return(0);
        }

        ArenaTableItem arenaRes = null;

        itr = DataManager.ArenaTable.GetEnumerator();
        while (itr.MoveNext())
        {
            ArenaTableItem arenaItem = itr.Value as ArenaTableItem;
            if (curRank >= arenaItem.mHighestRank)
            {
                arenaRes = arenaItem;
                break;
            }
        }
//      foreach(ArenaTableItem arenaItem in DataManager.ArenaTable.Values)
//      {
//          if (curRank >= arenaItem.mHighestRank)
//          {
//              arenaRes = arenaItem;
//              break;
//          }
//      }

        if (arenaRes == null)
        {
            return(0);
        }

        uint againsterRank = mSimpleData[idx].rank;

        if (againsterRank <= curRank + randomRes.mHigherRight)
        {
            return(arenaRes.mMoneyWinHigher);
        }

        if (againsterRank >= curRank + randomRes.mLowerLeft)
        {
            return(arenaRes.mMoneyWinLower);
        }

        return(arenaRes.mMoneyWinSame);
    }