From fe79577396231f2edb7927f1f61ce814f03851a7 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 27 Feb 2022 17:12:49 +0100 Subject: add basic engine graphics --- src/interfaces/bounds.hpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/interfaces/bounds.hpp (limited to 'src/interfaces/bounds.hpp') diff --git a/src/interfaces/bounds.hpp b/src/interfaces/bounds.hpp new file mode 100644 index 0000000..9cec97e --- /dev/null +++ b/src/interfaces/bounds.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include "interfaces/vector2.hpp" + +#include +#include + +enum CoordsValidation +{ + VALID, + X_HIGH, + Y_HIGH +}; + +class IBounds +{ +public: + [[nodiscard]] virtual unsigned int width() const = 0; + + virtual void width(unsigned int width) = 0; + + [[nodiscard]] virtual unsigned int height() const = 0; + + virtual void height(unsigned int height) = 0; + + [[nodiscard]] virtual CoordsValidation + validate_coords(const IVector2 &coords) const = 0; + + virtual const IBounds &operator*=(const IBounds &bounds) = 0; + virtual const IBounds &operator+=(const IBounds &bounds) = 0; + virtual const IBounds &operator-=(const IBounds &bounds) = 0; +}; + +struct IBoundsOptions +{ + unsigned int width; + unsigned int height; +}; + +using IBoundsFactory = + std::function(const IBoundsOptions &options)>; -- cgit v1.2.3-18-g5258