Beispiel #1
0
        public void Refresh(BorrowVo value)
        {
            _lbTitleTxt.text = string.Format("第{0}次贷款:", value.times);
            _lbTitleNum.text = (value.bankborrow + value.cardborrow).ToString();

            var showBank = true;
            var showCard = true;

            if (value.bankborrow > 0)
            {
                _lbBankTitle.SetActiveEx(true);
                _lbBankBorrow.text = value.bankborrow.ToString();
                _lbBankDebt.text   = value.bankdebt.ToString();
                _lbBankRate.text   = value.bankRate;
            }
            else
            {
                _lbBankTitle.SetActiveEx(false);
                showBank = false;
            }

            if (value.cardborrow > 0)
            {
                _lbCardTitle.SetActiveEx(true);
                _lbCardBorrow.text = value.cardborrow.ToString();
                _lbCardDebt.text   = value.carddebt.ToString();
                _lbCardRate.text   = value.cardRate;
            }
            else
            {
                _lbCardTitle.SetActiveEx(false);
                showCard = false;
            }

            if (showBank == false)
            {
                _lbCardTitle.transform.localPosition = new Vector3(_initCardVec3.x, 0, _initCardVec3.z);
            }
            else
            {
                _lbCardTitle.transform.localPosition = _initCardVec3;
            }

            if (showCard == false)
            {
                _lbBankTitle.transform.localPosition = new Vector3(_initBankVec3.x, 0, _initBankVec3.z);
            }
            else
            {
                _lbBankTitle.transform.localPosition = _initBankVec3;
            }
        }
Beispiel #2
0
    /// <summary>
    ///  跟新玩家信息
    /// </summary>
    /// <param name="player"></param>
    /// <param name="dataManager"></param>
    /// <param name="assetsData"></param>
    /// <param name="incomeData"></param>
    /// <param name="debtInfor"></param>
    /// <param name="borrowRecordData"></param>
    /// <param name="borrowBarodInfor"></param>
    public static void UpdatePlayerInfor(PlayerInfo player, JsonData dataManager, JsonData assetsData = null, JsonData incomeData = null, JsonData debtInfor = null, JsonData borrowRecordData = null, JsonData borrowBarodInfor = null)
    {
        if (null != dataManager)
        {
            HandlerPlayerDataInfor(player, dataManager);
        }

        if (null != assetsData)
        {
            HandlerPlayerAssetsInfor(player, assetsData);
        }

        if (null != incomeData)
        {
        }

        if (null != debtInfor)
        {
//			HandlerDebtList (player, debtInfor);
        }

        if (null != borrowRecordData)
        {
            var borrowRecord = borrowRecordData["loanRecords"];
            if (borrowRecord.IsArray)
            {
                player.borrowList.Clear();
                for (var i = 0; i < borrowRecord.Count; i++)
                {
                    var tmpdata = borrowRecord[i];
                    var tmpvo   = new BorrowVo();
                    tmpvo.times      = i + 1;
                    tmpvo.bankborrow = int.Parse(tmpdata["bankLoan"].ToString());
                    tmpvo.bankdebt   = int.Parse(tmpdata["bankInterest"].ToString());
                    tmpvo.bankRate   = tmpdata ["bankInterestRate"].ToString();

                    tmpvo.cardborrow = int.Parse(tmpdata["creditLoan"].ToString());
                    tmpvo.carddebt   = int.Parse(tmpdata["creditInterest"].ToString());
                    tmpvo.cardRate   = tmpdata["creditInterestRate"].ToString();
                    player.borrowList.Add(tmpvo);
                }
            }

            player.netRecordAlreadyBorrow = int.Parse(borrowRecordData["totalLoan"].ToString());
            player.netRecordCanBorrow     = int.Parse(borrowRecordData["canLoan"].ToString());
            player.netRecordLimitBorrow   = int.Parse(borrowRecordData["ceiling"].ToString());
        }

        // 处理还款信息
//		HandlerBorrowInfor(player,borrowBarodInfor);
    }
