'use strict'

const assert = require('assert')
const validate = require('validate.js')
const occupy = require('./occupy-window')

module.exports = WindowWrapper

function WindowWrapper (window, x, y) {
  this.id = window.id
  this.width = window.width
  this.height = window.height
  this.x = x || 0
  this.y = y || 0
}

WindowWrapper.prototype.changeSize = function(width, height) {
  this.grid.representation = occupy(
    this.grid.representation,
    Object.assign({}, this, { width, height }),
    this
  )
  this.width = width
  this.height = height
}

@@ -551,8 +551,214 @@
 eight%0A%7D%0A
+%0AWindowWrapper.prototype.changeLocation = function(x, y) %7B%0A  this.grid.representation = occupy(%0A    this.grid.representation,%0A    Object.assign(%7B%7D, this, %7B x, y %7D),%0A    this%0A  )%0A  this.x = x%0A  this.y = y%0A%7D%0A

change window location