コード例 #1
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            if (numberOfPlayers == 0 || (comboBoxSize.SelectedIndex == -1))
            {
                //error
                System.Windows.Forms.MessageBox.Show("Select Player and size!");
            }
            //normal way
            else
            {
                DTOClass transferObject = new DTOClass();

                Hexagonal.BoardState state = new Hexagonal.Builder.BoardStateBuilder()
                                             .withGridPenWidth(2)
                                             .withActiveHexBorderColor(Color.Red)
                                             .withActiveGridPenWidth(2)
                                             .build();

                this.board = new Hexagonal.Builder.BoardBuilder()
                             .witHeight(sizeOfBoard)
                             .withWidht(sizeOfBoard)
                             .withSide(25)
                             .withPlayerLogics(new List <IPlayerLogic>
                {
                    new UserPlayer(),
                    new BlockchainPrepper(),
                    new AlphaRandom(),
                    new DeepRandom(),
                    new QuantumRevenge()
                })
                             .withBoardState(state)
                             .withDataTransfer(transferObject)
                             .build();

                HexagonalTest.Fight gameForm = new HexagonalTest.Fight(board, sizeOfBoard, transferObject);

                //prepare the DTO Object for the database
                //set the fieldsize and the enemycounter and start the playtimer
                transferObject.setEnemyCount(board.Players.Count);
                transferObject.setFieldSize(comboBoxSize.GetItemText(comboBoxSize.SelectedItem));
                transferObject.startTimerGo();

                //Start the FightForm
                gameForm.Show();

                this.Hide();
            }
        }
コード例 #2
0
 public GraphicsEngine(Hexagonal.Board board, int xOffset, int yOffset)
 {
     this.Initialize(board, xOffset, yOffset);
 }
コード例 #3
0
 private void Initialize(Hexagonal.Board board, int xOffset, int yOffset)
 {
     this.board        = board;
     this.boardXOffset = xOffset;
     this.boardYOffset = yOffset;
 }
コード例 #4
0
 public GraphicsEngine(Hexagonal.Board board)
 {
     this.Initialize(board, 0, 0);
 }