package ola.jsame;

import java.awt.Dimension;
import javax.swing.*;

/**
 * Same game GUI
 * <P>
 * @author Owen Astrachan
 */
public class SameGameApplet extends JApplet
{
    private Dimension getDimension()
    {
	int rows = 6;
	int cols = 15;
	try{
	    rows = Integer.parseInt(getParameter("rows"));
	    cols = Integer.parseInt(getParameter("cols"));
	}
	catch (Exception e){
	    // in case format bad or params missing
	}
	return new Dimension(rows,cols);
    }
    /**
     */
    public void init()
    {
	Dimension d = getDimension();
	SameGameModel model = new SameGameModel(d.height,d.width);	
	JPanel panel = new SameGameCore(model);
	setContentPane(panel);
	setVisible(true);
    }
}
