toMap method
Implementation
Map<String, dynamic> toMap() {
// ignore: unnecessary_cast
return {
'x': x,
'y': y,
'offsetX': offsetX,
'offsetY': offsetY,
'width': width,
'height': height,
'type': type,
'properties': properties,
'sprite': sprite?.toMap(),
'animation': animation?.toMap(),
'collisions': collisions?.map((e) {
return e.toMap();
}).toList(),
} as Map<String, dynamic>;
}