export default class Quest {

	private message: string = ''
	private messageTimeout: number = 0

	init(vars) {
		//
	}

	public draw(ctx: CanvasRenderingContext2D) {
		//
	}

	public update(dt) {
		//
	}

	public click(x, y) {
		//
	}

	public get result() {
		return false
	}

	public getCursor(x, y) {
		return 'default'
	}

	public showMessage(message, timeout = 5) {
		this.message = message
		this.messageTimeout = timeout
	}

	public updateInternal(dt) {
		if (this.messageTimeout > 0) {
			this.messageTimeout -= dt / 500
		}
	}

	public drawInternal(ctx: CanvasRenderingContext2D) {
		if (this.messageTimeout > 0) {
			ctx.fillStyle = 'rgba(75, 75, 75, 0.5)'
			ctx.fillRect(0, 250, 600, 60)

			ctx.font = '56px sans-serif'
			ctx.textAlign = 'center'
			ctx.fillStyle = '#a16356'
			ctx.fillText(this.message, 300, 300)
		}
	}

	public get actions() {
		return []
	}

}
