From f9448d36db7c076f5091f70b7921dceddf63fdf9 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Wed, 7 Feb 2018 15:18:48 -0500 Subject: Inlined some components --- src/components/transformable.h | 78 ++++++++++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 18 deletions(-) (limited to 'src/components/transformable.h') diff --git a/src/components/transformable.h b/src/components/transformable.h index 69f4f0e..6ed2637 100644 --- a/src/components/transformable.h +++ b/src/components/transformable.h @@ -4,24 +4,66 @@ #include "component.h" class TransformableComponent : public Component { - public: - TransformableComponent(double x, double y, int w, int h); - - double getX() const; - double getY() const; - int getW() const; - int getH() const; - - void setX(double v); - void setY(double v); - void setW(int v); - void setH(int v); - - private: - double x; - double y; - int w; - int h; +public: + + TransformableComponent( + double x, + double y, + int w, + int h) : + x_(x), + y_(y), + w_(w), + h_(h) + { + } + + inline double getX() const + { + return x_; + } + + inline void setX(double v) + { + x_ = v; + } + + inline double getY() const + { + return y_; + } + + inline void setY(double v) + { + y_ = v; + } + + inline int getW() const + { + return w_; + } + + inline void setW(int v) + { + w_ = v; + } + + inline int getH() const + { + return h_; + } + + inline void setH(int v) + { + h_ = v; + } + +private: + + double x_; + double y_; + int w_; + int h_; }; #endif /* end of include guard: LOCATABLE_H_39E526CA */ -- cgit 1.4.1