Package tetris.gui
Class Block
java.lang.Object
tetris.gui.Block
The class Block implements a block of the Tetris game.
- Version:
- 2.1
- Author:
- Stephan Fischli
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBlock
(int x, int y, int color) Constructs a block with the specified coordinates and color. -
Method Summary
-
Field Details
-
x
public int xThe x coordinate of the block. -
y
public int yThe y coordinate of the block. -
color
public int colorThe color of the block.
-
-
Constructor Details
-
Block
public Block(int x, int y, int color) Constructs a block with the specified coordinates and color.- Parameters:
x
- the x coordinate of the blocky
- the y coordinate of the blockcolor
- the color of the block
-
-
Method Details
-
equals
Checks whether the block is equal to another block. -
hashCode
public int hashCode()Computes a hash code of the block.
-