BxArea.go 668 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package bx
  2. type BxArea interface {
  3. Build() []byte
  4. Length() int16
  5. }
  6. type bxArea struct {
  7. BxArea
  8. typ byte
  9. x int16
  10. y int16
  11. w int16
  12. h int16
  13. }
  14. func NewBxArea(typ byte, x int16, y int16, w int16, h int16) bxArea {
  15. return bxArea{
  16. typ: typ,
  17. x: x,
  18. y: y,
  19. w: w,
  20. h: h,
  21. }
  22. }
  23. func (a *bxArea) GetX() int16 {
  24. return a.x
  25. }
  26. func (a *bxArea) SetX(x int16) {
  27. a.x = x
  28. }
  29. func (a *bxArea) GetY() int16 {
  30. return a.y
  31. }
  32. func (a *bxArea) SetY(y int16) {
  33. a.y = y
  34. }
  35. func (a *bxArea) GetW() int16 {
  36. return a.w
  37. }
  38. func (a *bxArea) SetW(w int16) {
  39. a.w = w
  40. }
  41. func (a *bxArea) GetH() int16 {
  42. return a.h
  43. }
  44. func (a *bxArea) SetH(h int16) {
  45. a.h = h
  46. }