Record Class GameEvent.FrozenBlocksChanged
java.lang.Object
java.lang.Record
edu.uw.tcss.model.GameEvent.FrozenBlocksChanged
- Record Components:
blocks- the frozen blocks statetimestamp- when the event was created (milliseconds since epoch)
- All Implemented Interfaces:
GameEvent
- Enclosing interface:
GameEvent
public static record GameEvent.FrozenBlocksChanged(GameControls.FrozenBlocks blocks, long timestamp)
extends Record
implements GameEvent
Event fired when the game's frozen blocks change state.
This occurs when the current movable piece freezes into place on the board.
This event provides type-safe access to the complete frozen blocks state. When fired, this event is associated with property name "FrozenBlocksChanged".
Note: Implementing classes may use GameControls.Block.EMPTY or null
for empty spaces in the collection. Please refer to implementation-specific
documentation for details.
Usage Example:
game.addPropertyChangeListener(evt -> {
if (evt.getNewValue() instanceof GameEvent.FrozenBlocksChanged e) {
redrawFrozenBlocks(e.blocks());
}
});
- Version:
- Winter 2025
- Author:
- Charles Bryan
-
Nested Class Summary
Nested classes/interfaces inherited from interface GameEvent
GameEvent.CurrentPieceChanged, GameEvent.FrozenBlocksChanged, GameEvent.GameStateChanged, GameEvent.NextPieceChanged, GameEvent.RowsCleared -
Constructor Summary
ConstructorsConstructorDescriptionFrozenBlocksChanged(GameControls.FrozenBlocks blocks, long timestamp) Creates an instance of aFrozenBlocksChangedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionblocks()Returns the value of theblocksrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface GameEvent
getPropertyName
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
blocks
-
timestamp
-