public void AddQualityScoreInfor(InforRecordVo value) { var index = qualityScoreList.Count + 1; value.index = index; qualityScoreList.Add(value); }
public void AddInnerFlowInfor(InforRecordVo value) { var index = flowScoreList.Count + 1; value.index = index; flowScoreList.Add(value); }
public void AddTimeScoreInfor(InforRecordVo value) { var index = timeScoreList.Count + 1; value.index = index; timeScoreList.Add(value); }
/// <summary> /// Handlers the balance and income data. 处理资产和费劳务收入的信息 /// </summary> /// <param name="model">Model.</param> private void HandlerBalanceAndIncomeData(SocketModel model) { /* * "body": { * "data": { * "roleHaveAssetInfo": { * "assetTotalMoney": 0, * "bigChances": [], * "smallChances": [ * { * "cardIntegral": 7, * "cost": "65000", * "downPayment": -5000, * "id": 20001, * "instructions": "\\u3000\\u3000政府查封的房产中有优质的3室2厅的居室出售。房产维护良好,租户稳定。可以自己接受这笔生意,也可以卖给其他玩家。", * "integralNumber": 1, * "integralType": 2, * "investmentIncome": "67%", * "mortgageLoan": -60000, * "name": "待售公寓3室2厅", * "nonLaborIncome": 280, * "number": 1, * "path": "share/atlas/battle/card/fixedcard1/card_d_34.ab", * "sellPrice": "65000-150000", * "type": 1 * } * ], * "stocks": [] * }, * "roleIncomeInfo": { * "laborIncome": { * "money": 2000, * "name": "工资" * }, * "nonLaborIncomeList": [], * "totalIncome": 0, * "totalNonLaborIncome": 0 * } * }, * "status": 0 * }, * "header": { * "attachment": {}, * "playerId": "ddac7397-c73e-44a1-ba71-13130cacd947", * "type": 6003 * }*/ var backMessage = JsonMapper.ToObject(model.message); var backbody = backMessage["body"]; var backhead = backMessage["header"]; // playerid , type6001 var stat1 = int.Parse(backbody["status"].ToString()); // 返回的状态 0 var playerId = backhead["playerId"].ToString(); //玩家的id if (stat1 == 0) { playerId = backbody ["data"] ["targetPlayerId"].ToString(); var player = PlayerManager.Instance.GetPlayerInfo(playerId); var balanceInfor = backbody ["data"] ["roleHaveAssetInfo"]; var bigChanceList = balanceInfor["bigChances"]; if (bigChanceList.IsArray) { player.opportCardList.Clear(); for (var i = 0; i < bigChanceList.Count; i++) { var tmpbigData = bigChanceList [i]; if (((IDictionary)tmpbigData).Contains("id") == true) { var bigcard = HandlerJsonToCardVo.ToOpportunityCard(tmpbigData); player.opportCardList.Add(bigcard); } } } var smallFixedList = balanceInfor["smallChances"]; if (smallFixedList.IsArray) { player.chanceFixedCardList.Clear(); for (var i = 0; i < smallFixedList.Count; i++) { var tmpbigData = smallFixedList [i]; if (((IDictionary)tmpbigData).Contains("id") == true) { var fixedcard = HandlerJsonToCardVo.ToFixedChanceCard(tmpbigData); player.chanceFixedCardList.Add(fixedcard); } } } var chanceShareList = balanceInfor["stocks"]; if (chanceShareList.IsArray) { player.shareCardList.Clear(); for (var i = 0; i < chanceShareList.Count; i++) { var chanceData = chanceShareList[i]; if (((IDictionary)chanceData).Contains("id") == true) { var chanceCard = HandlerJsonToCardVo.ToChanceSharesCard(chanceData); player.shareCardList.Add(chanceCard); } } } var incomeInfor = backbody["data"]["roleIncomeInfo"]; player.netInforBalanceAndIncome.laborTxt = incomeInfor["laborIncome"]["name"].ToString(); player.netInforBalanceAndIncome.laoorMoney = int.Parse(incomeInfor["laborIncome"]["money"].ToString()); player.netInforBalanceAndIncome.totalIncome = float.Parse(incomeInfor["totalIncome"].ToString()); player.netInforBalanceAndIncome.totalNonLaborIncome = float.Parse(incomeInfor["totalNonLaborIncome"].ToString()); var nonIncomeList = incomeInfor ["nonLaborIncomeList"]; if (nonIncomeList.IsArray) { player.netInforBalanceAndIncome.nonIncomeList.Clear(); for (var i = 0; i < nonIncomeList.Count; i++) { var tmpData = nonIncomeList[i]; var recordVo = new InforRecordVo(); recordVo.index = i + 1; recordVo.title = tmpData ["name"].ToString(); recordVo.num = float.Parse(tmpData["money"].ToString()); player.netInforBalanceAndIncome.nonIncomeList.Add(recordVo); } } GameModel.GetInstance.hasLoadBalanceAndIncome = true; var totalInfor = UIControllerManager.Instance.GetController <UITotalInforWindowController> (); totalInfor.NetShowBalanceAndIncomeBaord(); } }
/// <summary> /// Handlers the player target data.处理获取目标信息 /// </summary> /// <param name="model">Model.</param> private void HandlerPlayerTargetData(SocketModel model) { var backMessage = JsonMapper.ToObject(model.message); var backbody = backMessage["body"]; var backhead = backMessage["header"]; // playerid , type6001 var stat1 = int.Parse(backbody["status"].ToString()); // 返回的状态 0 var playerId = backhead["playerId"].ToString(); //玩家的id if (stat1 == 0) { var data = backbody["data"]["integralRecord"]; playerId = backbody ["data"] ["targetPlayerId"].ToString(); var player = PlayerManager.Instance.GetPlayerInfo(playerId); player.netTargetTimeScore = int.Parse(data["timeTotalIntegral"].ToString()); player.netTargetQualityScore = int.Parse(data["qualityTotalIntegral"].ToString()); if (((IDictionary)data).Contains("flowCashTotalIntegral")) { player.netTargetCashFlowScore = int.Parse(data["flowCashTotalIntegral"].ToString()); var cashFlowScoreList = data["flowCashIntegral"]; if (cashFlowScoreList.IsArray) { player.flowScoreList.Clear(); for (var i = 0; i < cashFlowScoreList.Count; i++) { var inforRecordVo = new InforRecordVo(); var tmpData = cashFlowScoreList[i]; inforRecordVo.index = i + 1; inforRecordVo.title = tmpData ["name"].ToString(); inforRecordVo.num = float.Parse(tmpData ["integral"].ToString()); player.flowScoreList.Add(inforRecordVo); } } } var timeScoreList = data["timeIntegral"]; if (timeScoreList.IsArray) { player.timeScoreList.Clear(); for (var i = 0; i < timeScoreList.Count; i++) { var inforRecordVo = new InforRecordVo(); var tmpData = timeScoreList[i]; inforRecordVo.index = i + 1; inforRecordVo.title = tmpData ["name"].ToString(); inforRecordVo.num = float.Parse(tmpData ["integral"].ToString()); player.timeScoreList.Add(inforRecordVo); } } var qualityScoreList = data["qualityIntegral"]; if (qualityScoreList.IsArray) { player.qualityScoreList.Clear(); for (var i = 0; i < qualityScoreList.Count; i++) { var inforRecordVo = new InforRecordVo(); var tmpData = qualityScoreList[i]; inforRecordVo.index = i + 1; inforRecordVo.title = tmpData ["name"].ToString(); inforRecordVo.num = float.Parse(tmpData ["integral"].ToString()); player.qualityScoreList.Add(inforRecordVo); } } GameModel.GetInstance.hasLoadTarget = true; var _totalInforController = UIControllerManager.Instance.GetController <UITotalInforWindowController> (); _totalInforController.NetShowTargetBoard(); } }