AxelMap class

Two-dimensional array of axels.

Inheritance

Constructors

AxelMap(Iterable<Iterable<Axel>> axels)
Two-dimensional array of axels.
AxelMap.empty(int width, int height)
Generate a map containing spaces.
AxelMap.filled(int width, int height, Axel axel)
Generate a map filled with the provided axel.

Properties

asColumns Iterable<Iterable<Axel>>
Returns a copy of this map rotated by 90 degrees.
no setter
data List<List<Axel>>
Contained data.
final
first Iterable<Axel>
The first element.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
height int
Height of this map.
no setter
isEmpty bool
Whether this collection has no elements.
no setterinherited
isNotEmpty bool
Whether this collection has at least one element.
no setterinherited
iterator Iterator<Iterable<Axel>>
A new Iterator that allows iterating the elements of this Iterable.
no setteroverride
last Iterable<Axel>
The last element.
no setterinherited
length int
The number of elements in this Iterable.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
single Iterable<Axel>
Checks that this iterable has only one element, and returns that element.
no setterinherited
width int
Width of this map.
no setter

Methods

addColumn(Iterable<Axel> column, {bool start = false}) → void
Add a column to the right of this map. Left with []
addColumns(Iterable<Iterable<Axel>> columns, {bool start = false}) → void
Add columns to this map. Columns must all be the same size, and the same length as the height of this map. start causes them to be added to the left side of the map instead of the right.
addRow(Iterable<Axel> row, {bool start = false}) → void
Add a row. Defaults to the bottom, top with start. Length must be equal to this map's width.
addRows(Iterable<Iterable<Axel>> rows, {bool start = false}) → void
Add multiple rows as with addRow.
any(bool test(Iterable<Axel> element)) bool
Checks whether any element of this iterable satisfies test.
inherited
cast<R>() Iterable<R>
A view of this iterable as an iterable of R instances.
inherited
contains(Object? element) bool
Whether the collection contains an element equal to element.
inherited
editAxel(int row, int col, Axel editFunction(Axel)) → void
Update a single axel in the provided position.
elementAt(int index) Iterable<Axel>
Returns the indexth element.
inherited
every(bool test(Iterable<Axel> element)) bool
Checks whether every element of this iterable satisfies test.
inherited
expand<T>(Iterable<T> toElements(Iterable<Axel> element)) Iterable<T>
Expands each element of this Iterable into zero or more elements.
inherited
firstWhere(bool test(Iterable<Axel> element), {Iterable<Axel> orElse()?}) Iterable<Axel>
The first element that satisfies the given predicate test.
inherited
fold<T>(T initialValue, T combine(T previousValue, Iterable<Axel> element)) → T
Reduces a collection to a single value by iteratively combining each element of the collection with an existing value
inherited
followedBy(Iterable<Iterable<Axel>> other) Iterable<Iterable<Axel>>
Creates the lazy concatenation of this iterable and other.
inherited
forEach(void action(Iterable<Axel> element)) → void
Invokes action on each element of this iterable in iteration order.
inherited
getPosition(int x, int y) Axel?
Get axel from the specified position.
join([String separator = ""]) String
Converts each element to a String and concatenates the strings.
inherited
lastWhere(bool test(Iterable<Axel> element), {Iterable<Axel> orElse()?}) Iterable<Axel>
The last element that satisfies the given predicate test.
inherited
map<T>(T toElement(Iterable<Axel> e)) Iterable<T>
The current elements of this iterable modified by toElement.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideStyle({ColorPlaceholder? color, ColorPlaceholder? background, TextStyle? textStyle}) → void
Replace the color, background, or textStyle of all axels.
pad(int? width, int? height, {bool horizontalStart = true, bool verticalStart = true}) → void
Increases this map's size by padding it with spaces.
reduce(Iterable<Axel> combine(Iterable<Axel> value, Iterable<Axel> element)) Iterable<Axel>
Reduces a collection to a single value by iteratively combining elements of the collection using the provided function.
inherited
removeColumns(int number, {bool start = false}) → void
Remove number columns from the end (or start if start).
removeRows(int number, {bool start = false}) → void
Remove number rows from end, or start if start.
resize(int? width, int? height, {bool horizontalStart = true, bool verticalStart = true}) → void
Resizes this map to the provided sizes. horizontal/vertical start adds/removes lines from the end of the map.
resizeCentered(int? width, int? height) → void
Resizes this map to the provided sizes, keeping it centred.
setPosition(int x, int y, Axel axel) → void
Update a single axel.
singleWhere(bool test(Iterable<Axel> element), {Iterable<Axel> orElse()?}) Iterable<Axel>
The single element that satisfies test.
inherited
skip(int count) Iterable<Iterable<Axel>>
Creates an Iterable that provides all but the first count elements.
inherited
skipWhile(bool test(Iterable<Axel> value)) Iterable<Iterable<Axel>>
Creates an Iterable that skips leading elements while test is satisfied.
inherited
take(int count) Iterable<Iterable<Axel>>
Creates a lazy iterable of the count first elements of this iterable.
inherited
takeWhile(bool test(Iterable<Axel> value)) Iterable<Iterable<Axel>>
Creates a lazy iterable of the leading elements satisfying test.
inherited
toList({bool growable = true}) List<Iterable<Axel>>
Creates a List containing the elements of this Iterable.
inherited
toSet() Set<Iterable<Axel>>
Creates a Set containing the same elements as this iterable.
inherited
toString() String
Returns a string representation of (some of) the elements of this.
inherited
where(bool test(Iterable<Axel> element)) Iterable<Iterable<Axel>>
Creates a new lazy Iterable with all elements that satisfy the predicate test.
inherited
whereType<T>() Iterable<T>
Creates a new lazy Iterable with all elements that have type T.
inherited

Operators

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