Beispiel #1
0
        public GameOver(string nameOfPlayer, DTOClass data)
        {
            this.transferObject = data;
            InitializeComponent(nameOfPlayer);

            //Stop the timer and save the time
            transferObject.stopTimer();
        }
Beispiel #2
0
        public Fight(Board x, int size, DTOClass data)
        {
            board               = x;
            sizeOfField         = size;
            this.transferObject = data;

            InitializeComponent(sizeOfField);

            startGame();
        }
Beispiel #3
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();
            }
        }