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