Add Grid.fill constructor
Will completely fill the grid with the value passed in.
This commit is contained in:
parent
eef7a23c8f
commit
2dc1d7fecd
2 changed files with 21 additions and 0 deletions
|
|
@ -10,6 +10,9 @@ class Grid<E> extends DelegatingList<E> {
|
|||
|
||||
Grid(int width, int height) : this._(List<E>(width * height), width, height);
|
||||
|
||||
Grid.fill(int width, int height, E fillValue)
|
||||
: this._(List<E>.filled(width * height, fillValue), width, height);
|
||||
|
||||
Grid.from(Grid<E> l)
|
||||
: this._(List<E>.from(l.getRange(0, l.length)), l.width, l.height);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue