public void SetWinCountInfo(GameInfomation gameInfomation) { if (gameInfomation.MyWinCount == 0) { MyCrownLeft.SetActive(false); MyCrownRight.SetActive(false); } if (gameInfomation.MyWinCount == 1) { MyCrownLeft.SetActive(true); MyCrownRight.SetActive(false); } if (gameInfomation.MyWinCount == 2) { MyCrownLeft.SetActive(true); MyCrownRight.SetActive(true); } if (gameInfomation.EnemyWinCount == 0) { EnemyCrownLeft.SetActive(false); EnemyCrownRight.SetActive(false); } if (gameInfomation.EnemyWinCount == 1) { EnemyCrownLeft.SetActive(true); EnemyCrownRight.SetActive(false); } if (gameInfomation.EnemyWinCount == 2) { EnemyCrownLeft.SetActive(true); EnemyCrownRight.SetActive(true); } }
public void SetCountInfo(GameInfomation gameInfomation) { MyHandCount.text = gameInfomation.MyHandCount.ToString(); EnemyHandCount.text = gameInfomation.EnemyHandCount.ToString(); MyCemeteryCount.text = gameInfomation.MyCemeteryCount.ToString(); EnemyCemeteryCount.text = gameInfomation.EnemyCemeteryCount.ToString(); MyDeckCount.text = gameInfomation.MyDeckCount.ToString(); EnemyDeckCount.text = gameInfomation.EnemyDeckCount.ToString(); }
//--------------------------- public void SetCardsInfo(GameInfomation gameInfomation) { MyHand.SetCards(gameInfomation.MyHandCard); MyRow1.SetCards(gameInfomation.MyPlace[0]); MyRow2.SetCards(gameInfomation.MyPlace[1]); MyRow3.SetCards(gameInfomation.MyPlace[2]); EnemyHand.SetCards(gameInfomation.EnemyHandCard); EnemyRow1.SetCards(gameInfomation.EnemyPlace[0]); EnemyRow2.SetCards(gameInfomation.EnemyPlace[1]); EnemyRow3.SetCards(gameInfomation.EnemyPlace[2]); MyLeader.SetLeader(gameInfomation.MyLeader, gameInfomation.IsMyLeader); EnemyLeader.SetLeader(gameInfomation.EnemyLeader, gameInfomation.IsEnemyLeader); // if (gameInfomation.MyLeader.DeckFaction == Faction.Monsters) { MyDeckBack.GetComponent <SpriteRenderer>().sprite = MonstersBack; } if (gameInfomation.MyLeader.DeckFaction == Faction.Nilfgaard) { MyDeckBack.GetComponent <SpriteRenderer>().sprite = NilfgaardBack; } if (gameInfomation.MyLeader.DeckFaction == Faction.ScoiaTael) { MyDeckBack.GetComponent <SpriteRenderer>().sprite = ScoiaTaelBack; } if (gameInfomation.MyLeader.DeckFaction == Faction.Skellige) { MyDeckBack.GetComponent <SpriteRenderer>().sprite = SkelligeBack; } if (gameInfomation.MyLeader.DeckFaction == Faction.NorthernRealms) { MyDeckBack.GetComponent <SpriteRenderer>().sprite = NorthernRealmsBack; } // if (gameInfomation.EnemyLeader.DeckFaction == Faction.Monsters) { EnemyDeckBack.GetComponent <SpriteRenderer>().sprite = MonstersBack; } if (gameInfomation.EnemyLeader.DeckFaction == Faction.Nilfgaard) { EnemyDeckBack.GetComponent <SpriteRenderer>().sprite = NilfgaardBack; } if (gameInfomation.EnemyLeader.DeckFaction == Faction.ScoiaTael) { EnemyDeckBack.GetComponent <SpriteRenderer>().sprite = ScoiaTaelBack; } if (gameInfomation.EnemyLeader.DeckFaction == Faction.Skellige) { EnemyDeckBack.GetComponent <SpriteRenderer>().sprite = SkelligeBack; } if (gameInfomation.EnemyLeader.DeckFaction == Faction.NorthernRealms) { EnemyDeckBack.GetComponent <SpriteRenderer>().sprite = NorthernRealmsBack; } }
public void SetMulliganInfo(GameInfomation gameInfomation) { //if (gameInfomation.IsMyPlayerPass) //MyShowMessage.text = "放弃跟牌"; if (gameInfomation.IsEnemyPlayerMulligan) { EnemyShowMessage.text = "敌方正在调度手牌"; } //MyPass.SetActive(gameInfomation.IsMyPlayerMulligan); EnemyPass.SetActive(gameInfomation.IsEnemyPlayerMulligan); }
public void SetPassInfo(GameInfomation gameInfomation) { if (gameInfomation.IsMyPlayerPass) { MyShowMessage.text = "放弃跟牌"; } if (gameInfomation.IsEnemyPlayerPass) { EnemyShowMessage.text = "放弃跟牌"; } MyPass.SetActive(gameInfomation.IsMyPlayerPass); EnemyPass.SetActive(gameInfomation.IsEnemyPlayerPass); }
void GetGamesList(List <VideoNode> data) { GoodsDictionary.Clear(); int length = data.Count; Transform child = content.GetChild(0); int childconut = child.childCount; for (int i = 0; i < length; i++) { Transform obj = child.GetChild(i); GameInfomation info = obj.GetComponent <GameInfomation>(); info.SetDate(data[i].describe, data[i].name); GoodsDictionary.Add(obj.name, data[i]); } }
//全部的信息 public void SetGameInfo(GameInfomation gameInfomation) { //****关于卡牌相关在另一边写了 //----------------------------------- //pass SetPassInfo(gameInfomation); //各种点数 SetPointInfo(gameInfomation); //------------------------------------ //各种数量 SetCountInfo(gameInfomation); //------------------------------------ //名称 SetNameInfo(gameInfomation); //------------------------------------- //皇冠图标 SetWinCountInfo(gameInfomation); //------------------------------------- //调度 SetMulliganInfo(gameInfomation); }
//public static void AddOrientationChangeListener() public static void init(GameInfomation game_info, ClientService service) { GameInfo = game_info; ClientSvc = service; int page_width = (int)Application.Current.Host.Content.ActualWidth; string device_id = ""; int page_height = (int)Application.Current.Host.Content.ActualHeight; byte[] device_id_byte = Utils.GetDeviceUniqueID(); EnvironmentParam = "sd=24&sr=" + page_width.ToString() + "x" + page_height.ToString() + "&vp=" + page_width.ToString() + "x" + page_height.ToString(); if (device_id_byte == null || device_id_byte.Length == 0) { } else { device_id = BitConverter.ToString(device_id_byte); EnvironmentParam += "&cid=" + device_id; } }
public void SetData(GoodsItem item, Dictionary <GameData, PriceData> gamelist) { GoodName.text = item.productName + "\n¥:" + item.price; #region MyRegion //string url = item.image; //string GoodsName = Path.GetFileName(url); //string localurl = Application.streamingAssetsPath + "/GoodsData/" + GoodsName; //if (File.Exists(localurl)) //{ // Texture2D t = LoadByIO(localurl); // rawImage.texture = t; //} //else //{ // StartCoroutine(LoadPicture(url)); //} #endregion foreach (GameData temp in gamelist.Keys) { GameObject gameUI = Instantiate(GamePrefab); gameUI.transform.SetParent(gameParent); GameInfomation gameinfo = gameUI.GetComponent <GameInfomation>(); gameinfo.SetData(temp.name, gamelist[temp], (gameID, changevalue, canplay) => { GameData NeedChange = null; foreach (GameData data in gamelist.Keys) { if (data.name.ToString() == gameID) { NeedChange = data; } } gamelist[NeedChange] = new PriceData(canplay, float.Parse(changevalue)); }); } }
public Text EnemyShowMessage; // public void SetPointInfo(GameInfomation gameInfomation) { MyAllPoint.color = ConstInfo.NormalColor; EnemyAllPoint.color = ConstInfo.NormalColor; MyRow1Point.text = gameInfomation.MyRow1Point.ToString(); MyRow2Point.text = gameInfomation.MyRow2Point.ToString(); MyRow3Point.text = gameInfomation.MyRow3Point.ToString(); EnemyRow1Point.text = gameInfomation.EnemyRow1Point.ToString(); EnemyRow2Point.text = gameInfomation.EnemyRow2Point.ToString(); EnemyRow3Point.text = gameInfomation.EnemyRow3Point.ToString(); var myAllPoint = (gameInfomation.MyRow1Point + gameInfomation.MyRow2Point + gameInfomation.MyRow3Point); var enemyAllPoint = (gameInfomation.EnemyRow1Point + gameInfomation.EnemyRow2Point + gameInfomation.EnemyRow3Point); MyAllPoint.text = myAllPoint.ToString(); EnemyAllPoint.text = enemyAllPoint.ToString(); if (myAllPoint > enemyAllPoint) { MyAllPoint.color = ConstInfo.WinColor; } else if (myAllPoint < enemyAllPoint) { EnemyAllPoint.color = ConstInfo.WinColor; } }
protected static string GetSaveFileName(GameInfomation gameInfomation) { return gameInfomation.Id.ToString() + "GameData.json"; }
public abstract Task<LayoutAwarePage> CreateGameAndNavigateTo(GameInfomation gameInfomation ,Frame targetFrame);
public void SetNameInfo(GameInfomation gameInfomation) { _code.GetComponent <GameCode>().GameUIControl.SetNameInfo(gameInfomation); }
public void SetCardsInfo(GameInfomation gameInfomation)//更新卡牌类型数据 { _code.GetComponent <GameCode>().GameCardsControl.SetCardsInfo(gameInfomation); }
//-- public void SetGameInfo(GameInfomation gameInfomation)//更新数值+胜场数据 { _code.GetComponent <GameCode>().GameUIControl.SetGameInfo(gameInfomation); }
public void SetNameInfo(GameInfomation gameInfomation) { EnemyName.text = gameInfomation.EnemyName; MyName.text = gameInfomation.MyName; }
async public override Task<LayoutAwarePage> CreateGameAndNavigateTo(GameInfomation gameInfomation, Frame targetFrame) { TradeGamePage_Model vm; var storage = new Storage<TradeGameData>(GetSaveFileName(gameInfomation)); await storage.Refresh(); vm = new TradeGamePage_Model(storage, gameInfomation); EventRouter.Instance.InitFrameNavigator(ref targetFrame); var navigator = vm.Navigator = targetFrame.GetFrameNavigator(); navigator.PageInitActions = new Dictionary<Type, Action<LayoutAwarePage, IDictionary<string, object>>> { { typeof (SetupGame), (p,dic)=> { var svm = new SetupGame_Model(vm.GameData); p.DefaultViewModel = svm; } }, { typeof (Exchange), (p,dic)=> { var svm = new SetupGame_Model(vm.GameData); p.DefaultViewModel = svm; } }, { typeof (ScoreBoard), (p,dic)=> { var svm = new ScoreBoard_Model(vm.GameData); p.DefaultViewModel = svm; } }, { typeof (TradeGamePage), (p,dic)=> { p.DefaultViewModel = vm; vm.CommandOnLoadCommand.Execute(null); } }, }; await navigator.FrameNavigate(Views.ViewModels.TradeGamePage_Model.TradeGamePageViewType, vm, null); return targetFrame.Content as LayoutAwarePage; }
public static void init(GameInfomation game_info, ClientService service) { GameInfo = game_info; ClientSvc = service; }
async public override Task<LayoutAwarePage> CreateGame(GameInfomation gameInfomation, Frame targetFrame) { TradeGameData_Model.ExchangeViewType = typeof(Exchange); TradeGameData_Model.SetupGameViewType = typeof(SetupGame); TradeGameData_Model vm; var storage = new Storages.Storage<TradeGameData_Model>(GetSaveFileName(gameInfomation)); await storage.Refresh(); if (storage.Value == null) { storage.Value = new TradeGameData_Model(storage, gameInfomation); } vm = storage.Value; EventRouter.Instance.InitFrameNavigator(ref targetFrame); var navigator = vm.Navigator = targetFrame.GetFrameNavigator(); navigator.PageInitActions = new Dictionary<Type, Action<LayoutAwarePage, IDictionary<string, object>>> { { typeof (SetupGame), (p,dic)=> { var svm = new SetupGame_Model(vm); p.DefaultViewModel = svm; } }, { typeof (Exchange), (p,dic)=> { var svm = new SetupGame_Model(vm); p.DefaultViewModel = svm; } }, { typeof (ScoreBoard), (p,dic)=> { var svm = new ScoreBoard_Model(vm); p.DefaultViewModel = svm; } }, }; var rval = new DefaultTradeGame.Views.TradeGamePage() { DefaultViewModel = vm }; return rval; }
public void SetAllInfo(GameInfomation gameInfomation)//更新全部数据 { _code.GetComponent <GameCode>().GameUIControl.SetGameInfo(gameInfomation); _code.GetComponent <GameCode>().GameCardsControl.SetCardsInfo(gameInfomation); }