Project 3 - Play Tetris
allclasses-frame.html
All Classes
allclasses-noframe.html
All Classes
constant-values.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Prev
- Next
Constant Field Values
Contents
edu.vt.*
-
edu.vt.cs5044.tetris.Board
Modifier and Type Constant Field Value public static final int HEIGHT 24 public static final int HEIGHT_LIMIT 20 public static final int WIDTH 10
- Package
- Class
- Deprecated
- Index
- Help
- Prev
- Next
deprecated-list.html
JavaScript is disabled on your browser. Skip navigation links- Prev
- Next
Deprecated API
Contents
Skip navigation links- Prev
- Next
edu/vt/cs5044/tetris/Tetris5044.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Prev Class
- Next Class
Class Tetris5044
- Object
-
- Application
-
- Tetris5044
-
public class Tetris5044 extends Application
The main application class; for internal use only.- Version:
- 1.0
-
-
Constructor Summary
ConstructorsConstructor and Description Tetris5044()
-
Method Summary
All Methods Static Methods Instance Methods Concrete MethodsModifier and Type Method and Description static void main(String[] args) For internal use only. void start(Stage primaryStage) For internal use only.
-
-
-
Method Detail
-
start
public void start(Stage primaryStage) throws ExceptionFor internal use only.- Specified by:
- start in class Application
- Parameters:
- primaryStage - for internal use only.
- Throws:
- Exception - for internal use only.
-
main
public static void main(String[] args)
For internal use only.- Parameters:
- args - ignored.
-
-
- Package
- Class
- Deprecated
- Index
- Help
- Prev Class
- Next Class
edu/vt/cs5044/tetris/RandomMode.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Summary:
- Nested |
- Enum Constants |
- Field |
- Method
- Detail:
- Enum Constants |
- Field |
- Method
Enum RandomMode
- Object
-
- Enum<RandomMode>
-
- RandomMode
-
- All Implemented Interfaces:
- Serializable, Comparable<RandomMode>
public enum RandomMode extends Enum<RandomMode>
Enumerates the modes of randomness used for generating shapes for games of tetris.
-
-
Enum Constant Summary
Enum ConstantsEnum Constant and Description NORMAL Stream of randomness that is not repeatable. TEST1 Repeatable stream of randomness number 1. TEST2 Repeatable stream of randomness, number 2. TEST3 Repeatable stream of randomness, number 3. TEST4 Repeatable streams of randomness, number 4.
-
Method Summary
All Methods Static Methods Concrete MethodsModifier and Type Method and Description static Set<RandomMode> getTestSet() Fetch the set of all test-related values. static RandomMode valueOf(String name) Returns the enum constant of this type with the specified name. static RandomMode[] values() Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NORMAL
public static final RandomMode NORMAL
Stream of randomness that is not repeatable.
-
TEST1
public static final RandomMode TEST1
Repeatable stream of randomness number 1.
-
TEST2
public static final RandomMode TEST2
Repeatable stream of randomness, number 2.
-
TEST3
public static final RandomMode TEST3
Repeatable stream of randomness, number 3.
-
TEST4
public static final RandomMode TEST4
Repeatable streams of randomness, number 4.
-
-
Method Detail
-
values
public static RandomMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RandomMode c : RandomMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RandomMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name - the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException - if this enum type has no constant with the specified name
- NullPointerException - if the argument is null
-
getTestSet
public static Set<RandomMode> getTestSet()
Fetch the set of all test-related values. This set includes all RandomMode values except NORMAL.- Returns:
- set of test-related values.
-
-
- Package
- Class
- Deprecated
- Index
- Help
- Summary:
- Nested |
- Enum Constants |
- Field |
- Method
- Detail:
- Enum Constants |
- Field |
- Method
edu/vt/cs5044/tetris/Placement.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
Class Placement
- Object
-
- Placement
-
public class Placement extends Object
Represents a single possible placement of a shape. The placement is specified by a rotation along with the horizontal location of the left-most block of the rotated shape
-
-
Constructor Summary
ConstructorsConstructor and Description Placement(Rotation rotation, int column) Construct a new object with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete MethodsModifier and Type Method and Description boolean equals(Object obj) Test for equality with another Placement. int getColumn() Fetch specified column. Rotation getRotation() Fetch specified rotation. int hashCode() String toString() Generates a simple human-readable representation of this object.
-
-
-
Constructor Detail
-
Placement
public Placement(Rotation rotation, int column)
Construct a new object with the specified parameters.- Parameters:
- rotation - number of rotations to apply to the shape.
- column - left-most block of the rotated shape goes in this column.
-
-
Method Detail
-
getRotation
public Rotation getRotation()
Fetch specified rotation.- Returns:
- rotation.
-
getColumn
public int getColumn()
Fetch specified column. The left-most column of the board is 0. The left-most block of the rotated shape goes in the specified column.- Returns:
- column.
-
toString
public String toString()
Generates a simple human-readable representation of this object.- Overrides:
- toString in class Object
- Returns:
- simple representation of this object.
-
equals
public boolean equals(Object obj)
Test for equality with another Placement. Two placements are equal if and only if they contain the same column and rotation values.- Overrides:
- equals in class Object
- Parameters:
- obj - the other placement.
- Returns:
- true if the placements are equivalent; false otherwise.
-
hashCode
public int hashCode()
- Overrides:
- hashCode in class Object
-
-
- Package
- Class
- Deprecated
- Index
- Help
edu/vt/cs5044/tetris/Board.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
Class Board
- Object
-
- Board
-
public class Board extends Object
Represents a Tetris game board, including all fixed blocks. This class is effectively immutable, because there are no public mutators.
-
-
Field Summary
FieldsModifier and Type Field and Description static int HEIGHT Height of all game boards, in blocks. static int HEIGHT_LIMIT Height limit of all game boards, in blocks. static int WIDTH Width of all game boards, in blocks.
-
Constructor Summary
ConstructorsConstructor and Description Board() Construct a new empty board with no fixed blocks. Board(String... initialBlocks) Construct a new board with the specified initial blocks.
-
Method Summary
All Methods Instance Methods Concrete MethodsModifier and Type Method and Description boolean equals(Object obj) Test for equality with another Board. Board getResultBoard(Shape shape, Placement place) Generate a new board that is the result of placing a shape in this board. int hashCode() boolean isBlockAt(int col, int row) Check for a fixed block at a specified location. String toString() Generate a multi-line ASCII art visualization of this board.
-
-
-
Field Detail
-
WIDTH
public static final int WIDTH
Width of all game boards, in blocks.- See Also:
- Constant Field Values
-
HEIGHT
public static final int HEIGHT
Height of all game boards, in blocks.- See Also:
- Constant Field Values
-
HEIGHT_LIMIT
public static final int HEIGHT_LIMIT
Height limit of all game boards, in blocks. If any block becomes fixed at or above this row index, the game ends.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Board
public Board()
Construct a new empty board with no fixed blocks.
-
Board
public Board(String... initialBlocks)
Construct a new board with the specified initial blocks. Specify a variable number of String values as arguments. Each String represents one row of the board. The last row is placed at the bottom of the board. No more than HEIGHT_LIMIT rows may be specified. If fewer rows are specified, the unspecified rows will be empty. Each row must have exactly WIDTH characters. The first character represents the left edge of the board. Each character must be either a space ' ' or a hash '#'. A hash means a single fixed block exists at that position. A space means no fixed block exists at that position.- Parameters:
- initialBlocks - blocks to include in the board
-
-
Method Detail
-
isBlockAt
public boolean isBlockAt(int col, int row)Check for a fixed block at a specified location.- Parameters:
- col - column number; left-most column is zero
- row - row number; bottom-most row is zero
- Returns:
- true if a fixed block is at this location; false otherwise
-
getResultBoard
public Board getResultBoard(Shape shape, Placement place)
Generate a new board that is the result of placing a shape in this board. First a copy of this board is created. The shape is placed at the top of this copy, rotated according to the placement, then moved horizontally such that the left-most block is in the specified column. The block is then dropped until it locks into place, then all completely full rows (if any) are cleared as in normal play. The result of this activity is returned.Note: This method is not a mutator; it does not change this board object.
- Parameters:
- shape - the Shape to place.
- place - a Placement containing the rotation and location of the shape.
- Returns:
- a new Board representing the result of the placement.
-
toString
public String toString()
Generate a multi-line ASCII art visualization of this board. The walls of the board are represented as '*' characters above the HEIGHT_LIMIT, and as '|' characters otherwise. The bottom of the board is represented by a row of '-' characters. Fixed blocks are represented by '#' characters.- Overrides:
- toString in class Object
- Returns:
- a rudimentary depiction of the board.
-
equals
public boolean equals(Object obj)
Test for equality with another Board. Two boards are equal if and only if they contain the same arrangement of fixed blocks.- Overrides:
- equals in class Object
- Parameters:
- obj - the other board.
- Returns:
- true if the boards are equivalent; false otherwise.
-
hashCode
public int hashCode()
- Overrides:
- hashCode in class Object
-
-
- Package
- Class
- Deprecated
- Index
- Help
edu/vt/cs5044/tetris/AI.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Prev Class
- Next Class
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
Interface AI
-
public interface AI
Interface the game engine uses to communicate with AI implementations. You must develop an implementation of this interface.
-
-
Method Summary
All Methods Instance Methods Abstract MethodsModifier and Type Method and Description Placement findBestPlacement(Board currentBoard, Shape shape) Calculate the best placement available for a shape in a board. int getColumnHeightVariability(Board board) Return the variability of column heights of a board (see academic note). int getMaximumBlockHeight(Board board) Compute the maximum block height of a board (see academic note). int getTotalBlockCount(Board board) Compute the total block count of a board (see academic note). int getTotalGapCount(Board board) Compute the total gap count of a board (see academic note).
-
-
-
Method Detail
-
findBestPlacement
Placement findBestPlacement(Board currentBoard, Shape shape)
Calculate the best placement available for a shape in a board. All possible columns for all possible rotations of the given shape should be considered. For each combination, implementations should call Board.getResultBoard(Shape, Placement) to generate the resultant board after a hypothetical placement. The implementation must calculate a relative cost value for ech resultant board, then return the Placement object associated with the lowest cost (most preferable).- Parameters:
- currentBoard - the existing board.
- shape - the shape to be placed in the board.
- Returns:
- the best move as computed by the implementation.
-
getMaximumBlockHeight
int getMaximumBlockHeight(Board board)
Compute the maximum block height of a board (see academic note). Finds the height of the upper-most block within a board. Note that a block in row r has a height of r+1.ACADEMIC NOTE: This method would normally be declared as private. We're exposing it as public only for testing purposes.
- Parameters:
- board - the Board to evaluate.
- Returns:
- the height of the of block in the largest row number.
-
getTotalBlockCount
int getTotalBlockCount(Board board)
Compute the total block count of a board (see academic note). Counts the total number of blocks residing within a board.ACADEMIC NOTE: This method would normally be declared as private. We're exposing it as public only for testing purposes.
- Parameters:
- board - the Board to evaluate.
- Returns:
- the total number of blocks.
-
getTotalGapCount
int getTotalGapCount(Board board)
Compute the total gap count of a board (see academic note). Counts the number of gaps residing within a board. A gap is a location without a block, where a block exists in any higher row of the same column.ACADEMIC NOTE: This method would normally be declared as private. We're exposing it as public only for testing purposes.
- Parameters:
- board - the Board to evaluate.
- Returns:
- the number of gaps.
-
getColumnHeightVariability
int getColumnHeightVariability(Board board)
Return the variability of column heights of a board (see academic note). The variability is defined here as the sum of the absolute values of differences in heights of adjacent columns, as measure from either edge of the board to the other. Note that for a board width w, there are w-1 adjacent column heights.ACADEMIC NOTE: This method would normally be declared as private. We're exposing it as public only for testing purposes.
- Parameters:
- board - the Board to evaluate.
- Returns:
- the variability of column heights.
-
-
- Package
- Class
- Deprecated
- Index
- Help
- Prev Class
- Next Class
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
edu/vt/cs5044/tetris/package-summary.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Prev Package
- Next Package
Package edu.vt.cs5044.tetris
This package holds the internal components necessary for the game.See: Description
-
Interface Summary
Interface Description AI Interface the game engine uses to communicate with AI implementations. -
Class Summary
Class Description Board Represents a Tetris game board, including all fixed blocks. Placement Represents a single possible placement of a shape. ShapeStream Used to generate a stream of random shapes for a game of Tetris. Tetris5044 The main application class; for internal use only. -
Enum Summary
Enum Description RandomMode Enumerates the modes of randomness used for generating shapes for games of tetris. Rotation Enumeration representing each of the four distinct rotations in Tetris. Shape Enumeration representing each of the seven distinct tetromino shapes.
Package edu.vt.cs5044.tetris Description
This package holds the internal components necessary for the game. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Prev Package
- Next Package
edu/vt/cs5044/tetris/ShapeStream.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
Class ShapeStream
- Object
-
- ShapeStream
-
public class ShapeStream extends Object
Used to generate a stream of random shapes for a game of Tetris.
-
-
Constructor Summary
ConstructorsConstructor and Description ShapeStream(RandomMode mode) Construct a new ShapeStream in the specified RandomMode.
-
Method Summary
All Methods Instance Methods Concrete MethodsModifier and Type Method and Description Shape nextShape() Fetch the next random Shape from this stream.
-
-
-
Constructor Detail
-
ShapeStream
public ShapeStream(RandomMode mode)
Construct a new ShapeStream in the specified RandomMode.- Parameters:
- mode - specifies the strategy for generating the random sequence; must not be null.
-
-
Method Detail
-
nextShape
public Shape nextShape()
Fetch the next random Shape from this stream.- Returns:
- the next random Shape from this stream.
-
-
- Package
- Class
- Deprecated
- Index
- Help
edu/vt/cs5044/tetris/Shape.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Summary:
- Nested |
- Enum Constants |
- Field |
- Method
- Detail:
- Enum Constants |
- Field |
- Method
Enum Shape
- Object
-
- Enum<Shape>
-
- Shape
-
- All Implemented Interfaces:
- Serializable, Comparable<Shape>
public enum Shape extends Enum<Shape>
Enumeration representing each of the seven distinct tetromino shapes.
-
-
Enum Constant Summary
Enum ConstantsEnum Constant and Description I The "I" shape. J The "J" shape. L The "L" shape. O The "O" shape. S The "S" shape. T The "T" shape. Z The "Z" shape.
-
Method Summary
All Methods Static Methods Instance Methods Concrete MethodsModifier and Type Method and Description Set<Rotation> getRotationSet() Get the set of valid rotations for this shape. int getWidth(Rotation r) Get the width of this shape, in blocks, after applying a specified rotation. static Shape valueOf(String name) Returns the enum constant of this type with the specified name. static Shape[] values() Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
I
public static final Shape I
The "I" shape.
-
O
public static final Shape O
The "O" shape.
-
T
public static final Shape T
The "T" shape.
-
J
public static final Shape J
The "J" shape.
-
L
public static final Shape L
The "L" shape.
-
S
public static final Shape S
The "S" shape.
-
Z
public static final Shape Z
The "Z" shape.
-
-
Method Detail
-
values
public static Shape[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Shape c : Shape.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Shape valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name - the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException - if this enum type has no constant with the specified name
- NullPointerException - if the argument is null
-
getRotationSet
public Set<Rotation> getRotationSet()
Get the set of valid rotations for this shape. Returns a set of Rotation values that can be applied to this shape to result in distinct orientations.- Returns:
- the a set of Rotation values.
-
getWidth
public int getWidth(Rotation r)
Get the width of this shape, in blocks, after applying a specified rotation. The rotation parameter must be contained in the Set returned by getRotationSet().- Parameters:
- r - the rotation to apply.
- Returns:
- the width of the rotated shape, in blocks.
-
-
- Package
- Class
- Deprecated
- Index
- Help
- Summary:
- Nested |
- Enum Constants |
- Field |
- Method
- Detail:
- Enum Constants |
- Field |
- Method
edu/vt/cs5044/tetris/Rotation.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Summary:
- Nested |
- Enum Constants |
- Field |
- Method
- Detail:
- Enum Constants |
- Field |
- Method
Enum Rotation
- Object
-
- Enum<Rotation>
-
- Rotation
-
- All Implemented Interfaces:
- Serializable, Comparable<Rotation>
public enum Rotation extends Enum<Rotation>
Enumeration representing each of the four distinct rotations in Tetris.
-
-
Enum Constant Summary
Enum ConstantsEnum Constant and Description CCW_180 Rotate 180° counter-clockwise. CCW_270 Rotate 270° counter-clockwise. CCW_90 Rotate 90° counter-clockwise. NONE No rotation; the default orientation.
-
Method Summary
All Methods Static Methods Concrete MethodsModifier and Type Method and Description static Rotation valueOf(String name) Returns the enum constant of this type with the specified name. static Rotation[] values() Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final Rotation NONE
No rotation; the default orientation.
-
CCW_90
public static final Rotation CCW_90
Rotate 90° counter-clockwise.
-
CCW_180
public static final Rotation CCW_180
Rotate 180° counter-clockwise.
-
CCW_270
public static final Rotation CCW_270
Rotate 270° counter-clockwise.
-
-
Method Detail
-
values
public static Rotation[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Rotation c : Rotation.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Rotation valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name - the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException - if this enum type has no constant with the specified name
- NullPointerException - if the argument is null
-
-
- Package
- Class
- Deprecated
- Index
- Help
- Summary:
- Nested |
- Enum Constants |
- Field |
- Method
- Detail:
- Enum Constants |
- Field |
- Method
help-doc.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Prev
- Next
How This API Document Is Organized
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.-
Package
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
- Interfaces (italic)
- Classes
- Enums
- Exceptions
- Errors
- Annotation Types
-
Class/Interface
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
- Class inheritance diagram
- Direct Subclasses
- All Known Subinterfaces
- All Known Implementing Classes
- Class/interface declaration
- Class/interface description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Detail
- Constructor Detail
- Method Detail
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
-
Annotation Type
Each annotation type has its own separate page with the following sections:
- Annotation Type declaration
- Annotation Type description
- Required Element Summary
- Optional Element Summary
- Element Detail
-
Enum
Each enum has its own separate page with the following sections:
- Enum declaration
- Enum description
- Enum Constant Summary
- Enum Constant Detail
-
Deprecated API
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
-
Index
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
-
Prev/Next
These links take you to the next or previous class, interface, package, or related page.
-
Frames/No Frames
These links show and hide the HTML frames. All pages are available with or without frames.
-
All Classes
The All Classes link shows all classes and interfaces except non-static nested types.
-
Serialized Form
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
-
Constant Field Values
The Constant Field Values page lists the static final fields and their values.
- Package
- Class
- Deprecated
- Index
- Help
- Prev
- Next
index-all.html
JavaScript is disabled on your browser. Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Prev
- Next
A
- AI - Interface in edu.vt.cs5044.tetris
- Interface the game engine uses to communicate with AI implementations.
B
- Board - Class in edu.vt.cs5044.tetris
- Represents a Tetris game board, including all fixed blocks.
- Board() - Constructor for class Board
- Construct a new empty board with no fixed blocks.
- Board(String...) - Constructor for class Board
- Construct a new board with the specified initial blocks.
E
- edu.vt.cs5044.tetris - package edu.vt.cs5044.tetris
- This package holds the internal components necessary for the game.
- equals(Object) - Method in class Board
- Test for equality with another Board.
- equals(Object) - Method in class Placement
- Test for equality with another Placement.
F
- findBestPlacement(Board, Shape) - Method in interface AI
- Calculate the best placement available for a shape in a board.
G
- getColumn() - Method in class Placement
- Fetch specified column.
- getColumnHeightVariability(Board) - Method in interface AI
- Return the variability of column heights of a board (see academic note).
- getMaximumBlockHeight(Board) - Method in interface AI
- Compute the maximum block height of a board (see academic note).
- getResultBoard(Shape, Placement) - Method in class Board
- Generate a new board that is the result of placing a shape in this board.
- getRotation() - Method in class Placement
- Fetch specified rotation.
- getRotationSet() - Method in enum Shape
- Get the set of valid rotations for this shape.
- getTestSet() - Static method in enum RandomMode
- Fetch the set of all test-related values.
- getTotalBlockCount(Board) - Method in interface AI
- Compute the total block count of a board (see academic note).
- getTotalGapCount(Board) - Method in interface AI
- Compute the total gap count of a board (see academic note).
- getWidth(Rotation) - Method in enum Shape
- Get the width of this shape, in blocks, after applying a specified rotation.
H
- hashCode() - Method in class Board
- hashCode() - Method in class Placement
- HEIGHT - Static variable in class Board
- Height of all game boards, in blocks.
- HEIGHT_LIMIT - Static variable in class Board
- Height limit of all game boards, in blocks.
I
- isBlockAt(int, int) - Method in class Board
- Check for a fixed block at a specified location.
M
- main(String[]) - Static method in class Tetris5044
- For internal use only.
N
- nextShape() - Method in class ShapeStream
- Fetch the next random Shape from this stream.
P
- Placement - Class in edu.vt.cs5044.tetris
- Represents a single possible placement of a shape.
- Placement(Rotation, int) - Constructor for class Placement
- Construct a new object with the specified parameters.
R
- RandomMode - Enum in edu.vt.cs5044.tetris
- Enumerates the modes of randomness used for generating shapes for games of tetris.
- Rotation - Enum in edu.vt.cs5044.tetris
- Enumeration representing each of the four distinct rotations in Tetris.
S
- Shape - Enum in edu.vt.cs5044.tetris
- Enumeration representing each of the seven distinct tetromino shapes.
- ShapeStream - Class in edu.vt.cs5044.tetris
- Used to generate a stream of random shapes for a game of Tetris.
- ShapeStream(RandomMode) - Constructor for class ShapeStream
- Construct a new ShapeStream in the specified RandomMode.
- start(Stage) - Method in class Tetris5044
- For internal use only.
T
- Tetris5044 - Class in edu.vt.cs5044.tetris
- The main application class; for internal use only.
- Tetris5044() - Constructor for class Tetris5044
- toString() - Method in class Board
- Generate a multi-line ASCII art visualization of this board.
- toString() - Method in class Placement
- Generates a simple human-readable representation of this object.
V
- valueOf(String) - Static method in enum RandomMode
- Returns the enum constant of this type with the specified name.
- valueOf(String) - Static method in enum Rotation
- Returns the enum constant of this type with the specified name.
- valueOf(String) - Static method in enum Shape
- Returns the enum constant of this type with the specified name.
- values() - Static method in enum RandomMode
- Returns an array containing the constants of this enum type, in the order they are declared.
- values() - Static method in enum Rotation
- Returns an array containing the constants of this enum type, in the order they are declared.
- values() - Static method in enum Shape
- Returns an array containing the constants of this enum type, in the order they are declared.
W
A B E F G H I M N P R S T V W Skip navigation links- Package
- Class
- Deprecated
- Index
- Help
- Prev
- Next
index.html
package-list
edu.vt.cs5044.tetris
script.js
function show(type) { count = 0; for (var key in methods) { var row = document.getElementById(key); if ((methods[key] & type) != 0) { row.style.display = ''; row.className = (count++ % 2) ? rowColor : altColor; } else row.style.display = 'none'; } updateTabs(type); } function updateTabs(type) { for (var value in tabs) { var sNode = document.getElementById(tabs[value][0]); var spanNode = sNode.firstChild; if (value == type) { sNode.className = activeTableTab; spanNode.innerHTML = tabs[value][1]; } else { sNode.className = tableTab; spanNode.innerHTML = "<a href=\"javascript:show("+ value + ");\">" + tabs[value][1] + "</a>"; } } }
stylesheet.css
/* Javadoc style sheet */ /* Overall document style */ @import url('resources/fonts/dejavu.css'); body { background-color:#ffffff; color:#353833; font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; font-size:14px; margin:0; } a:link, a:visited { text-decoration:none; color:#4A6782; } a:hover, a:focus { text-decoration:none; color:#bb7a2a; } a:active { text-decoration:none; color:#4A6782; } a[name] { color:#353833; } a[name]:hover { text-decoration:none; color:#353833; } pre { font-family:'DejaVu Sans Mono', monospace; font-size:14px; } h1 { font-size:20px; } h2 { font-size:18px; } h3 { font-size:16px; font-style:italic; } h4 { font-size:13px; } h5 { font-size:12px; } h6 { font-size:11px; } ul { list-style-type:disc; } code, tt { font-family:'DejaVu Sans Mono', monospace; font-size:14px; padding-top:4px; margin-top:8px; line-height:1.4em; } dt code { font-family:'DejaVu Sans Mono', monospace; font-size:14px; padding-top:4px; } table tr td dt code { font-family:'DejaVu Sans Mono', monospace; font-size:14px; vertical-align:top; padding-top:4px; } sup { font-size:8px; } /* Document title and Copyright styles */ .clear { clear:both; height:0px; overflow:hidden; } .aboutLanguage { float:right; padding:0px 21px; font-size:11px; z-index:200; margin-top:-9px; } .legalCopy { margin-left:.5em; } .bar a, .bar a:link, .bar a:visited, .bar a:active { color:#FFFFFF; text-decoration:none; } .bar a:hover, .bar a:focus { color:#bb7a2a; } .tab { background-color:#0066FF; color:#ffffff; padding:8px; width:5em; font-weight:bold; } /* Navigation bar styles */ .bar { background-color:#4D7A97; color:#FFFFFF; padding:.8em .5em .4em .8em; height:auto;/*height:1.8em;*/ font-size:11px; margin:0; } .topNav { background-color:#4D7A97; color:#FFFFFF; float:left; padding:0; width:100%; clear:right; height:2.8em; padding-top:10px; overflow:hidden; font-size:12px; } .bottomNav { margin-top:10px; background-color:#4D7A97; color:#FFFFFF; float:left; padding:0; width:100%; clear:right; height:2.8em; padding-top:10px; overflow:hidden; font-size:12px; } .subNav { background-color:#dee3e9; float:left; width:100%; overflow:hidden; font-size:12px; } .subNav div { clear:left; float:left; padding:0 0 5px 6px; text-transform:uppercase; } ul.navList, ul.subNavList { float:left; margin:0 25px 0 0; padding:0; } ul.navList li{ list-style:none; float:left; padding: 5px 6px; text-transform:uppercase; } ul.subNavList li{ list-style:none; float:left; } .topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { color:#FFFFFF; text-decoration:none; text-transform:uppercase; } .topNav a:hover, .bottomNav a:hover { text-decoration:none; color:#bb7a2a; text-transform:uppercase; } .navBarCell1Rev { background-color:#F8981D; color:#253441; margin: auto 5px; } .skipNav { position:absolute; top:auto; left:-9999px; overflow:hidden; } /* Page header and footer styles */ .header, .footer { clear:both; margin:0 20px; padding:5px 0 0 0; } .indexHeader { margin:10px; position:relative; } .indexHeader span{ margin-right:15px; } .indexHeader h1 { font-size:13px; } .title { color:#2c4557; margin:10px 0; } .subTitle { margin:5px 0 0 0; } .header ul { margin:0 0 15px 0; padding:0; } .footer ul { margin:20px 0 5px 0; } .header ul li, .footer ul li { list-style:none; font-size:13px; } /* Heading styles */ div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { background-color:#dee3e9; border:1px solid #d0d9e0; margin:0 0 6px -8px; padding:7px 5px; } ul.blockList ul.blockList ul.blockList li.blockList h3 { background-color:#dee3e9; border:1px solid #d0d9e0; margin:0 0 6px -8px; padding:7px 5px; } ul.blockList ul.blockList li.blockList h3 { padding:0; margin:15px 0; } ul.blockList li.blockList h2 { padding:0px 0 20px 0; } /* Page layout container styles */ .contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer { clear:both; padding:10px 20px; position:relative; } .indexContainer { margin:10px; position:relative; font-size:12px; } .indexContainer h2 { font-size:13px; padding:0 0 3px 0; } .indexContainer ul { margin:0; padding:0; } .indexContainer ul li { list-style:none; padding-top:2px; } .contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { font-size:12px; font-weight:bold; margin:10px 0 0 0; color:#4E4E4E; } .contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { margin:5px 0 10px 0px; font-size:14px; font-family:'DejaVu Sans Mono',monospace; } .serializedFormContainer dl.nameValue dt { margin-left:1px; font-size:1.1em; display:inline; font-weight:bold; } .serializedFormContainer dl.nameValue dd { margin:0 0 0 1px; font-size:1.1em; display:inline; } /* List styles */ ul.horizontal li { display:inline; font-size:0.9em; } ul.inheritance { margin:0; padding:0; } ul.inheritance li { display:inline; list-style:none; } ul.inheritance li ul.inheritance { margin-left:15px; padding-left:15px; padding-top:1px; } ul.blockList, ul.blockListLast { margin:10px 0 10px 0; padding:0; } ul.blockList li.blockList, ul.blockListLast li.blockList { list-style:none; margin-bottom:15px; line-height:1.4; } ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { padding:0px 20px 5px 10px; border:1px solid #ededed; background-color:#f8f8f8; } ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { padding:0 0 5px 8px; background-color:#ffffff; border:none; } ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { margin-left:0; padding-left:0; padding-bottom:15px; border:none; } ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { list-style:none; border-bottom:none; padding-bottom:0; } table tr td dl, table tr td dl dt, table tr td dl dd { margin-top:0; margin-bottom:1px; } /* Table styles */ .overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary { width:100%; border-left:1px solid #EEE; border-right:1px solid #EEE; border-bottom:1px solid #EEE; } .overviewSummary, .memberSummary { padding:0px; } .overviewSummary caption, .memberSummary caption, .typeSummary caption, .useSummary caption, .constantsSummary caption, .deprecatedSummary caption { position:relative; text-align:left; background-repeat:no-repeat; color:#253441; font-weight:bold; clear:none; overflow:hidden; padding:0px; padding-top:10px; padding-left:1px; margin:0px; white-space:pre; } .overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, .useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link, .overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, .useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover, .overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, .useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active, .overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, .useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited { color:#FFFFFF; } .overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, .useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span { white-space:nowrap; padding-top:5px; padding-left:12px; padding-right:12px; padding-bottom:7px; display:inline-block; float:left; background-color:#F8981D; border: none; height:16px; } .memberSummary caption span.activeTableTab span { white-space:nowrap; padding-top:5px; padding-left:12px; padding-right:12px; margin-right:3px; display:inline-block; float:left; background-color:#F8981D; height:16px; } .memberSummary caption span.tableTab span { white-space:nowrap; padding-top:5px; padding-left:12px; padding-right:12px; margin-right:3px; display:inline-block; float:left; background-color:#4D7A97; height:16px; } .memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab { padding-top:0px; padding-left:0px; padding-right:0px; background-image:none; float:none; display:inline; } .overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, .useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd { display:none; width:5px; position:relative; float:left; background-color:#F8981D; } .memberSummary .activeTableTab .tabEnd { display:none; width:5px; margin-right:3px; position:relative; float:left; background-color:#F8981D; } .memberSummary .tableTab .tabEnd { display:none; width:5px; margin-right:3px; position:relative; background-color:#4D7A97; float:left; } .overviewSummary td, .memberSummary td, .typeSummary td, .useSummary td, .constantsSummary td, .deprecatedSummary td { text-align:left; padding:0px 0px 12px 10px; width:100%; } th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th, td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{ vertical-align:top; padding-right:0px; padding-top:8px; padding-bottom:3px; } th.colFirst, th.colLast, th.colOne, .constantsSummary th { background:#dee3e9; text-align:left; padding:8px 3px 3px 7px; } td.colFirst, th.colFirst { white-space:nowrap; font-size:13px; } td.colLast, th.colLast { font-size:13px; } td.colOne, th.colOne { font-size:13px; } .overviewSummary td.colFirst, .overviewSummary th.colFirst, .overviewSummary td.colOne, .overviewSummary th.colOne, .memberSummary td.colFirst, .memberSummary th.colFirst, .memberSummary td.colOne, .memberSummary th.colOne, .typeSummary td.colFirst{ width:25%; vertical-align:top; } td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover { font-weight:bold; } .tableSubHeadingColor { background-color:#EEEEFF; } .altColor { background-color:#FFFFFF; } .rowColor { background-color:#EEEEEF; } /* Content styles */ .description pre { margin-top:0; } .deprecatedContent { margin:0; padding:10px 0; } .docSummary { padding:0; } ul.blockList ul.blockList ul.blockList li.blockList h3 { font-style:normal; } div.block { font-size:14px; font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; } td.colLast div { padding-top:0px; } td.colLast a { padding-bottom:3px; } /* Formatting effect styles */ .sourceLineNo { color:green; padding:0 30px 0 0; } h1.hidden { visibility:hidden; overflow:hidden; font-size:10px; } .block { display:block; margin:3px 10px 2px 0px; color:#474747; } .deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink, .overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel, .seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink { font-weight:bold; } .deprecationComment, .emphasizedPhrase, .interfaceName { font-style:italic; } div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase, div.block div.block span.interfaceName { font-style:normal; } div.contentContainer ul.blockList li.blockList h2{ padding-bottom:0px; }