All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.refcodes.checkerboard.impls.GridDimensionChangedEventImpl Maven / Gradle / Ivy

Go to download

Artifact for providing some easy means to visualize (state of) board games or (state of) cellular automatons.

There is a newer version: 1.1.1
Show newest version
package org.refcodes.checkerboard.impls;

import org.refcodes.checkerboard.Checkerboard;
import org.refcodes.checkerboard.GridDimensionChangedEvent;
import org.refcodes.graphical.GridDimension;
import org.refcodes.graphical.impls.GridDimensionImpl;

public class GridDimensionChangedEventImpl extends AbstractCheckerboardEventimplements GridDimensionChangedEvent {

	private int _height;
	private int _width;
	private GridDimension _precedingDimension;

	// /////////////////////////////////////////////////////////////////////////
	// STATICS:
	// /////////////////////////////////////////////////////////////////////////

	// /////////////////////////////////////////////////////////////////////////
	// CONSTANTS:
	// /////////////////////////////////////////////////////////////////////////

	// /////////////////////////////////////////////////////////////////////////
	// VARIABLES:
	// /////////////////////////////////////////////////////////////////////////

	// /////////////////////////////////////////////////////////////////////////
	// CONSTRUCTORS:
	// /////////////////////////////////////////////////////////////////////////

	public GridDimensionChangedEventImpl( int aWidth, int aHeight, int aPrecedingWidth, int aPrecedingHeigt, Checkerboard aSource ) {
		super( ACTION, aSource );
		_width = aWidth;
		_height = aHeight;
		_precedingDimension = new GridDimensionImpl( aPrecedingWidth, aPrecedingHeigt );
	}

	// /////////////////////////////////////////////////////////////////////////
	// INJECTION:
	// /////////////////////////////////////////////////////////////////////////

	// /////////////////////////////////////////////////////////////////////////
	// METHODS:
	// /////////////////////////////////////////////////////////////////////////

	@Override
	public int getGridHeight() {
		return _height;
	}

	@Override
	public int getGridWidth() {
		return _width;
	}

	@Override
	public GridDimension getPrecedingGridDimension() {
		return _precedingDimension;
	}

	@Override
	public String toString() {
		return getClass().getSimpleName() + "(" + _width + " x " + _height + ")@" + hashCode();
	}

	// /////////////////////////////////////////////////////////////////////////
	// HOOKS:
	// /////////////////////////////////////////////////////////////////////////

	// /////////////////////////////////////////////////////////////////////////
	// HELPER:
	// /////////////////////////////////////////////////////////////////////////

	// /////////////////////////////////////////////////////////////////////////
	// INNER CLASSES:
	// /////////////////////////////////////////////////////////////////////////

}