Beispiel #3
0
        public void BorrowMoney()
        {
            if (null != playerInfor)
            {
                _netBorrowList.Clear();

                if (curborrowBank > 0)
                {
                    if (GameModel.GetInstance.isPlayNet == false)
                    {
                        playerInfor.totalMoney += curborrowBank;
                        playerInfor.bankIncome += curborrowBank;
                        playerInfor.bankLoans  += curbankDebt;
                    }

                    _loanType = 0;
                }

                if (curborrowCard > 0)
                {
                    if (GameModel.GetInstance.isPlayNet == false)
                    {
                        playerInfor.totalMoney   += curborrowCard;
                        playerInfor.creditIncome += curborrowCard;
                        playerInfor.creditDebt   += curcardDebt;
                    }

                    _loanType = 1;
                }

                if (curborrowBank > 0 && curborrowCard > 0)
                {
                    _loanType = 2;
                }


                var controller = UIControllerManager.Instance.GetController <UIBattleController> ();
                controller.SetCashFlow((int)playerInfor.totalMoney, -1, false);

                if (curborrowBank != 0 || curborrowCard != 0)
                {
                    var borrowvo = new BorrowVo();

                    borrowvo.bankborrow = curborrowBank;
                    borrowvo.bankdebt   = curbankDebt;
                    borrowvo.cardborrow = curborrowCard;
                    borrowvo.carddebt   = curcardDebt;
                    borrowvo.times      = playerInfor.borrowList.Count + 1;

                    if (GameModel.GetInstance.isPlayNet == false)
                    {
                        playerInfor.borrowList.Add(borrowvo);
                    }


                    var banktip = "10%";
                    if (playerInfor.isEnterInner == true)
                    {
                        banktip = "1%";
                    }
                    borrowvo.bankRate = banktip;
                    borrowvo.cardRate = "3%";

                    _netBorrowList.Add(borrowvo);

                    if (curborrowBank != 0)
                    {
                        var payback = new PaybackVo();

                        playerInfor.borrowbankTimes++;
                        payback.title  = string.Format("银行贷款{0}:", playerInfor.borrowbankTimes);
                        payback.borrow = curborrowBank;
                        payback.isBank = 1;
                        payback.debt   = curbankDebt;

                        if (GameModel.GetInstance.isPlayNet == false)
                        {
                            playerInfor.paybackList.Add(payback);
                        }
                    }

                    if (curborrowCard != 0)
                    {
                        var payback = new PaybackVo();
                        playerInfor.borrowcardTimes++;
                        payback.title  = string.Format("信用卡透支{0}:", playerInfor.borrowcardTimes);
                        payback.borrow = curborrowCard;
                        payback.debt   = curcardDebt;
                        payback.isBank = 0;

                        if (GameModel.GetInstance.isPlayNet == false)
                        {
                            playerInfor.paybackList.Add(payback);
                        }
                    }


                    curborrowBank = 0;
                    curbankDebt   = 0;
                    curborrowCard = 0;
                    curcardDebt   = 0;
                }

                if (playerInfor.isEnterInner == true)
                {
                    controller.SetNonLaberIncome((int)playerInfor.CurrentIncome, playerInfor.TargetIncome);
                }
                else
                {
                    controller.SetNonLaberIncome((int)playerInfor.totalIncome, (int)playerInfor.MonthPayment);
                }
            }
        }
