//Name: David Yang, Sean McMillan, Dominic Golab
//File: Board.h
//For: CSE 30331: Scrabble Gmae
//12/6/09
/*Description: This file contains the functionality of the board class.
The board class holds a matrix of letters that represents the board and a matrix of ints that represents the boards multipliers. It has a Bag, banks, a dictionary and matrix objects. It combines them to make the base of the scrabble program.*/

#ifndef BOARD_H
#define BOARD_H

#include "myMatrix.h"
#include "Bank.h"
#include "dictionary.h"
#include<ncurses.h>

class Board{
 public:
  Board();//constructor
  bool place(int,int,int,int,string,int);//places a word on the board, needs the x and y coordinates, the string and which player isplacing it
  string getWord(int rStart, int rEnd, int cStart, int cEnd);//returns the string boundaried by the given points
  void draw(bool, int, string);//draws the board
  void displayBanks(int);//displays the banks
  void createPoints();//creates point system for the board
  void displayBoard();//displays the board
  bool checkDictionary(int rStart, int rEnd, int cStart, int cEnd, string word);//checks a word with the dictionary and all new words formed from adding it to the board
  bool bagEmpty();//returns if the bag is empty
  bool bankEmpty();//returns if a bank is empty
  bool middleCovered();//returns if the middle of the board is covered
  int winner();//returns the player that is the winner


 private:
  int rows, cols;
  Bag letterBag;//holds the letters
  Bank players[4];//holds the banks
  dictionary Dictionary;//the dictionary
  Matrix<int> pointsBoard;//the points board
  Matrix<char> letterBoard;//the letters board
  WINDOW *win;//the window for the board

};
#endif
