package com.charego.lingo.client.view;

import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;

public abstract class Board {

	public static final double HEIGHT = 300;
	public static final double WIDTH = 250;

	/** The height of a character box */
	public static final double CHARACTER_HEIGHT = 50;

	protected final Canvas canvas;

	protected final GraphicsContext gc;

	/** The leftmost x-coordinate */
	protected final double xInit;

	/** The topmost y-coordinate */
	protected final double yInit;

	/** The width of a character box */
	protected final double characterWidth;

	/** The length of a word in this game */
	protected final int wordLength;

	public Board(Canvas canvas, double xInit, double yInit, int wordLength) {
		this.canvas = canvas;
		this.gc = canvas.getGraphicsContext2D();
		this.xInit = xInit;
		this.yInit = yInit;
		this.wordLength = wordLength;
		this.characterWidth = WIDTH / wordLength;
	}

	public void clearBoard() {
		gc.clearRect(xInit, yInit, WIDTH, HEIGHT);
	}

	public abstract void drawBoard();

}
