function PrimaryDisplay($display) {
		//Keep track of the HTML canvas element
		this.$display = $display;
		
		//Grab the "2d" context for drawing. We'll need this later for our actual draw calls.
		//There are other contexts, such as a WebGL context, but those are more complicated than what we need.
		this.drawContext = $display[0].getContext('2d');

		//Grab the dimensions of our display element on load
		this.width = $display.width();
		this.height = $display.height();

		//Determine which axis is the constraining axis for this canvas so we can ensure our displays are squares.
		if (this.width < this.height) {
			this.height = this.width;
		} else {
			this.width = this.height;
		}

		//Apply the newly determined dimensions.
		$display.width(this.width).height(this.height).attr("width", this.width).attr("height", this.height);

		//Multidimensional array of values from the CELL_STATE variable representing the state of each cell.
		this.gridState = [];

		//Multidimensional array of any values. Used just to contain data related to each cell. At the moment, this only used
		//to specify the type of ship in a "SHIP" cell.
		this.gridData = [];

		//Initialization flag. Could have used an "enum-ish" variable as in the BattleshipGame class, but this only needs two states so this is simpler.
		this.hasInit = false;
	}
//Constructor function for PrimaryDisplay "class"
Constructor function for PrimaryDisplay "class"
Constructor function for PrimaryDisplay " class "
function PrimaryDisplay($display) {
		this.$display = $display;
		this.drawContext = $display[0].getContext('2d');
		this.width = $display.width();
		this.height = $display.height();
		if (this.width < this.height) {
			this.height = this.width;
		} else {
			this.width = this.height;
		}
		$display.width(this.width).height(this.height).attr("width", this.width).attr("height", this.height);
		this.gridState = [];
		this.gridData = [];
		this.hasInit = false;
	}
function PrimaryDisplay ( $display ) { this . $display = $display ; this . drawContext = $display [ 0 ] . getContext ( '2d' ) ; this . width = $display . width ( ) ; this . height = $display . height ( ) ; if ( this . width < this . height ) { this . height = this . width ; } else { this . width = this . height ; } $display . width ( this . width ) . height ( this . height ) . attr ( "width" , this . width ) . attr ( "height" , this . height ) ; this . gridState = [ ] ; this . gridData = [ ] ; this . hasInit = false ; }
Constructor function for PrimaryDisplay "class"
Constructor function for PrimaryDisplay " class "
//Keep track of the HTML canvas element //Grab the "2d" context for drawing. We'll need this later for our actual draw calls. //There are other contexts, such as a WebGL context, but those are more complicated than what we need. //Grab the dimensions of our display element on load //Determine which axis is the constraining axis for this canvas so we can ensure our displays are squares. //Apply the newly determined dimensions. //Multidimensional array of values from the CELL_STATE variable representing the state of each cell. //Multidimensional array of any values. Used just to contain data related to each cell. At the moment, this only used //to specify the type of ship in a "SHIP" cell. //Initialization flag. Could have used an "enum-ish" variable as in the BattleshipGame class, but this only needs two states so this is simpler.