Record Class GameControls.IndividualPiece
java.lang.Object
java.lang.Record
edu.uw.tcss.model.GameControls.IndividualPiece
- Record Components:
location- the set of points for all four individual blocks that make up a single tetromino on the Game boardblock- the enum of the current tetromino
- Enclosing interface:
GameControls
public static record GameControls.IndividualPiece(GameControls.Point[] location, GameControls.Block block)
extends Record
Data class that represents a single Tetris tetromino in a location on the Tetris board.
The
Note, it is possible for some
Point[] location contains the points for all four individual
Block objects that make up a single tetromino on the Game board.
Note, it is possible for some
Block objects to be "above" the limit of
the game board size. This occurs when a new tetromino is added to the board and its
top half is outside the board.- Version:
- Autumn 25
- Author:
- Charles Bryan
-
Constructor Summary
ConstructorsConstructorDescriptionIndividualPiece(GameControls.Point[] location, GameControls.Block block) Creates an instance of aIndividualPiecerecord class. -
Method Summary
Modifier and TypeMethodDescriptionblock()Returns the value of theblockrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
location
-
block
-