summaryrefslogtreecommitdiffstats
path: root/ktux/spritemisc.h
diff options
context:
space:
mode:
Diffstat (limited to 'ktux/spritemisc.h')
-rw-r--r--ktux/spritemisc.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/ktux/spritemisc.h b/ktux/spritemisc.h
new file mode 100644
index 0000000..0a0d058
--- /dev/null
+++ b/ktux/spritemisc.h
@@ -0,0 +1,41 @@
+//-----------------------------------------------------------------------------
+//
+// spritemisc
+//
+// Copyright (c) Martin R. Jones 1999
+//
+
+#ifndef __SPRITEMISC_H__
+#define __SPRITEMISC_H__
+
+#include <qstring.h>
+#include <qsize.h>
+
+class SpriteRange
+{
+public:
+ SpriteRange(const QString &str);
+ SpriteRange(int l=0, int h=0) : mMin(l), mMax(h) {}
+
+ int min() const { return mMin; }
+ int max() const { return mMax; }
+
+ int random() const;
+
+ void set(int l, int h) { mMin=l; mMax=h; }
+ void set(const QString &str);
+
+ static void setFieldSize(const QSize &size);
+ static QSize fieldSize() { return mFieldSize; }
+
+protected:
+ int parse(const QString &str);
+
+protected:
+ int mMin;
+ int mMax;
+ static QSize mFieldSize;
+};
+
+#endif
+