internal void InitBetting(Electrotank.Electroserver5.Api.EsObject eso) { if (panelBetting.gameObject.activeSelf) { panelBetting.HideAllButton(); } ShowPanelJoin(); foreach (PlayerBettingView pv in panelJoin.listBettingPlayer) { if (pv.iconChange.gameObject.activeSelf) { pv.iconChange.gameObject.SetActive(false); } } PlayerBettingView view = panelJoin.listBettingPlayer.Find(lbv => lbv.model.Player.username == eso.getString("userName")); ECardTexture texture = view.GetComponentInChildren <ECardTexture>(); view.model.CardId = eso.getInteger("cardId"); view.model.ETypeLaying = (ETypeLayingBetting)eso.getInteger("gaNgoaiType"); view.model.ChipBetting = eso.getLong("value"); view.SetData(view.model); if (GameManager.Instance.mInfo.username == eso.getString("userName")) { panelJoin.ShowButonJoin(model); } if (eso.getString("userName") != GameManager.Instance.mInfo.username) { view.iconChange.gameObject.SetActive(true); } }
public void ShowCardFullLaying(bool isResult) { int cardid = 0; int x = 0; LocationFullLaying(GameModelChan.game.listFullLaying[0], isResult); LocationFullLaying(GameModelChan.game.listFullLaying[1], isResult); // kiem tra hien thi chiu luc ket thuc game // se toi uu lai sau if (GameModelChan.game.listFullLaying[2] != null) { if (GameModelChan.game.listFullLaying[2].Length == 4) { for (int i = 0; i < GameModelChan.game.listFullLaying[2].Length; i++) { Electrotank.Electroserver5.Api.EsObject obj = GameModelChan.game.listFullLaying[2][i]; cardid = obj.getInteger("id"); } for (int j = 0; j < GameModelChan.game.listFullLaying[2].Length; j++) { Electrotank.Electroserver5.Api.EsObject obj = GameModelChan.game.listFullLaying[2][j]; if (cardid == obj.getInteger("id")) { x++; } } if (x == 4) { LocationFullLayingChiu(GameModelChan.game.listFullLaying[2], isResult); } else { LocationFullLaying(GameModelChan.game.listFullLaying[2], isResult); } } else { LocationFullLaying(GameModelChan.game.listFullLaying[2], isResult); } } }
public ChannelPhom(Electrotank.Electroserver5.Api.EsObject obj) { if (obj.variableExists("zoneId")) { zoneId = obj.getInteger("zoneId"); } if (obj.variableExists("roomId")) { roomId = obj.getInteger("roomId"); } if (obj.variableExists("zoneName")) { zoneName = obj.getString("zoneName"); } if (obj.variableExists("roomName")) { roomName = obj.getString("roomName"); switch (roomName) { case "phom_nghiepdu": this.type = ChannelType.Amateur; break; case "phom_chuyennghiep": this.type = ChannelType.Professional; break; case "phom_caothu": this.type = ChannelType.Experts; break; case "phom_daigia": this.type = ChannelType.Giants; break; default: break; } } if (obj.variableExists("description")) { description = obj.getString("description"); } if (obj.variableExists("maximumPlayers")) { maximumPlayers = obj.getInteger("maximumPlayers"); } if (obj.variableExists("numberUsers")) { numberUsers = obj.getInteger("numberUsers"); } if (obj.variableExists("bettingValues")) { bettingValues = obj.getIntegerArray("bettingValues"); } if (obj.variableExists("minimumMoney")) { minimumMoney = obj.getInteger("minimumMoney"); } if (obj.variableExists("moneyType")) { moneyType = obj.getString("moneyType"); } }
public ChannelChan(Electrotank.Electroserver5.Api.EsObject obj) { if (obj.variableExists("zoneId")) { zoneId = obj.getInteger("zoneId"); } if (obj.variableExists("roomId")) { roomId = obj.getInteger("roomId"); } if (obj.variableExists("zoneName")) { zoneName = obj.getString("zoneName"); } if (obj.variableExists("roomName")) { roomName = obj.getString("roomName"); switch (roomName) { case "chan_nendat": this.type = ChannelType.Amateur; break; case "chan_chieucoi": this.type = ChannelType.Professional; break; case "chan_phango": this.type = ChannelType.Experts; break; case "chan_sapgu": this.type = ChannelType.Giants; break; case "chan_giaidau": this.type = ChannelType.Tournament; break; default: break; } } if (obj.variableExists("description")) { description = obj.getString("description"); } if (obj.variableExists("maximumPlayers")) { maximumPlayers = obj.getInteger("maximumPlayers"); } if (obj.variableExists("numberUsers")) { numberUsers = obj.getInteger("numberUsers"); } if (obj.variableExists("bettingValues")) { bettingValues = obj.getIntegerArray("bettingValues"); } if (obj.variableExists("minimumMoney")) { minimumMoney = obj.getInteger("minimumMoney"); } if (obj.variableExists("playActionTime")) { timePlay = obj.getIntegerArray("playActionTime"); } if (obj.variableExists("moneyType")) { moneyType = obj.getString("moneyType"); } }
public void LocationFullLayingChiu(Electrotank.Electroserver5.Api.EsObject[] list, bool isResult) { int x = 0; int carid = 0; if (list == null || list.Length == 0) { return; } string textValue = ""; int index = 0; if (GameModelChan.game.listFullLaying[2] == list) { index = (GameModelChan.game.listFullLaying[0].Length + GameModelChan.game.listFullLaying[1].Length) / 2; textValue = "Ù"; } List <GameObject> listGameObject = new List <GameObject>(); for (int i = 0; i < list.Length; i++) { Electrotank.Electroserver5.Api.EsObject obj = list[i]; carid = obj.getInteger("id"); if (carid == obj.getInteger("id")) { x++; } ChanCard c = new ChanCard(0, obj.getInteger("id")); c.Instantiate(GameModelChan.game.mPlaymat.locationFullLaying); if (obj.variableExists("cardDraw") && obj.getBoolean("cardDraw")) { c.isDrawFromDeck = true; } Vector3 moveToPosition = GameModelChan.game.mPlaymat.GetLocationFullLayingChiu(index, i); if (isResult) { moveToPosition.x -= 230f; } c.gameObject.transform.localPosition = moveToPosition; if (i % 2 == 1) { index++; } listGameObject.Add(c.gameObject); } int indexCenter = Mathf.FloorToInt(listGameObject.Count / 2) - 1; Vector3 centerObject = new Vector3(listGameObject[indexCenter].transform.localPosition.x, 110f, listGameObject[indexCenter].transform.localPosition.z); if (listGameObject.Count / 2 % 2 == 0) { centerObject.x += 20f; } GameObject objText = (GameObject)GameObject.Instantiate(Resources.Load("Prefabs/LablePrefab")); UILabel text = objText.GetComponent <UILabel>(); objText.transform.parent = GameModelChan.game.mPlaymat.locationFullLaying; objText.transform.localScale = Vector3.one; objText.transform.localPosition = centerObject; text.color = Color.black; text.text = textValue; ListGameObjectFulllaying.Add(objText); ListGameObjectFulllaying.AddRange(listGameObject); }