示例#1
0
        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";
                }
            });
        }
示例#2
0
 private void SetUpTopControlPanel(object sender,Player player)
 {
     topControlPanel = new TopControlPanel
     {
         Location = new Point(12, 12)
     };
     topControlPanel.SetPlayerToControl(player);
     gameForm.Controls.Add(topControlPanel);
 }
示例#3
0
 private void SetUpPlayerInfoControl(Player player)
 {
     playerInfoControl = new PlayerInfoControl(player)
     {
         Location = new Point(12, 12)
     };
        // gameBoardControler.NewTurn += playerInfoControl.ShowInfo2;
     gameForm.Controls.Add(playerInfoControl);
 }
示例#4
0
 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);
 }
示例#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)
     {
     }
 }
示例#6
0
 public void SetPlayerToControl(Player player)
 {
     currentPlayer = player;
     player.TurnStarted += Reset;
 }
示例#7
0
 public void SetupPlayers(Player player1, Player player2)
 {
     playerOne = player1;
     playerTwo = player2;
 }
示例#8
0
 private void OnPlayerIsCreated(Player e)
 {
     PlayerIsCreated?.Invoke(this, e);
 }
示例#9
0
 public PlayerInfoControl(Player currentPlayer)
 {
     this.currentPlayer = currentPlayer;
     InitializeComponent();
 }