public void ShowInfo(Player player)
        {
            this.UiThread(() =>
            {
                try
                {
                    RequestsBox.Text = player.PlayerBuildQuery.Aggregate(
                        Empty, (current, request) => current + request.ToString()+"\n"
                        );
                }
                catch (Exception)
                {
                    RequestsBox.Text = "Not exist";
                }
                try
                {

                    TilesBox.Text = player.PlayerTiles.Aggregate(
                        Empty, (current, tile) => current + tile.TileIndex.ToString()+ "\n"
                        );
                }
                catch (Exception)
                {
                    TilesBox.Text = "Not exist";
                }
            });
        }
Exemple #2
0
 private void SetUpTopControlPanel(object sender,Player player)
 {
     topControlPanel = new TopControlPanel
     {
         Location = new Point(12, 12)
     };
     topControlPanel.SetPlayerToControl(player);
     gameForm.Controls.Add(topControlPanel);
 }
Exemple #3
0
 private void SetUpPlayerInfoControl(Player player)
 {
     playerInfoControl = new PlayerInfoControl(player)
     {
         Location = new Point(12, 12)
     };
        // gameBoardControler.NewTurn += playerInfoControl.ShowInfo2;
     gameForm.Controls.Add(playerInfoControl);
 }
 public void CreateNewGame()
 {
     gameBoard = new GameBoard(5, 5);
     OnGameBoardIsCreated(gameBoard);
     playerOne = new Player(null);
     playerOne.CreatePalace = gameBoardControler.GetBSpot;
     GameStarted += playerOne.OnGetBuildSpot;
     OnPlayerIsCreated(playerOne);
     playerTwo = new Player(null);
     playerTwo.CreatePalace = () => gameBoard.BuildingSpots[3];
     GameStarted += playerTwo.OnGetBuildSpot;
     //OnPlayerIsCreated(player2);
 }
Exemple #5
0
 private void BuildPalaces(Player player1,Player player2)
 {
     checker = new Checker();
     player1.PalaceIsCreated += checker.CheckIn;
     player2.PalaceIsCreated += checker.CheckIn;
      //           player1.OnGetBuildSpot();
       //          player2.OnGetBuildSpot();
     while (!checker.IsReady)
     {
     }
 }
 public void SetPlayerToControl(Player player)
 {
     currentPlayer = player;
     player.TurnStarted += Reset;
 }
 public void SetupPlayers(Player player1, Player player2)
 {
     playerOne = player1;
     playerTwo = player2;
 }
 private void OnPlayerIsCreated(Player e)
 {
     PlayerIsCreated?.Invoke(this, e);
 }
 public PlayerInfoControl(Player currentPlayer)
 {
     this.currentPlayer = currentPlayer;
     InitializeComponent();
 }