public PlayerGameBoard(Grid gameGrid, PlayerState p, GameState g) { player = p; parent = gameGrid; //only 1 child if (parent.Children.Count > 1) //handle the case where there is existing child when we change views { parent.Children.Remove(parent.Children[1]); //System.Console.WriteLine("Child Removed"); } game = g; if (game.getAge() == 4)//game is over { ScoreWindow s = new ScoreWindow(game, parent); s.Show();; } playBoard = new Canvas(); parent.Children.Add(playBoard); //now child[1], two children createCardStack("R", 179, 10, playBoard); //0-9 createCardStack("M", 336, 10, playBoard); //10-19 createCardStack("S", 493, 10, playBoard); //20-29 createCardStack("Civ", 650, 10, playBoard); //30-39 createCardStack("Com", 807, 10, playBoard); //40-49 createCardStack("G", 964, 6, playBoard); //50-55 createHandStack(); //56-62 updateAge(game.getAge()); //63 createWonderBoard(player.getBoard().getName()); //64 createPlayerButtons(); //65-71 createPlayerRedCircles(); //72-78 createPlayerBlueCircles(); //79-85 createMoveButtons(); //86-89 updateMoney(); //90 createWonderSpots(player.getBoard().getMaxWonderLevel()); //[91-94] variable length createRulesButton(); //variable base on above wonder updateWonderSpots(player.getWonderCards()); updateHand(player.getHand()); updateCards(player.getPlayedCards()); }
int g_index = 0;//needed to reset ZIndex to original value upon mouse events public PlayerGameBoard(Grid gameGrid, PlayerState p, GameState g) { player = p; parent = gameGrid;//only 1 child if (parent.Children.Count > 1)//handle the case where there is existing child when we change views { parent.Children.Remove(parent.Children[1]); //System.Console.WriteLine("Child Removed"); } game = g; if (game.getAge() == 4)//game is over { ScoreWindow s = new ScoreWindow(game, parent); s.Show(); ; } playBoard = new Canvas(); parent.Children.Add(playBoard);//now child[1], two children createCardStack("R", 179, 10, playBoard);//0-9 createCardStack("M", 336, 10, playBoard);//10-19 createCardStack("S", 493, 10, playBoard);//20-29 createCardStack("Civ", 650, 10, playBoard);//30-39 createCardStack("Com", 807, 10, playBoard);//40-49 createCardStack("G", 964, 6, playBoard);//50-55 createHandStack();//56-62 updateAge(game.getAge());//63 createWonderBoard(player.getBoard().getName());//64 createPlayerButtons();//65-71 createPlayerRedCircles();//72-78 createPlayerBlueCircles();//79-85 createMoveButtons();//86-89 updateMoney();//90 createWonderSpots(player.getBoard().getMaxWonderLevel());//[91-94] variable length createRulesButton();//variable base on above wonder updateWonderSpots(player.getWonderCards()); updateHand(player.getHand()); updateCards(player.getPlayedCards()); }