]> git.localhorst.tv Git - l2e.git/blobdiff - src/graphics/Gauge.h
removed stupid file headers that eclipse put in
[l2e.git] / src / graphics / Gauge.h
index b5e30c28a305a2327e6c1843301bccbbde6e5f8b..59a7490961da5c3c92b161d134aed3c1d8220d93 100644 (file)
@@ -1,14 +1,7 @@
-/*
- * Gauge.h
- *
- *  Created on: Aug 7, 2012
- *      Author: holy
- */
-
 #ifndef GRAPHICS_GAUGE_H_
 #define GRAPHICS_GAUGE_H_
 
-#include "../geometry/Point.h"
+#include "../geometry/Vector.h"
 
 #include <SDL.h>
 
@@ -16,21 +9,34 @@ namespace graphics {
 
 class Gauge {
 
+       public:
+               static const int TYPE_ID = 406;
+
 public:
-       Gauge(SDL_Surface *s, int fullX, int fullY, int emptyX, int emptyY, int height, int startWidth, int repeatWidth, int endWidth)
-       : surface(s), fullX(fullX), fullY(fullY), emptyX(emptyX), emptyY(emptyY), height(height), startWidth(startWidth), repeatWidth(repeatWidth), endWidth(endWidth) { }
+       explicit Gauge(SDL_Surface *s = 0, int fullX = 0, int fullY = 0, int emptyX = 0, int emptyY = 0, int height = 1, int startWidth = 0, int repeatWidth = 1, int endWidth = 0)
+       : surface(s), fullOffset(fullX, fullY), emptyOffset(emptyX, emptyY), height(height), startWidth(startWidth), repeatWidth(repeatWidth), endWidth(endWidth) { }
 
 public:
        int MinWidth() const { return startWidth + endWidth; }
        int Height() const { return height; }
-       void Draw(SDL_Surface *dest, const geometry::Point<int> &position, int width, Uint8 fill) const;
+       void Draw(SDL_Surface *dest, const geometry::Vector<int> &position, int width, Uint8 fill) const;
+
+public:
+       void SetSurface(SDL_Surface *s) { surface = s; }
+       void SetFullOffset(const geometry::Vector<int> &o) { fullOffset = o; }
+       void SetEmptyOffset(const geometry::Vector<int> &o) { emptyOffset = o; }
+       void SetHeight(int h) { height = h; }
+       void SetStartWidth(int w) { startWidth = w; }
+       void SetRepeatWidth(int w) { repeatWidth = w; }
+       void SetEndWidth(int w) { endWidth = w; }
+
+       static void CreateTypeDescription();
+       static void Construct(void *);
 
 private:
        SDL_Surface *surface;
-       int fullX;
-       int fullY;
-       int emptyX;
-       int emptyY;
+       geometry::Vector<int> fullOffset;
+       geometry::Vector<int> emptyOffset;
        int height;
        int startWidth;
        int repeatWidth;