/* Scrabble : An interactive scrabble playing software. Copyright (C) 1999 Amitabh Sinha All Trademarks and Copyrights pertaining to Scrabble, Java, Linux acknowledged. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Contact Amitabh at */ import java.io.*; import java.util.*; public class HumanPlayer extends Player { Vector word; Vector xpos; Vector ypos; public HumanPlayer(String n, LetterBag l) { name = n; letterBag = l; word = new Vector (); xpos = new Vector(); ypos = new Vector(); for (int i=0; i<7; i++) letters.addElement(letterBag.getLetter()); } public Vector getWord() { return word; } public void chooseLetter(Letter l, int i, int j) { word.addElement(l); xpos.addElement(new Integer(i)); ypos.addElement(new Integer(j)); } public void clear() { word = new Vector(); xpos = new Vector(); ypos = new Vector(); int z = letterBag.getSize(); int y = 7-letters.size(); z = (y= 7) { for (int i=0; i<7; i++) letters.addElement(letterBag.getLetter()); for (int i=0; i<7; i++) { letterBag.returnLetter((Letter)letters.elementAt(0)); letters.removeElement(letters.elementAt(0)); } return true; } else { Dialog d = new Dialog ("Letter Bag nearly empty; cannot change."); return false; } } }