// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   NameBoard.java

import java.awt.*;

class NameBoard extends ScrambleSettings
{

    NameBoard(String as[])
    {
        small = new Font("Monospaced", 0, 10);
        big = new Font("Monospaced", 1, 14);
        name = new Font("TimesRoman", 1, 14);
        scoreChanged = -1;
        playersNames = as;
        scores = new int[playersNames.length];
        for(int i = 0; i < playersNames.length; i++)
            scores[i] = 0;

    }

    public void changeScore(int i, int j, char ac[])
    {
        scores[i] = j;
        for(int k = 0; k < 7; k++)
            letters[i][k] = ac[k] != ' ';

        scoreChanged = i;
        repaint();
    }

    public void setLettersLeft(int i)
    {
        lettersGone = 100 - i;
    }

    public void setPlayer(int i)
    {
        currentPlayer = i;
        repaint();
    }

    public void paint(Graphics g)
    {
        for(int i = 0; i < playersNames.length; i++)
        {
            g.setFont(name);
            g.setColor(Color.black);
            if(i == currentPlayer)
                g.fillOval(70, 27 + 75 * i, 5, 5);
            g.drawString(playersNames[i], 80, 35 + 75 * i);
            g.setColor(ScrambleSettings.scoreColor);
            g.setFont(big);
            g.drawString(String.valueOf(scores[i]), 190, 35 + 75 * i);
            g.setColor(ScrambleSettings.letterHolderColor);
            g.fillRect(80, 45 + 75 * i, 145, 20);
            g.setColor(ScrambleSettings.tileColor);
            for(int j = 0; j < 7; j++)
                if(letters[i][j])
                    g.fillRect(83 + j * 20, 42 + 75 * i, 17, 3);

        }

        g.setColor(ScrambleSettings.tileColor);
        g.fill3DRect(125, 310, 51, 51, true);
        g.setColor(ScrambleSettings.tileColor.darker());
        g.fillOval(143, 325, 14, 15);
        g.fillOval(143, 330, 14, 15);
        g.fillOval(140, 332, 20, 20);
        g.setColor(ScrambleSettings.tileColor.darker().darker());
        g.fillOval(141, 320, 18, 10);
        g.setColor(Color.black);
        for(int k = 0; k < 11; k++)
            g.drawLine(125, 310 + k * 5, 175, 310 + k * 5);

        for(int l = 0; l < 11; l++)
            g.drawLine(125 + l * 5, 310, 125 + l * 5, 360);

        int i1 = 0;
        g.setColor(new Color(200, 200, 200));
        for(; i1 < lettersGone / 10; i1++)
        {
            for(int j1 = 0; j1 < 10; j1++)
                g.fillRect((126 + j1 * 5) - 1, (311 + i1 * 5) - 1, 5, 5);

            g.drawLine(175, (311 + i1 * 5) - 1, 175, ((311 + i1 * 5) - 1) + 4);
        }

        for(int k1 = 0; k1 < lettersGone % 10; k1++)
            g.fillRect((126 + k1 * 5) - 1, (311 + i1 * 5) - 1, 5, 5);

        g.setFont(small);
        g.setColor(Color.darkGray);
        g.drawLine(65, 0, 65, 340);
        g.setColor(Color.black);
        for(int l1 = 0; l1 < 26; l1++)
            if(letterSet[l1] != 0)
                g.drawString(new Character((char)(l1 + 97)) + ":  " + letterPointValues[l1], 20, 15 + 12 * l1);

        if(letterSet[26] != 0)
            g.drawString("_:  " + letterPointValues[26], 20, 327);
    }

    String playersNames[];
    int scores[];
    int currentPlayer;
    int lettersGone;
    boolean letters[][] = {
        {
            true, true, true, true, true, true, true
        }, {
            true, true, true, true, true, true, true
        }, {
            true, true, true, true, true, true, true
        }, {
            true, true, true, true, true, true, true
        }
    };
    Font small;
    Font big;
    Font name;
    int scoreChanged;
}
