Exemplo n.º 1
0
        /// <summary>
        /// 获取排行榜列表
        /// </summary>
        /// <param name="type"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        public async Task <LatestDocumentResult> GetRankAsync(RankTypeEnum type, RankTimeEnum time)
        {
            string url       = string.Format(ServiceUri.Rank, type, time);
            var    documents = await GetJson <LatestDocumentResult>(url);

            return(documents);
        }
Exemplo n.º 2
0
    public void RadioButtonSelected(RadioGroupView rgView, int position, RadioButtonView rbview)
    {
        AudioHandler.Instance.PlaySound(AudioSoundEnum.ButtonForNormal);
        ClearData();
        rankType = EnumUtil.GetEnum <RankTypeEnum>(rbview.name);
        string rankName = RankTypeEnumTool.GetRankTypeName(rankType);

        //设置本地数据
        SetLocalData();
        //获取排行榜ID
        SteamHandler.Instance.GetLeaderboardId(rankName, this);
    }
Exemplo n.º 3
0
    public long GetScoreByType(RankTypeEnum rankType)
    {
        GameDataBean        gameData        = GameDataHandler.Instance.manager.GetGameData();
        UserAchievementBean userAchievement = gameData.GetAchievementData();
        long score = 0;

        switch (rankType)
        {
        case RankTypeEnum.GetMoneyS:
            score = userAchievement.ownMoneyS;
            break;

        case RankTypeEnum.NumberOrderForFood:
            score = userAchievement.GetNumberForAllCustomerFood();
            break;

        case RankTypeEnum.NumberOrderForHotel:
            score = userAchievement.GetNumberForAllCustomerHotel();
            break;

        case RankTypeEnum.NumberPraiseAnger:
            score = userAchievement.GetPraiseNumber(PraiseTypeEnum.Anger);
            break;

        case RankTypeEnum.NumberPraiseExcited:
            score = userAchievement.GetPraiseNumber(PraiseTypeEnum.Excited);
            break;

        case RankTypeEnum.TimePlay:
            score = gameData.playTime.GetTimeForTotalS();
            break;

        case RankTypeEnum.MaxDayGetMoneyForFoodS:
            score = userAchievement.maxDayGetMoneyS;
            break;

        case RankTypeEnum.MaxDayGetMoneyForHotelS:
            score = userAchievement.maxDayGetMoneyForHotelS;
            break;

        case RankTypeEnum.MaxDayCompleteOrderForFood:
            score = userAchievement.maxDayCompleteOrder;
            break;

        case RankTypeEnum.MaxDayCompleteOrderForHotel:
            score = userAchievement.maxDayCompleteOrderForHotel;
            break;
        }
        return(score);
    }
Exemplo n.º 4
0
    public long GetScoreByType(RankTypeEnum rankType)
    {
        GameDataBean        gameData        = GameDataHandler.Instance.manager.GetGameData();
        UserAchievementBean userAchievement = gameData.GetAchievementData();
        long score = 0;

        switch (rankType)
        {
        case RankTypeEnum.MaxLayer:
            score = userAchievement.maxInfiniteTowersLayer;
            break;
        }
        return(score);
    }
Exemplo n.º 5
0
    public void SetData(RankTypeEnum rankType, SteamLeaderboardEntryBean rankData)
    {
        this.rankType = rankType;
        this.rankData = rankData;

        SetScore(rankType, rankData.score);
        SetRank(rankData.rank);
        string name = TypeConversionUtil.Int32ToString(rankData.details);

        SetName(name);

        //开始获取头像和名字
        if (rankData.steamID.m_SteamID != 0)
        {
            StartCoroutine(SteamHandler.Instance.GetUserInfo(rankData.steamID.m_SteamID + "", this));
        }
    }
