private void OnGetGangFightBattleResult(short state, GangFightBattleResult down = null)
 {
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     this.gangFightBattleResult = down;
     if (!down.forceExist)
     {
         GangFightInstance.Instance.GetInstanceResult(down);
     }
 }
    public void RefreshUI(GangFightBattleResult gfbr)
    {
        if (gfbr == null)
        {
            return;
        }
        this.ImageWinsDefeatRight.get_gameObject().SetActive(false);
        this.ImageWinsDefeatLeft.get_gameObject().SetActive(false);
        this.TextAllLose.get_gameObject().SetActive(false);
        AvatarModel avatarModel = DataReader <AvatarModel> .Get(EntityWorld.Instance.EntSelf.FixModelID);

        if (avatarModel != null)
        {
            ResourceManager.SetSprite(this.ImageHeadLeft, GameDataUtils.GetIcon(avatarModel.pic));
        }
        AvatarModel avatarModel2 = DataReader <AvatarModel> .Get(GangFightManager.Instance.gangFightMatchRoleSummary.modelId);

        if (avatarModel2 != null)
        {
            ResourceManager.SetSprite(this.ImageHeadRight, GameDataUtils.GetIcon(avatarModel2.pic));
        }
        this.SetRewardItems(gfbr.reward, gfbr.rewardExt);
        if (gfbr.winnerId == 0L)
        {
            this.ShowLoseUIs();
            this.TextNameLeft.set_text(EntityWorld.Instance.EntSelf.Name);
            this.TextNumLeft.set_text(gfbr.fromCurrCombatWinCount + GameDataUtils.GetChineseContent(510108, false));
            this.TextNumRight.set_text(gfbr.toCurrCombatWinCount + GameDataUtils.GetChineseContent(510108, false));
            this.TextNameRight.set_text(gfbr.toName);
            if (gfbr.fromLastCombatWinCount > 1)
            {
                this.ImageWinsDefeatLeft.get_gameObject().SetActive(true);
            }
            if (gfbr.toLastCombatWinCount > 1)
            {
                this.ImageWinsDefeatRight.get_gameObject().SetActive(true);
            }
            this.ImageDefeatLeft.get_gameObject().SetActive(false);
            this.ImageDefeatRight.get_gameObject().SetActive(false);
            this.TextAllLose.get_gameObject().SetActive(true);
            this.TextSelfLose.get_gameObject().SetActive(false);
        }
        else
        {
            bool flag = false;
            if (gfbr.winnerId == EntityWorld.Instance.EntSelf.ID)
            {
                flag = true;
            }
            if (flag)
            {
                this.ShowWinUIs();
                this.ImageDefeatLeft.get_gameObject().SetActive(false);
                this.ImageDefeatRight.get_gameObject().SetActive(true);
                this.TextNameLeft.set_text(EntityWorld.Instance.EntSelf.Name);
                this.TextNumLeft.set_text(gfbr.fromCurrCombatWinCount + GameDataUtils.GetChineseContent(510108, false));
                this.TextNumRight.set_text(gfbr.toCurrCombatWinCount + GameDataUtils.GetChineseContent(510108, false));
                this.TextNameRight.set_text(gfbr.toName);
                if (gfbr.toLastCombatWinCount > 1)
                {
                    this.ImageWinsDefeatRight.get_gameObject().SetActive(true);
                }
            }
            else
            {
                this.ShowLoseUIs();
                this.TextAllLose.get_gameObject().SetActive(false);
                this.TextSelfLose.get_gameObject().SetActive(true);
                this.ImageDefeatLeft.get_gameObject().SetActive(true);
                this.ImageDefeatRight.get_gameObject().SetActive(false);
                this.TextNameLeft.set_text(EntityWorld.Instance.EntSelf.Name);
                this.TextNumLeft.set_text(gfbr.fromCurrCombatWinCount + GameDataUtils.GetChineseContent(510108, false));
                this.TextNumRight.set_text(gfbr.toCurrCombatWinCount + GameDataUtils.GetChineseContent(510108, false));
                this.TextNameRight.set_text(gfbr.toName);
                if (gfbr.fromLastCombatWinCount > 1)
                {
                    this.ImageWinsDefeatLeft.get_gameObject().SetActive(true);
                }
            }
        }
    }