MultiGridLevel class

A level which presents a series of rows, each one containing different information.

At the top, the title will be shown. Moving down from that will present each entry in rows, with actions to the left, and entries to the right.

Inheritance

Constructors

MultiGridLevel({required Game game, required Message title, required List<MultiGridLevelRow> rows, void onCancel()?, int? verticalPosition, int? horizontalPosition, GameControllerAxis leftRightAxis = GameControllerAxis.leftx, ScanCode leftScanCode = ScanCode.left, ScanCode rightScanCode = ScanCode.right, GameControllerAxis upDownAxis = GameControllerAxis.lefty, ScanCode upScanCode = ScanCode.up, ScanCode downScanCode = ScanCode.down, GameControllerAxis activateAxis = GameControllerAxis.triggerright, ScanCode activateScanCode = ScanCode.space, GameControllerAxis cancelAxis = GameControllerAxis.triggerleft, ScanCode cancelScanCode = ScanCode.escape, double axisSensitivity = 0.5, int axisInterval = 400, AssetReference? music, List<Ambiance>? ambiances, List<RandomSound>? randomSounds, Map<String, Command>? commands})
Create an instance.

Properties

activateScanCode → ScanCode
The scan code that will call the activate method.
final
ambiancePlaybacks Map<Ambiance, SoundPlayback>
The playback settings for the list of ambiances.
finalinherited
ambiances List<Ambiance>
A list of ambiances for this level.
finalinherited
axisDispatcher ControllerAxisDispatcher
The axis controller for this level.
final
cancelScanCode → ScanCode
The scan code that will call the cancel method.
final
commandNextRuns List<NextRun<Command>>
The times before commands should run next.
finalinherited
commands Map<String, Command>
The commands this level recognises.
finalinherited
currentRow MultiGridLevelRow?
Get the current row.
no setter
downScanCode → ScanCode
The scan code that will call the down method.
final
game Game
The game this level is part of.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
horizontalPosition int?
Get the current horizontal position.
no setter
leftScanCode → ScanCode
The method that will call the left method.
final
music AssetReference?
The music for this level.
finalinherited
musicSound Sound?
The playing music.
getter/setter pairinherited
onCancel → (void Function()?)
What happens when this level is cancelled.
final
random Random
The game's random sound generator.
no setterinherited
randomSoundNextPlays List<NextRun<RandomSound>>
The times that randomSounds should play next.
finalinherited
randomSoundPlaybacks Map<RandomSound, SoundPlayback>
The playback settings for the list of randomSounds.
finalinherited
randomSounds List<RandomSound>
All the random sounds on this level.
finalinherited
rightScanCode → ScanCode
The scan code that will call the right method.
final
rows List<MultiGridLevelRow>
The rows of this level.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stoppedCommands List<NextRun<Command>>
The old command next runs.
finalinherited
title Message
The title of this level.
final
upScanCode → ScanCode
The scan code that will call the up method.
final
verticalPosition int?
Get the current vertical position.
getter/setter pair

Methods

activate() → void
Activate an object in the grid.
cancel() → void
Cancel this level.
down() → void
Move down in the list of rows.
getCommandNextRun(Command command) NextRun<Command>?
Get the next run value for the given command.
inherited
getRandomSoundNextPlay(RandomSound randomSound) NextRun<RandomSound>
Get the next run for the given randomSound.
inherited
handleSdlEvent(Event event) → void
Handle an SDL event.
override
left() → void
Move left through row values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCover(Level other) → void
What should happen when this level is covered by another level.
inherited
onPop(double? fadeLength) → void
What should happen when this level is popped from a level stack.
override
onPush({double? fadeLength}) → void
What should happen when this level is pushed into a level stack.
override
onReveal(Level old) → void
What should happen when this level is revealed by another level being popped from on top of it.
inherited
registerCommand(String name, Command command) → void
Register a command on this level.
inherited
Move right through row values.
runCommand(Command command) → void
Run the given command.
inherited
scheduleRandomSound(RandomSound sound) → void
Schedule a random sound to play.
inherited
showCurrent() → void
Show the label of the current object.
startCommand(String name) bool
Start the command with the given name.
inherited
stopCommand(String name) bool
Stop the command with the given name.
inherited
stopCommands(int timeDelta) → void
Remove any commands from the stoppedCommands list that can now be ran again.
inherited
stopPlayback(SoundPlayback playback) → void
Stop playback.
inherited
tick(int timeDelta) → void
Let this level tick.
inherited
tickCommands(int timeDelta) → void
Tick all commandNextRuns.
inherited
tickRandomSounds(int timeDelta) → void
Tick all random sounds.
inherited
toString() String
A string representation of this object.
inherited
up() → void
Move up in the list of rows.

Operators

operator ==(Object other) bool
The equality operator.
inherited