toJSON method
Transforms this instance into a JSON object.
Implementation
Map<String,dynamic> toJSON() {
final Map<String,dynamic> json = {
'type': runtimeType.toString(),
'cells': [],
'width': width,
'height': height,
'depth': depth,
'cellsX': cellsX,
'cellsY': cellsY,
'cellsZ': cellsZ,
'_halfWidth': _halfWidth,
'_halfHeight': _halfHeight,
'_halfDepth': _halfDepth,
'_min': _min.storage,
'_max': _max.storage
};
for ( int i = 0, l = cells.length; i < l; i ++ ) {
json['cells'].add( cells[ i ].toJSON() );
}
return json;
}