Buffer class

A 2D grid of Cells representing a draw buffer.

Implementers

Constructors

Buffer(int width, int height)
Creates a new buffer of width by height initialized with transparent empty cells.
Buffer.blank(int width, int height)
Creates a new buffer of width by height initialized with solid blank cells.

Properties

cells List<Cell>
The flat list of cells representing the 2D grid.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
height int
The height of the buffer in rows.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
width int
The width of the buffer in columns.
getter/setter pair

Methods

clear() → void
Resets all cells in the buffer to transparent empty cells.
fill(Cell cell) → void
Fills the entire buffer with a copy of cell.
getCell(int x, int y) Cell?
Gets the cell at (x, y). Returns null if coordinates are out of bounds.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resize(int newWidth, int newHeight) → void
Resizes the buffer to the new dimensions, preserving existing content where it fits.
setCell(int x, int y, Cell cell) → void
Sets the cell at (x, y) to cell. Does nothing if coordinates are out of bounds.
toString() String
A string representation of this object.
inherited
writeString(int x, int y, String text, Style style) → void
Writes styled text to the buffer starting at (x, y).

Operators

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