Tileson  1.3.0
A helpful json parser for Tiled maps
Rect.hpp
Go to the documentation of this file.
1 //
2 // Created by robin on 24.07.2020.
3 //
4 
5 #ifndef TILESON_RECT_HPP
6 #define TILESON_RECT_HPP
7 
8 namespace tson
9 {
10  class Rect
11  {
12  public:
13 
14  inline Rect();
15  inline Rect(int x_, int y_, int width_, int height_);
16 
17  inline bool operator==(const Rect &rhs) const;
18  inline bool operator!=(const Rect &rhs) const;
19 
20  int x;
21  int y;
22  int width;
23  int height;
24  };
25 
27  {
28 
29  }
30 
31  Rect::Rect(int x_, int y_, int width_, int height_)
32  {
33  x = x_;
34  y = y_;
35  width = width_;
36  height = height_;
37  }
38 
39  bool Rect::operator==(const Rect &rhs) const
40  {
41  return x == rhs.x &&
42  y == rhs.y &&
43  width == rhs.width &&
44  height == rhs.height;
45  }
46 
47  bool Rect::operator!=(const Rect &rhs) const
48  {
49  return !(rhs == *this);
50  }
51 }
52 
53 #endif //TILESON_RECT_HPP
Definition: Rect.hpp:11
int height
Definition: Rect.hpp:23
int width
Definition: Rect.hpp:22
int y
Definition: Rect.hpp:21
bool operator==(const Rect &rhs) const
Definition: Rect.hpp:39
Rect()
Definition: Rect.hpp:26
int x
Definition: Rect.hpp:20
bool operator!=(const Rect &rhs) const
Definition: Rect.hpp:47
Definition: Base64.hpp:12