package bx

type BxArea interface {
	Build() []byte
	Length() int16
}

type BaseArea struct {
	BxArea
	typ byte
	x   uint16
	y   uint16
	w   uint16
	h   uint16
}

func NewBxArea(typ byte, x uint16, y uint16, w uint16, h uint16) BaseArea {
	return BaseArea{
		typ: typ,
		x:   x,
		y:   y,
		w:   w,
		h:   h,
	}
}

func (a *BaseArea) GetX() uint16 {
	return a.x
}

func (a *BaseArea) SetX(x uint16) {
	a.x = x
}

func (a *BaseArea) GetY() uint16 {
	return a.y
}

func (a *BaseArea) SetY(y uint16) {
	a.y = y
}

func (a *BaseArea) GetW() uint16 {
	return a.w
}

func (a *BaseArea) SetW(w uint16) {
	a.w = w
}

func (a *BaseArea) GetH() uint16 {
	return a.h
}

func (a *BaseArea) SetH(h uint16) {
	a.h = h
}
