summaryrefslogtreecommitdiffstats
path: root/kfouleggs/ai.cpp
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 /kfouleggs/ai.cpp
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 'kfouleggs/ai.cpp')
-rw-r--r--kfouleggs/ai.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/kfouleggs/ai.cpp b/kfouleggs/ai.cpp
new file mode 100644
index 00000000..ee8a6c4b
--- /dev/null
+++ b/kfouleggs/ai.cpp
@@ -0,0 +1,40 @@
+#include "ai.h"
+#include "ai.moc"
+
+#include <klocale.h>
+
+#include "board.h"
+
+
+const AI::Data FEAI::DATA[] = {
+ { "OccupiedLines", I18N_NOOP("Occupied lines:"), 0,
+ false, nbOccupiedLines },
+ { "Spaces", I18N_NOOP("Number of spaces:"), I18N_NOOP("Number of spaces under mean height"),
+ false, nbSpaces },
+ { "Peak2Peak", I18N_NOOP("Peak-to-peak distance:"), 0,
+ false, peakToPeak },
+ { "MeanHeight", I18N_NOOP("Mean height:"), 0,
+ false, mean },
+ { "RemovedEggs", I18N_NOOP("Number of removed eggs:"), 0,
+ false, nbRemoved },
+ { "Puyos", I18N_NOOP("Number of puyos:"), 0,
+ true, nbPuyos },
+ { "ChainedPuyos", I18N_NOOP("Number of chained puyos:"), 0,
+ true, nbChained },
+ LastData
+};
+
+FEAI::FEAI()
+: AI(0, 200, DATA)
+{}
+
+double FEAI::nbPuyos(const Board &main, const Board &current)
+{
+ return static_cast<const FEBoard &>(current).nbPuyos()
+ - static_cast<const FEBoard &>(main).nbPuyos();
+}
+
+double FEAI::nbChained(const Board &, const Board &current)
+{
+ return static_cast<const FEBoard &>(current).chained();
+}