public void FillPlayerCard(PlayerCardInfo pi) { // General avatar.sprite = pi.Avatar; genderAndAgeField.text = $"{pi.Gender}, {HelpUtilities.GetYearsString(pi.Age)}"; jobField.text = pi.Job; // Body field heightField.text = pi.Body.height.ToString(); weightField.text = pi.Body.weight.ToString(); bmiField.text = pi.Body.bmi.ToString("0.00"); overallField.text = pi.Body.overall; // Additional info childField.text = pi.IsChildfree ? "Childfree" : "Не Childfree"; healthField.text = pi.Health; characterField.text = pi.Character; phobiaField.text = pi.Phobia; hobbyField.text = pi.Hobby; infoField.text = pi.Info; inventoryField.text = pi.Inventory; // Specials firstSpecialField.text = pi.FirstSpecial; secondSpecialField.text = pi.SecondSpecial; }
public static PlayerCardInfo GeneratePlayerCard() { PlayerCardInfo p = new PlayerCardInfo(); p.Job = GenerateJob(); p.Age = Random.Range(18, 80); p.Body = new BodyInfo(Random.Range(150, 200), Random.Range(40, 140)); p.Gender = Random.Range(0, 100) > 50 ? "Женщина" : "Мужчина"; p.Avatar = p.Gender == "Мужчина" ? menAvatars[Random.Range(0, menAvatars.Count)] : womenAvatars[Random.Range(0, womenAvatars.Count)]; p.IsChildfree = Random.Range(0, 100) > 50 ? true : false; p.Health = GenerateHealth(); p.Character = GenerateCharacter(); p.Phobia = GeneratePhobia(); p.Hobby = GenerateHobby(); p.Info = GenerateInfo(); p.Inventory = GenerateInventory(); p.FirstSpecial = GenerateSpecial(); p.SecondSpecial = GenerateSpecial(); return(p); }
public void FillShortcard(PlayerCardInfo info, int playerNumber) { playerInfo = info; playerName.text = $"Игрок №{playerNumber}"; }
public ReconnectionData(Hashtable data) { ArrayList otherPlayerCard; ArrayList cardList;; Hashtable OnterInfo; HupaiPlayerInfo hupInfo; isHu = false; hupaiPlayerInfoList = new List <HupaiPlayerInfo>(); if (data.ContainsKey("play_card_player")) { playCardPlayerSeat = (Int64)data["play_card_player"]; processer_card = (Int64)data["play_card"]; } gangPaiInfo = data["gang_state"] as Hashtable; if (data.ContainsKey("is_hu")) { if ((bool)data["is_hu"]) { isHu = true; hupaiPlayerSeat = (Int64)data["hu_player"]; hupaiCardList = (ArrayList)data["hu_card"]; otherPlayerCard = (ArrayList)data["other_card"]; hupInfo = new HupaiPlayerInfo(); hupInfo.playerSeat = hupaiPlayerSeat; for (int j = 0; j < hupaiCardList.Count; j++) { hupInfo.cardList.Add((Int64)hupaiCardList[j]); } hupaiPlayerInfoList.Add(hupInfo); for (int i = 0; i < otherPlayerCard.Count; i++) { hupInfo = new HupaiPlayerInfo(); OnterInfo = (Hashtable)otherPlayerCard[i]; hupInfo.playerSeat = (Int64)OnterInfo["player"]; cardList = (ArrayList)OnterInfo["pai"]; for (int j = 0; j < cardList.Count; j++) { hupInfo.cardList.Add((Int64)cardList[j]); } hupaiPlayerInfoList.Add(hupInfo); } } } bankerID = (Int64)data["zhuang"]; cardCount = (Int64)data["cards_count"]; dice = (Int64)data["r_saizi"]; laizi = (Int64)data["laizi"]; score = (Int64)data["score"]; payState = (Int64)data["payRule"]; times = (Int64)data["times"]; if (data.ContainsKey("card_righter")) { cardRighter = (Int64)data["card_righter"]; } // processer = (Int64)data["processer"]; play_count = (Int64)data["play_count"]; peopleNum = (Int64)data["peopleNum"]; Hashtable playout = data["player_play_cards"] as Hashtable; Hashtable pengcard = data["player_peng"] as Hashtable; Hashtable gangCard = data["player_gang"] as Hashtable; playerCardNum = (Hashtable)data["playerCardNum"]; PlayerCardInfo info; string index; playerCardinfoList = new List <PlayerCardInfo>(); for (int i = 1; i < peopleNum + 1; i++) { index = i.ToString(); info = new PlayerCardInfo(); info.playOutArr = playout[index] as ArrayList; info.pengArr = pengcard[index] as ArrayList; info.GangArr = gangCard[index] as ArrayList; info.handCardNum = (Int64)playerCardNum[index]; playerCardinfoList.Add(info); } if (true) { isLiuJu = true; } }