Tileson 1.4.0
A helpful json parser for Tiled maps
Loading...
Searching...
No Matches
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
8namespace tson
9{
10 class Rect
11 {
12 public:
13
14 inline Rect() = default;
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
26 Rect::Rect(int x_, int y_, int width_, int height_)
27 {
28 x = x_;
29 y = y_;
30 width = width_;
31 height = height_;
32 }
33
34 bool Rect::operator==(const Rect &rhs) const
35 {
36 return x == rhs.x &&
37 y == rhs.y &&
38 width == rhs.width &&
39 height == rhs.height;
40 }
41
42 bool Rect::operator!=(const Rect &rhs) const
43 {
44 return !(rhs == *this);
45 }
46}
47
48#endif //TILESON_RECT_HPP
Definition Rect.hpp:11
int height
Definition Rect.hpp:23
int width
Definition Rect.hpp:22
Rect()=default
int y
Definition Rect.hpp:21
bool operator==(const Rect &rhs) const
Definition Rect.hpp:34
int x
Definition Rect.hpp:20
bool operator!=(const Rect &rhs) const
Definition Rect.hpp:42
Definition Base64.hpp:12