import { ActionSerialized } from './ActionSerialized' ; import { Drawing } from './Drawing' ; import { Action } from "./Action" ; export class ActionRectangle extends Action { get xMax ( ) : number { return Math . max ( this . x1 , this . x2 ) ; } serializeData ( ) { return { type : "rectangle" , pause : this . pause , userid : this . userid , x1 : this . x1 , y1 : this . y1 , x2 : this . x2 , y2 : this . y2 , color : this . color } ; } constructor ( userid , private x1 , private y1 , private x2 , private y2 , private color ) { super ( userid ) ; } createOverviewImage ( ) { return "url(img/icons/25AD.svg)" ; } async redo ( ) { Drawing . drawRectangle ( { x1 : this . x1 , y1 : this . y1 , x2 : this . x2 , y2 : this . y2 } , this . color ) ; } }