Esempio n. 1
0
 public GameSolver(FrontEndInterface frontEnd, WordDict wordDict, Board boardConfig)
 {
     mFrontEnd = frontEnd;
     mWordDict = wordDict;
     mBoardLetters = CharInfo.ConvertBoardToCharInfoArr(boardConfig.BoardLetters);
     mAvailableLetters = boardConfig.AvailableLetters;
 }
Esempio n. 2
0
        private void SetBoardConfig(Board board)
        {
            if (this.InvokeRequired)
            {
                MethodInvoker del = delegate
                {
                    SetBoardConfig(board);
                };
                Invoke(del);
            }
            else
            {
                mSolutionsListView.Items.Clear();

                mAvailableLettersTxt.Text = new String(board.AvailableLetters);

                for (int i = 0; i < GameVals.BOARD_SIZE; i++)
                {
                    for (int j = 0; j < GameVals.BOARD_SIZE; j++)
                    {
                        mGameTextBoxes[i, j].Text = board.BoardLetters[i, j].ToString();
                    }
                }
            }
        }
Esempio n. 3
0
        private void LoadMenuItemOnClick(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Filter = "Game Board (*.wwf)|*.wwf";
                DialogResult result = ofd.ShowDialog();
                if (result == DialogResult.OK)
                {
                    string filename = ofd.FileName;
                    if (!File.Exists(filename))
                    {
                        MessageBox.Show("File does not exist");
                        return;
                    }

                    Board board = Board.Load(filename);
                    CurrentBoardConfig = board;
                }
            }
        }
Esempio n. 4
0
        private void ClearMenuItemOnClick(object sender, EventArgs e)
        {
            Board clearBoard = new Board(new char[GameVals.BOARD_SIZE, GameVals.BOARD_SIZE], new char[0]);
            CurrentBoardConfig = clearBoard;

            mSolutionsListView.Items.Clear();
        }