Beispiel #4
0
    /// <summary>
    ///  更新玩家信息
    /// </summary>
    /// <param name="player"></param>
    /// <param name="dataManager"></param>
    /// <param name="assetsData"></param>
    /// <param name="incomeData"></param>
    /// <param name="debtInfor"></param>
    /// <param name="borrowRecordData"></param>
    /// <param name="borrowBarodInfor"></param>
    public static void UpdatePlayerInfor(PlayerInfo player, JsonData dataManager, JsonData assetsData = null, JsonData incomeData = null, JsonData debtInfor = null, JsonData borrowRecordData = null, JsonData borrowBarodInfor = null)
    {
        if (null != dataManager)
        {
            HandlerPlayerDataInfor(player, dataManager);
//			player.totalMoney = int.Parse (dataManager["cash"].ToString());//现金
//			player.netTotalBalanceMoney = int.Parse (dataManager["assetTotalMoney"].ToString());//资产总额..人物信息
//			player.totalDebt =  int.Parse (dataManager["debtTotalMoney"].ToString());//负债总额 ..人物信息
//
//			player.netTotalPayment = int.Parse (dataManager["totalSpending"].ToString()); //总的支出
//
//			player.netTotalTake = int.Parse (dataManager["totalIncome"].ToString());   //总收入
//
//			player.innerFlowMoney =  int.Parse (dataManager["cashFlow"].ToString());      //内圈流动现金
//
//			player.netCheckDayNum = float.Parse (dataManager["closingDateMoney"].ToString());//结账日的金额
//
//			player.totalIncome  =  int.Parse (dataManager["nonLaborIncome"].ToString());//费劳务收入
//
//			player.netTotalDebtMoney = int.Parse (dataManager["debtTotalMoney"].ToString());
//
//			player.qualityScore = int.Parse (dataManager ["qualityIntegral"].ToString());         //品质积分
//			player.timeScore =  int.Parse (dataManager["timeIntegral"].ToString());  //时间积分
//			player.childNum =  int.Parse (dataManager["haveChildNumber"].ToString());
        }

        if (null != assetsData)
        {
            HandlerPlayerAssetsInfor(player, assetsData);
        }

        if (null != incomeData)
        {
        }

        if (null != debtInfor)
        {
//			HandlerDebtList (player, debtInfor);
        }

        if (null != borrowRecordData)
        {
            var borrowRecord = borrowRecordData["loanRecords"];
            if (borrowRecord.IsArray)
            {
                player.borrowList.Clear();
                for (var i = 0; i < borrowRecord.Count; i++)
                {
                    var tmpdata = borrowRecord[i];
                    var tmpvo   = new BorrowVo();
                    tmpvo.times      = i + 1;
                    tmpvo.bankborrow = int.Parse(tmpdata["bankLoan"].ToString());
                    tmpvo.bankdebt   = int.Parse(tmpdata["bankInterest"].ToString());
                    tmpvo.bankRate   = tmpdata ["bankInterestRate"].ToString();

                    tmpvo.cardborrow = int.Parse(tmpdata["creditLoan"].ToString());
                    tmpvo.carddebt   = int.Parse(tmpdata["creditInterest"].ToString());
                    tmpvo.cardRate   = tmpdata["creditInterestRate"].ToString();
                    player.borrowList.Add(tmpvo);
                }
            }

            player.netRecordAlreadyBorrow = int.Parse(borrowRecordData["totalLoan"].ToString());
            player.netRecordCanBorrow     = int.Parse(borrowRecordData["canLoan"].ToString());
            player.netRecordLimitBorrow   = int.Parse(borrowRecordData["ceiling"].ToString());
        }

        // 处理还款信息
//		HandlerBorrowInfor(player,borrowBarodInfor);
    }
