summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Wadham <[email protected]>2015-06-22 16:31:14 +1000
committerIan Wadham <[email protected]>2015-06-22 16:31:14 +1000
commit3be854db7bc367c5d4b6be69349c5e37df66f334 (patch)
tree7a134bba71116a2ea0333072ed25eb68f5a78311
parentf642a0435b1ab36673a721cd469b62d8b4bf4a7e (diff)
Add enums and xml parsing for Killer Sudoku and Mathdoku puzzle-types.
-rw-r--r--src/globals.h4
-rw-r--r--src/gui/serializer.cpp7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/globals.h b/src/globals.h
index d5f4537..20b90cb 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -25,7 +25,7 @@
#define UNUSABLE -1
enum SudokuType {Plain, XSudoku, Jigsaw, Samurai, TinySamurai, Roxdoku, Aztec,
- EndSudokuTypes};
+ Mathdoku, KillerSudoku, EndSudokuTypes};
enum Difficulty {VeryEasy = 0, Easy = 1, Medium = 2, Hard = 3, Diabolical = 4,
Unlimited = 5};
@@ -33,6 +33,8 @@ enum Difficulty {VeryEasy = 0, Easy = 1, Medium = 2, Hard = 3, Diabolical = 4,
enum Symmetry {DIAGONAL_1, CENTRAL, LEFT_RIGHT, SPIRAL, FOURWAY,
RANDOM_SYM, LAST_CHOICE = RANDOM_SYM, NONE, DIAGONAL_2};
+enum CageOperator {NoOperator, Divide, Subtract, Multiply, Add};
+
typedef QVector<int> BoardContents;
typedef struct {
diff --git a/src/gui/serializer.cpp b/src/gui/serializer.cpp
index 670bbae..3a43e1e 100644
--- a/src/gui/serializer.cpp
+++ b/src/gui/serializer.cpp
@@ -40,9 +40,11 @@
namespace ksudoku {
const char * typeNames[] = {"Plain", "XSudoku", "Jigsaw", "Aztec",
- "Samurai", "TinySamurai", "Roxdoku"};
+ "Samurai", "TinySamurai", "Roxdoku",
+ "Mathdoku", "KillerSudoku"};
const SudokuType types[] = {Plain, XSudoku, Jigsaw, Aztec,
- Samurai, TinySamurai, Roxdoku};
+ Samurai, TinySamurai, Roxdoku,
+ Mathdoku, KillerSudoku};
Game Serializer::deserializeGame(QDomElement element) {
bool hasPuzzle = false;
@@ -185,6 +187,7 @@ SKGraph* Serializer::deserializeGraph(QDomElement element) {
QString orderStr = element.attribute("order");
if(orderStr.isNull())
return 0;
+ // IDW TODO - Allow symbolic values for Mathdoku, set from user-config.
int order = orderStr.toInt(&noFailure, 0);
if(!noFailure)
return 0;