Exemplo n.º 6
0
    public void SetScore(RankTypeEnum rankType, int score)
    {
        Sprite spData  = null;
        string dataStr = "";

        switch (rankType)
        {
        case RankTypeEnum.GetMoneyS:
            dataStr = score + TextHandler.Instance.manager.GetTextById(18);
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("ach_money_s_2");
            break;

        case RankTypeEnum.NumberOrderForFood:
            dataStr = score + TextHandler.Instance.manager.GetTextById(82);
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("ach_ordernumber_1");
            break;

        case RankTypeEnum.NumberOrderForHotel:
            dataStr = score + TextHandler.Instance.manager.GetTextById(82);
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("worker_waiter_bed_pro_2");
            break;

        case RankTypeEnum.NumberPraiseExcited:
            dataStr = score + "";
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("ach_accost_1");
            break;

        case RankTypeEnum.NumberPraiseAnger:
            dataStr = score + "";
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("ach_accost_2");
            break;

        case RankTypeEnum.TimePlay:
            TimeBean timeData = new TimeBean();
            timeData.AddTimeForHMS(0, 0, score);
            dataStr = timeData.hour + ":" + timeData.minute + ":" + timeData.second;
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("time_wait_1_0");
            break;

        case RankTypeEnum.MaxDayGetMoneyForFoodS:
            dataStr = score + TextHandler.Instance.manager.GetTextById(18);
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("ach_money_s_2");
            break;

        case RankTypeEnum.MaxDayGetMoneyForHotelS:
            dataStr = score + TextHandler.Instance.manager.GetTextById(18);
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("ach_money_s_2");
            break;

        case RankTypeEnum.MaxDayCompleteOrderForFood:
            dataStr = score + "";
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("ach_ordernumber_1");
            break;

        case RankTypeEnum.MaxDayCompleteOrderForHotel:
            dataStr = score + "";
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("worker_waiter_bed_pro_2");
            break;

        case RankTypeEnum.NumberForGetElementary:
            dataStr = score + "";
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("trophy_1_0");
            break;

        case RankTypeEnum.NumberForGetIntermediate:
            dataStr = score + "";
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("trophy_1_1");
            break;

        case RankTypeEnum.NumberForGetAdvanced:
            dataStr = score + "";
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("trophy_1_2");
            break;

        case RankTypeEnum.NumberForGetLegendary:
            dataStr = score + "";
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("trophy_1_3");
            break;

        case RankTypeEnum.MaxLayer:
            dataStr = score + "";
            spData  = IconDataHandler.Instance.manager.GetIconSpriteByName("infinitetowers_1");
            break;
        }
        if (tvData != null)
        {
            tvData.text = dataStr;
        }
        if (ivData != null)
        {
            ivData.sprite = spData;
        }
    }
Exemplo n.º 7
0
    public static string GetRankTypeName(RankTypeEnum rankType)
    {
        switch (rankType)
        {
        case RankTypeEnum.GetMoneyS:
            return("Get_Money_S");

        case RankTypeEnum.NumberOrderForFood:
            return("Number_Order");

        case RankTypeEnum.NumberOrderForHotel:
            return("Number_Order_Hotel");

        case RankTypeEnum.NumberPraiseExcited:
            return("Number_Praise_Excited");

        case RankTypeEnum.NumberPraiseAnger:
            return("Number_Praise_Anger");

        case RankTypeEnum.TimePlay:
            return("Time_Play");

        case RankTypeEnum.MaxDayGetMoneyForFoodL:
            return("MaxDay_GetMoneyL");

        case RankTypeEnum.MaxDayGetMoneyForFoodM:
            return("MaxDay_GetMoneyM");

        case RankTypeEnum.MaxDayGetMoneyForFoodS:
            return("MaxDay_GetMoneyS");

        case RankTypeEnum.MaxDayGetMoneyForHotelL:
            return("MaxDay_GetMoneyL_Hotel");

        case RankTypeEnum.MaxDayGetMoneyForHotelM:
            return("MaxDay_GetMoneyM_Hotel");

        case RankTypeEnum.MaxDayGetMoneyForHotelS:
            return("MaxDay_GetMoneyS_Hotel");

        case RankTypeEnum.MaxDayCompleteOrderForFood:
            return("MaxDay_CompleteOrder");

        case RankTypeEnum.MaxDayCompleteOrderForHotel:
            return("MaxDay_CompleteOrder_Hotel");

        case RankTypeEnum.NumberForGetElementary:
            return("Number_GetElementary");

        case RankTypeEnum.NumberForGetIntermediate:
            return("Number_GetIntermediate");

        case RankTypeEnum.NumberForGetAdvanced:
            return("Number_GetAdvanced");

        case RankTypeEnum.NumberForGetLegendary:
            return("Number_GetLegendary");

        case RankTypeEnum.MaxLayer:
            return("Max_Layer");
        }
        return("");
    }
Exemplo n.º 8
0
 public void SetRankImage(RankTypeEnum rankTypeEnum)
 {
     RankImage.GetComponent <Image>().sprite = rankSprites[(int)rankTypeEnum];
 }
Exemplo n.º 9
0
        private async Task <List <Document> > LoadRankDataAsync(RankTypeEnum type, RankTimeEnum time)
        {
            var result = await ApiService.Instance.GetRankAsync(type, time);

            return(result?.Data);
        }
Exemplo n.º 10
0
 public RankDataSource(RankTypeEnum type, RankTimeEnum time)
 {
     this._type = type;
     this._time = time;
 }