DimensionedWorld class

DimensionedWorld holds lengths in units logical pixels associated with rendering a GridWorld.

E.g. the size of a cell, the distance between cells in pixels, the size of the entire world rendered in pixels.

DimensionedWorld stores the GridWorld too, making it possible to offer the DimensionedWorld.expandToFit method.

Annotations

Constructors

DimensionedWorld.make(GridWorld w, {int lineWidth = 1, int cellWidth = 3})
Make a DimensionedWorld.
factory

Properties

cellSize Size
Cell size in logical pixels. Cells are square.
final
gridWorld → GridWorld
The world to be rendered.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unusedHeight double
Height left over from expandToFit.
final
unusedWidth double
Width left over from expandToFit.
final
worldSize Size
World size in logical pixels. Worlds are rectangular.
final

Methods

expandToFit(double width, double height) DimensionedWorld
Add rows and columns to the world, to give the automata as much space as possible to maneuver. This throws if the underlying GridWorld is already too big to fit into the new width and height. Could try using ClipRect over an oversized GridWorld.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offset(int i) double
Where is the left, top corner of (square) cell number i?
toString() String
A string representation of this object.
inherited

Operators

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