public void Refresh(ChanceFixed value) { lb_title.text = value.title; lb_num.text = value.baseNumber.ToString(); if (null != img_pic) { img_pic.Load(value.cardPath); } _selfVo = value; }
/// <summary> /// Tos the fixed chance. 根据数据返回小机会固定资产卡牌 /// </summary> /// <returns>The fixed chance.</returns> /// <param name="value">Value.</param> public static ChanceFixed ToFixedChanceCard(JsonData value) { var cardVo = new ChanceFixed(); cardVo.id = int.Parse(value["id"].ToString()); // kaid of kind cardVo.belongsTo = int.Parse(value["type"].ToString()); //card name cardVo.title = value["name"].ToString(); cardVo.cardPath = value["path"].ToString(); //card infor cardVo.desc = value["instructions"].ToString(); // coefficient cardVo.baseNumber = int.Parse(value["number"].ToString()); // show coast cardVo.coast = value["cost"].ToString(); // price range cardVo.sale = value["sellPrice"].ToString(); // pay cardVo.payment = float.Parse(value["downPayment"].ToString()); // profit show cardVo.profit = value["investmentIncome"].ToString(); //need pay when sale cardVo.mortgage = float.Parse(value["mortgageLoan"].ToString()); // 1 timeScore 2 qualityScore cardVo.scoreType = int.Parse(value["integralType"].ToString()); // socres cardVo.scoreNumber = int.Parse(value["integralNumber"].ToString()); //extend income with card cardVo.income = float.Parse(value["nonLaborIncome"].ToString()); /// <summary> /// The rank score.排名积分 /// </summary> cardVo.rankScore = int.Parse(value["cardIntegral"].ToString()); return(cardVo); }
private void SetFixedData(ChanceFixed go, string imgPath) { if (go.id < 40000) { setTitle(CardTitlePath.Chance_Fixed_Card); } lb_cardname.text = go.title; // lb_desc.text = go.desc; var str = go.desc; var str1 = str.Replace("\\u3000", "\u3000"); var str2 = str1.Replace("\\n", "\n"); lb_desc.text = str2; lb_coastTxt.text = go.coast; lb_saleTxt.text = go.sale; lb_paymentTxt.text = "¥ " + Math.Abs(go.payment); // var tmpProfit = float.Parse(go.profit); var tmpProfit = go.profit; if (tmpProfit == "") { lb_profitNameTxt.SetActiveEx(false); } else { var tmpRate = ""; if (GameModel.GetInstance.isPlayNet == false) { tmpRate = string.Format("{0}%", (float.Parse(tmpProfit) * 100).ToString()); } else { tmpRate = tmpProfit; } lb_profitTxt.text = tmpRate; } lb_mortgageTxt.text = "¥ " + Math.Abs(go.mortgage); lb_incomeTxt.text = "¥ " + Math.Abs(go.income); if (go.mortgage == 0) { lb_mortgageName.SetActiveEx(false); } if (go.income == 0) { lb_incomeNameTxt.SetActiveEx(false); } if (go.scoreNumber == 0) { lb_qualityName.SetActiveEx(false); lb_qualityTxt.SetActiveEx(false); lb_qualityDescTxt.SetActiveEx(false); } else { if (go.scoreType == 2) { lb_qualityName.text = "品质积分: "; lb_qualityDescTxt.text = "品质积分用于进入内圈后乘以10倍"; } else { lb_qualityName.text = "时间积分: "; lb_qualityDescTxt.text = "时间积分用于进入内圈后乘以100倍"; } lb_qualityTxt.text = "" + go.scoreNumber; } if ("" != imgPath) { if (null != _cardPic) { _cardPic.Load(imgPath); } } }
private void _SetWindowData(PlayerInfo player) { _shareList.Clear(); _balanceList.Clear(); _incomeList.Clear(); for (var i = 0; i < player.chanceFixedCardList.Count; i++) { var tmpCard = player.chanceFixedCardList[i]; if (tmpCard.income != 0) { var tmpVo = new InforRecordVo(); tmpVo.index = _incomeList.Count + 1; tmpVo.title = tmpCard.title; tmpVo.num = tmpCard.income; _incomeList.Add(tmpVo); } _balanceList.Add(tmpCard); } for (var i = 0; i < player.opportCardList.Count; i++) { var tmpCard = player.opportCardList[i]; var tmpFixedInfor = new ChanceFixed(); tmpFixedInfor.id = tmpCard.id; tmpFixedInfor.baseNumber = tmpCard.baseNumber; tmpFixedInfor.belongsTo = tmpCard.belongsTo; tmpFixedInfor.cardPath = tmpCard.cardPath; tmpFixedInfor.coast = tmpCard.cost; tmpFixedInfor.desc = tmpCard.desc; tmpFixedInfor.income = tmpCard.income; tmpFixedInfor.mortgage = tmpCard.mortgage; tmpFixedInfor.title = tmpCard.title; tmpFixedInfor.payment = tmpCard.payment; tmpFixedInfor.profit = tmpCard.profit; tmpFixedInfor.sale = tmpCard.sale; tmpFixedInfor.scoreNumber = 0; tmpFixedInfor.scoreType = 2; if (tmpCard.income != 0) { var tmpVo = new InforRecordVo(); tmpVo.index = _incomeList.Count + 1; tmpVo.title = tmpCard.title; tmpVo.num = tmpCard.income; _incomeList.Add(tmpVo); } _balanceList.Add(tmpFixedInfor); } for (var i = 0; i < player.shareCardList.Count; i++) { var tmpCard = player.shareCardList [i]; var tmpFixedInfor = new ChanceFixed(); tmpFixedInfor.title = tmpCard.title; tmpFixedInfor.id = tmpCard.id; tmpFixedInfor.cardPath = tmpCard.cardPath; tmpFixedInfor.baseNumber = tmpCard.shareNum; if (tmpCard.income != 0) { var tmpVo = new InforRecordVo(); tmpVo.index = _incomeList.Count + 1; tmpVo.title = tmpCard.title; tmpVo.num = tmpCard.income; _incomeList.Add(tmpVo); } _shareList.Add(tmpCard); _balanceList.Add(tmpFixedInfor); } if (GameModel.GetInstance.isPlayNet == true) { _incomeList = player.netInforBalanceAndIncome.nonIncomeList; } Console.WriteLine("当前非劳务数据的长度," + _incomeList.Count.ToString()); }