public FormLoadSaveMenu(MyBoardGame myBoardGame)
 {
     InitializeComponent();
     this.myBoardGame = myBoardGame;
     setupContent();
     setupButtonPreviewColor();
 }
Beispiel #2
0
 public FormMainMenu(MyBoardGame myBoardGame)
 {
     InitializeComponent();
     setEventButton();
     //this.BackgroundImage = (Image)Resources.ResourceManager.GetObject("bg_m");
     this.myBoardGame = myBoardGame;
 }
Beispiel #3
0
        public FormSelectBoardSize(MyBoardGame myBoardGame)
        {
            InitializeComponent();
            this.myBoardGame = myBoardGame;  //

            // add event to DGV.
            dataGridViewLoadBoard.CellClick += new DataGridViewCellEventHandler(dataGridViewLoadBoard_CellClick);
            dataGridViewLoadSave             = new DataGridViewLoadSave(dataGridViewLoadBoard); // put accual object DGV to class.
            dataGridViewLoadSave.setupDataGridViewLoadBoard();                                  // setup default detail in DGV.
            dataGridViewLoadSave.loadToDataGridViewLoadBoard("boardatorMoreMap");               // Load xml to dataGridView.

            // Create PreviewBoard. // myboardgame parameter for get image item dynamic.
            previewBoard = new PreviewBoard(panel_previewBoard, myBoardGame); // put accual object Panel to PreviewBoard object.
            previewBoard.createPanelPreviewBoard();                           // create section all.
            previewBoard.setFolderXML("boardatorMoreMap");
            previewBoard.refreshColorBoard();                                 // put colour in Preview board.


            setupButtonPreviewColor();

            if (dataGridViewLoadBoard.RowCount > 0)            // not empty  save file.
            {
                dataGridViewLoadBoard.Rows[0].Selected = true; // row 0 selected , in start.
                dataGridViewLoadBoard_CellClick(dataGridViewLoadBoard, null);
            }

            //MetroFramework.MetroMessageBox.Show(this, "Hello", "...", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
 public FormMenuInGame(Form parentForm, MyBoardGame myBoardGame)
 {
     InitializeComponent();
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.parentForm      = parentForm;
     this.myBoardGame     = myBoardGame;
     //typeBoard = "not";
 }
 public FormLoadSaveMenu(Form parentForm, MyBoardGame myBoardGame)
 {
     InitializeComponent();
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
     this.parentForm      = parentForm;
     this.myBoardGame     = myBoardGame;
     setupContent();
     setupButtonPreviewColor();
 }
Beispiel #6
0
        public FormPlay12x12(MyBoardGame myBoardGame)
        {
            InitializeComponent();
            this.myBoardGame = myBoardGame;

            // Create Board. AI
            this.flag_AI = myBoardGame.getFlagAI();
            //this.flag_AI = true;
            typeBoard = myBoardGame.getTypeBoard();
            if (typeBoard == "Mak Horse")
            {
                myBoard = new BoardHorse(this, Panel_myBorad, 12, 12, flag_AI, myBoardGame);
                myBoard.setFlagForcedKill(myBoardGame.getFlagForcedKillBoardHorse());
            }
            else if (typeBoard == "Mak Neeb")
            {
                myBoard = new BoardNeeb(this, Panel_myBorad, 12, 12, flag_AI, myBoardGame);
                myBoard.setFlagForcedKill(myBoardGame.getFlagForcedKillBoardNeeb());
            }
            else
            {
                MessageBox.Show("Error. type board cannot opened.");
            }

            //set Color Panel Start Board.
            myBoard.setColorPanelBoardSection(myBoardGame.getColorSectionA(), myBoardGame.getColorSectionB());
            myBoard.refreshColorOnBoard();

            //set access content to data in object.
            myBoard.setLabelTurnPlayerContent(lbl_turnPlayer);
            myBoard.setLabelCounterItemActiveContent(lbl_item_player1, lbl_item_player2);

            // set start player.
            int startplayer = myBoardGame.getPlayerStart();

            myBoard.setTurnPlayerStart(startplayer); // set start player turn.
            MessageBox.Show("Start player is Player" + startplayer);


            myBoard.setProgressBarPlayer(progressBar_player1, progressBar_player2);
            myBoard.setLabelNumItem(lbl_num_player1, lbl_num_player2);

            myBoard.setLabelActiveSkip(lbl_skip_player1, lbl_skip_player2);
            myBoard.setLabelNumSkip(lbl_numSkip_player1, lbl_numSkip_player2);

            myBoard.setButtonSkipturn(btn_skipturn);

            // setup item player on Board.
            myBoard.createObjectItem(20, 20);
            setupMap(12, 12);
            myBoard.setCounterItemPlayer();
            myBoard.setListItemActiveAI();
            myBoard.updateCounterActiveItem();
            //myBoard.setTextBoxContentForDeBugging(txt_AddressItem, txt_AddressItem2,txt_playerHolder, txt_itemInBoard);
            myBoard.updateDataDeBugging();
        }
Beispiel #7
0
        public FormEndGame(Form parentForm, MyBoardGame myBoardGame, string result)
        {
            InitializeComponent();
            //this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.parentForm  = parentForm;
            this.myBoardGame = myBoardGame;
            this.result      = result;

            label_result.Text = "" + result;
        }
        public PreviewBoard(Panel parentPanel, MyBoardGame myBoardGame)
        {
            this.parentPanel = parentPanel;
            this.myBoardGame = myBoardGame;

            namePictureItemRegularPlayer1 = myBoardGame.getNamePictureItemRegular(1);
            namePictureItemRegularPlayer2 = myBoardGame.getNamePictureItemRegular(2);
            namePictureItemSuperPlayer1   = myBoardGame.getNamePictureItemSuper(1);
            namePictureItemSuperPlayer2   = myBoardGame.getNamePictureItemSuper(2);
        }
 public BoardSection(int id_row, int id_col, int typeBoard, Board parent, MyBoardGame myBoardGame)
 {
     this.myBoardGame      = myBoardGame;
     this.boardParent      = parent;
     this.typeBoardSection = typeBoard;
     this.id_row           = id_row;
     this.id_col           = id_col;
     hasItem = false;
     player  = 0; // not have player in section.
     this.sizePictureItem = 64;
 }
        public FormSavePage(Form parentForm, MyBoardGame myBoardGame)
        {
            InitializeComponent();
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.parentForm      = parentForm;
            this.myBoardGame     = myBoardGame;

            dataGridViewLoadBoard.CellClick += new DataGridViewCellEventHandler(dataGridViewLoadBoard_CellClick);
            dataGridViewLoadSave             = new DataGridViewLoadSave(dataGridViewLoadBoard); // put accual Object DGV.
            dataGridViewLoadSave.setupDataGridViewLoadBoard();                                  // setup default detail in DGV.
            dataGridViewLoadSave.loadToDataGridViewLoadBoard("boardator");                      // Load xml to dataGridView.
        }
Beispiel #11
0
        // Stream str;
        //SoundPlayer snd;

        public FormMainMenu()
        {
            //str = Properties.Resources.Rabbit_Run_OP;
            //snd = new SoundPlayer(str);
            //snd.PlayLooping();
            //snd.Play();

            InitializeComponent();
            setEventButton();
            //this.BackgroundImage = (Image)Resources.ResourceManager.GetObject("bg_m");
            myBoardGame = new MyBoardGame();
        }
Beispiel #12
0
        public FormToolGenerateMap(MyBoardGame myBoardGame)
        {
            InitializeComponent();
            this.myBoardGame = myBoardGame;
            setupButtonPreviewColor();

            // default 8x8.
            setSizeBoard(8, 8);
            radio_8x8.Checked = true;
            updateDisableButton();
            updateEnableButton();
            setLabelHowToUse();

            // default makHorse
            setBoardMakHorse();
            radio_makHorse.Checked = true;

            //updateEnableButton();
        }
        public FormChooseStarter(Form parentForm, MyBoardGame myBoardGame)
        {
            InitializeComponent();

            this.parentForm  = parentForm;
            this.myBoardGame = myBoardGame;

            if (myBoardGame.getFlagAI())
            {
                btn_player1.Text = "Computer";
                btn_player2.Text = "You";
            }

            virture_choose.BackColor = btn_player1.BackColor;
            virture_choose.ForeColor = btn_player1.ForeColor;

            virture_not_choose.BackColor = btn_player2.BackColor;
            virture_not_choose.ForeColor = btn_player2.ForeColor;
        }
        public FormSetting(Form parentForm, MyBoardGame myBoardGame, bool flag_lock_playing)
        {
            InitializeComponent();
            picItem      = new PictureBox[numPicture];
            picItemSuper = new PictureBox[numPicture];
            radioPlayer1 = new RadioButton[numPicture];
            radioPlayer2 = new RadioButton[numPicture];

            this.parentForm  = parentForm;
            this.myBoardGame = myBoardGame;

            accessContent(panel_item, panel_itemSuper, groupBoxPlayer1, groupBoxPlayer2);
            putImageFormResourceToPictureBox();
            setRadioButtonConsistWithData(myBoardGame.index_picPlayer1, myBoardGame.index_picPlayer2);

            toggle_soundeffect.Checked          = myBoardGame.getFlagSoundEffect();
            toggle_forcedKillBoardNeeb.Checked  = myBoardGame.getFlagForcedKillBoardNeeb();
            toggle_forcedKillBoardHorse.Checked = myBoardGame.getFlagForcedKillBoardHorse();
            comboBox_skipturn.SelectedIndex     = myBoardGame.getNumSkipTurn();

            lockSetting(flag_lock_playing);
        }
        public FormMoreMap(MyBoardGame myBoardGame)
        {
            InitializeComponent();
            this.myBoardGame = myBoardGame;

            // add event to DGV.
            dataGridViewLoadBoard.CellClick += new DataGridViewCellEventHandler(dataGridViewLoadBoard2_CellClick);
            dataGridViewLoadSave             = new DataGridViewLoadSave(dataGridViewLoadBoard); // put accual object DGV to class.
            dataGridViewLoadSave.setupDataGridViewLoadBoard();                                  // setup default detail in DGV.
            dataGridViewLoadSave.loadToDataGridViewLoadBoard("boardatorMoreMap");               // Load xml to dataGridView.

            // Create PreviewBoard.
            previewBoard = new PreviewBoard(panel_previewBoard, myBoardGame); // put accual object Panel to PreviewBoard object.
            previewBoard.createPanelPreviewBoard();                           // create section all.
            previewBoard.setFolderXML("boardatorMoreMap");
            previewBoard.refreshColorBoard();                                 // put colour in Preview board.

            if (dataGridViewLoadBoard.RowCount > 0)                           // not empty  save file.
            {
                dataGridViewLoadBoard.Rows[0].Selected = true;                // row 0 selected , in start.
                dataGridViewLoadBoard2_CellClick(dataGridViewLoadBoard, null);
            }
        }
Beispiel #16
0
        public BoardPinch(Form myForm, Panel panelBoard, int row, int col, bool AI, MyBoardGame myBoardGame)
        {
            this.myBoardGame    = myBoardGame;
            this.myForm         = myForm;
            typeBoard           = (int)type.PinchDraught;
            flag_AI             = AI;
            temp_row            = -1;
            temp_col            = -1;
            listSectionSelected = new List <Tuple <int, int, int, int> >();
            //listSectionSelectedFuture = new List<Tuple<int, int, int, int>>();
            listSectionItemKilled = new List <Tuple <int, int> >();

            listSectionItemKiller       = new List <Tuple <int, int> >(); // use in forced kill mode.
            listSectionItemKillerFuture = new List <Tuple <int, int> >(); // use in forced kill mode.


            listItemActiveAI = new List <int>();

            boardSection = new BoardSection[row, col]; // assign size board.
            this.setRowColBoard(row, col);
            createBoardSection();                      // create Boardsection.
            accessContent(panelBoard);                 // access object and assign Panel to Array PanelSection.
            createPictureBoxInBoardSection(row, col);
        }
Beispiel #17
0
 public FormHelp(MyBoardGame myBoardGame)
 {
     InitializeComponent();
     this.myBoardGame = myBoardGame;
 }
Beispiel #18
0
 public FormHowToPlay(MyBoardGame myBoardGame)
 {
     InitializeComponent();
     this.myBoardGame = myBoardGame;
 }
Beispiel #19
0
 protected void setObjectMyBoardGame(MyBoardGame myBoardGame)
 {
     this.myBoardGame = myBoardGame;
 }
 public FormCredits(MyBoardGame myBoardGame)
 {
     this.myBoardGame = myBoardGame;
     InitializeComponent();
 }