summaryrefslogtreecommitdiffstats
path: root/kenolaba/EvalScheme.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitc90c389a8a8d9d8661e9772ec4144c5cf2039f23 (patch)
tree6d8391395bce9eaea4ad78958617edb20c6a7573 /kenolaba/EvalScheme.h
downloadtdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.tar.gz
tdegames-c90c389a8a8d9d8661e9772ec4144c5cf2039f23.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kenolaba/EvalScheme.h')
-rw-r--r--kenolaba/EvalScheme.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/kenolaba/EvalScheme.h b/kenolaba/EvalScheme.h
new file mode 100644
index 00000000..0efcafb8
--- /dev/null
+++ b/kenolaba/EvalScheme.h
@@ -0,0 +1,61 @@
+/**
+ * EvalScheme
+ *
+ * Configuration options for a Evaluation Scheme.
+ * Evaluation Schemes are used for evalution of a Abalone board position
+ *
+ * (C) JW, 2000
+ */
+
+#ifndef _EVALSCHEME_H_
+#define _EVALSCHEME_H_
+
+#include <qstring.h>
+
+#include "Move.h"
+
+class KConfig;
+
+/*
+ * The constructor gets a name, and tries to read the scheme
+ * for the Kenolaba configuration file, if nothing found, use
+ * default values
+ */
+
+class EvalScheme
+{
+ public:
+ EvalScheme(QString);
+ EvalScheme(EvalScheme&);
+ ~EvalScheme() {}
+
+ void setDefaults();
+ void read(KConfig*);
+ void save(KConfig*);
+
+ static EvalScheme* create(QString);
+ QString ascii();
+
+ void setName(QString n) { _name = n; }
+ void setRingValue(int ring, int value);
+ void setRingDiff(int ring, int value);
+ void setStoneValue(int stoneDiff, int value);
+ void setMoveValue(int type, int value);
+ void setInARowValue(int stones, int value);
+
+ QString name() { return _name; }
+ int ringValue(int r) { return (r>=0 && r<5) ? _ringValue[r] : 0; }
+ int ringDiff(int r) { return (r>0 && r<5) ? _ringDiff[r] : 0; }
+ int stoneValue(int s) { return (s>0 && s<6) ? _stoneValue[s] : 0; }
+ int moveValue(int t) { return (t>=0 && t<Move::typeCount) ? _moveValue[t] : 0;}
+ int inARowValue(int s) { return (s>=0 && s<InARowCounter::inARowCount) ? _inARowValue[s]:0; }
+
+ private:
+ int _ringValue[5], _ringDiff[5];
+ int _stoneValue[6], _moveValue[Move::none];
+ int _inARowValue[InARowCounter::inARowCount];
+
+ QString _name;
+};
+
+#endif // _EVALSCHEME_H_