game.Block Class Reference

This class is a specification of a Block in the tetris game. More...

Inheritance diagram for game.Block:

Inheritance graph
[legend]
Collaboration diagram for game.Block:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Block (int row, int col, Color color)
 create a Block with the given coordinates and color.
boolean isEmpty ()
void move (int down, int right)
 Move the Block.
Color getColor ()
 Simply get the color.
boolean coordWithin (int rows, int cols)
 test if the position is valid

Private Attributes

Color color


Detailed Description

This class is a specification of a Block in the tetris game.

Author:
Team Solid Sun

Constructor & Destructor Documentation

game.Block.Block ( int  row,
int  col,
Color  color 
)

create a Block with the given coordinates and color.

Parameters:
row The row the block should be.
col The collumn the Block should be.
color The Color theBlock should have
00022                                                     {
00023                 super(row, col);
00024                 this.color = color;
00025         }


Member Function Documentation

boolean game.Block.isEmpty (  ) 

See also:
game.IBlock.isEmpty()

Implements game.IBlock.

00030                                  {
00031                 return false;
00032         }

void game.Block.move ( int  down,
int  right 
)

Move the Block.

Parameters:
down The value the Block should move. positive for down negative for up.
right The value the Block should move. positive for right negative for left.
00044                                               {
00045                 super.row += down;
00046                 super.col += right;
00047         }

Color game.Block.getColor (  ) 

Simply get the color.

Returns:
The color of the Block
00054                                 {
00055                 return this.color;
00056         }

boolean game.Block.coordWithin ( int  rows,
int  cols 
)

test if the position is valid

Parameters:
rows the lowest border
cols the rightmost border
Returns:
true if position is valid

References game.ABlock.col, and game.ABlock.row.

00067                                                        {
00068                 return (0 <= row && row < rows) && (0 <= col && col < cols);
00069         }


Member Data Documentation


The documentation for this class was generated from the following file:

Generated on Mon Jul 28 19:03:05 2008 for SolidJavaTetris by  doxygen 1.5.5