PopPop<S extends PopPopState, T extends Object> class
abstract
The base logic that runs the game.
Provides the building blocks to build around a different architecture or extend upon for additional functionality.
Constructors
-
PopPop({required PopPopBubbleTheme bubbleTheme, PopPopAudio? audioPlayer, PopPopTimer<
T> ? timer, bool loggingEnabled = false}) -
Creates an implementation of a PopPop.
const
Properties
- audioPlayer → PopPopAudio?
-
Audio interface that is responsible for game sounds effects.
final
- bubbleTheme → PopPopBubbleTheme
-
Color theme of each of the game elements.
final
-
currentScoreStream
→ Stream<
int> -
A Stream<T> that can be used to expose the game time from the
timer
implementation, if desired. Emits the players current score.no setter -
gameStateStream
→ Stream<
S> -
The current state of the game.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- loggingEnabled → bool
-
Sets whether debug logging should be enabled.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
timer
→ PopPopTimer<
T> ? -
Optional timer interface for timed game modes.
final
Methods
-
cacheGameSizes(
{required int horizontalCount, required int verticalCount, required double bottomOffset, bool isStaggered = true}) → void - Cache the generated grid size/count for the device.
-
dispose(
) → void - Clean up and dispose of game resources and assets.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onBubblePopped(
) → void - Callback to alert the game that a bubble has been popped, and that the score should increment.
-
restartGame(
) → void - Restart the game state.
-
startGame(
) → void - Starts the game.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited