From c90c389a8a8d9d8661e9772ec4144c5cf2039f23 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- kenolaba/EvalScheme.h | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 kenolaba/EvalScheme.h (limited to 'kenolaba/EvalScheme.h') 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 + +#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=0 && s