Beispiel #5
0
    /// <summary>
    /// Handlers the borrow infor.处理可以借款的信息
    /// </summary>
    /// <param name="borrowInfor">Borrow infor.</param>
    public static void HandlerBorrowInfor(PlayerInfo player, JsonData borrowBarodInfor = null)
    {
        if (null != borrowBarodInfor)
        {
            /*
             *  "bankCanLoan": 27500,
             * "bankTotalInterest": 0,
             * "bankTotalLoan": 0,
             * "bankLoanLimit": 27500,
             * "creditCanLoan": 8250,
             * "creditLoanLimit": 8250,
             * "creditTotalInterest": 0,
             * "creditTotalLoan": 0,
             * "totalCanLoan": 35750,
             * "totalLoan": 0,
             * "totalLoanLimit": 35750
             */

            var boInfor = borrowBarodInfor["roleLoanInfo"];

            player.netBorrowBoardBankCanBorrow   = int.Parse(boInfor ["bankCanLoan"].ToString());          //: 33700,银行可贷款
            player.netBorrowBoardBankTotalBorrow = int.Parse(boInfor["bankTotalLoan"].ToString());         //: 212,银行累计利息
            player.netBorrowBoradBankTotalDebt   = int.Parse(boInfor["bankTotalInterest"].ToString());     //: 2121,银行累计贷款
            player.netBorrowBoardBankLoanLimit   = int.Parse(boInfor["bankLoanLimit"].ToString());

            player.netBorrowBoardCardCanBorrow   = int.Parse(boInfor["creditCanLoan"].ToString());          //: 10110,信用卡可贷款
            player.netBorrowBoardCardTotalDebt   = int.Parse(boInfor["creditTotalInterest"].ToString());    //: 0,信用卡累计利息
            player.netBorrowBoardCardTotalBorrow = int.Parse(boInfor["creditTotalLoan"].ToString());        //: 信用卡累计贷款
            player.netBorrowBoardCardLoanLimit   = int.Parse(boInfor["creditLoanLimit"].ToString());

            player.netRecordAlreadyBorrow = int.Parse(boInfor["totalLoan"].ToString());
            player.netRecordCanBorrow     = int.Parse(boInfor["totalCanLoan"].ToString());
            player.netRecordLimitBorrow   = int.Parse(boInfor["totalLoanLimit"].ToString());


            if (((IDictionary)borrowBarodInfor).Contains("roleBasicDebtInfo"))
            {
                var basicDebt = borrowBarodInfor["roleBasicDebtInfo"];                //basicLoanList

                if (basicDebt.IsArray)
                {
                    player.basePayList.Clear();

                    if (player.isEnterInner == false)
                    {
                        for (var i = 0; i < basicDebt.Count; i++)
                        {
                            var tmpdata = basicDebt[i];
                            var tmpvo   = new PaybackVo();
                            tmpvo.title   = tmpdata["debtName"].ToString();
                            tmpvo.borrow  = int.Parse(tmpdata["debtMoney"].ToString());
                            tmpvo.debt    = int.Parse(tmpdata["debtInterest"].ToString());
                            tmpvo.netType = 0;
                            player.basePayList.Add(tmpvo);
                        }
                    }
                }
            }

            if (((IDictionary)borrowBarodInfor).Contains("roleAddNewDebtInfo"))
            {
                player.paybackList.Clear();
                var bankloanList = borrowBarodInfor["roleAddNewDebtInfo"];
                if (bankloanList.IsArray)
                {
                    for (var i = 0; i < bankloanList.Count; i++)
                    {
                        var tmpdata = bankloanList[i];
                        var tmpvo   = new PaybackVo();
                        tmpvo.title   = tmpdata["debtName"].ToString();
                        tmpvo.borrow  = int.Parse(tmpdata["debtMoney"].ToString());
                        tmpvo.debt    = int.Parse(tmpdata["debtInterest"].ToString());
                        tmpvo.netType = 1;
                        player.paybackList.Add(tmpvo);
                    }
                }
            }

            if (((IDictionary)borrowBarodInfor).Contains("roleLoanRecordInfo"))
            {
                var baordInfor   = borrowBarodInfor["roleLoanRecordInfo"];
                var borrowRecord = baordInfor["loanRecords"];

                if (borrowRecord.IsArray)
                {
                    player.borrowList.Clear();
                    for (var i = 0; i < borrowRecord.Count; i++)
                    {
                        var tmpdata = borrowRecord[i];
                        var tmpvo   = new BorrowVo();
                        tmpvo.times      = i + 1;
                        tmpvo.bankborrow = int.Parse(tmpdata["bankLoan"].ToString());
                        tmpvo.bankdebt   = int.Parse(tmpdata["bankInterest"].ToString());
                        tmpvo.bankRate   = tmpdata ["bankInterestRate"].ToString();

                        tmpvo.cardborrow = int.Parse(tmpdata["creditLoan"].ToString());
                        tmpvo.carddebt   = int.Parse(tmpdata["creditInterest"].ToString());
                        tmpvo.cardRate   = tmpdata["creditInterestRate"].ToString();
                        player.borrowList.Add(tmpvo);
                    }
                }
            }
        }
    }