[gbrainy] Add rationale to SquareDots puzzle and rename it to PuzzleGridDots



commit 3495e36ef72616c6f2f6e0d5005f741a54d77a8d
Author: Jordi Mas <jmas softcatala org>
Date:   Mon May 30 20:40:41 2011 +0200

    Add rationale to SquareDots puzzle and rename it to PuzzleGridDots

 po/POTFILES.in                                     |    2 +-
 src/Games/GameList.cs                              |    2 +-
 src/Games/Games.csproj                             |    2 +-
 .../{PuzzleSquareDots.cs => PuzzleGridDots.cs}     |   26 +++++++++++++++++--
 src/Games/Makefile.am                              |    2 +-
 5 files changed, 27 insertions(+), 7 deletions(-)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c2ab1aa..22dcf71 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -79,7 +79,7 @@ src/Games/Logic/PuzzlePeopleTable.cs
 src/Games/Logic/PuzzlePercentage.cs
 src/Games/Logic/PuzzleQuadrilaterals.cs
 src/Games/Logic/PuzzleRelatedNumbers.cs
-src/Games/Logic/PuzzleSquareDots.cs
+src/Games/Logic/PuzzleGridDots.cs
 src/Games/Logic/PuzzleSquaresAndLetters.cs
 src/Games/Logic/PuzzleSquares.cs
 src/Games/Logic/PuzzleSquareSheets.cs
diff --git a/src/Games/GameList.cs b/src/Games/GameList.cs
index 53bfead..1e63a2c 100644
--- a/src/Games/GameList.cs
+++ b/src/Games/GameList.cs
@@ -39,7 +39,7 @@ namespace gbrainy.Games
 			typeof (PuzzleCoverPercentage),
 			typeof (PuzzleNumericSequence),
 			typeof (PuzzleSquaresAndLetters),
-			typeof (PuzzleSquareDots),
+			typeof (PuzzleGridDots),
 			typeof (PuzzleNumericRelation),
 			typeof (PuzzleNextFigure),
 			typeof (PuzzleSquareSheets),
diff --git a/src/Games/Games.csproj b/src/Games/Games.csproj
index 657ff69..dd74243 100644
--- a/src/Games/Games.csproj
+++ b/src/Games/Games.csproj
@@ -82,7 +82,7 @@
     <Compile Include="Logic\PuzzlePercentage.cs" />
     <Compile Include="Logic\PuzzlePredicateLogic.cs" />
     <Compile Include="Logic\PuzzleQuadrilaterals.cs" />
-    <Compile Include="Logic\PuzzleSquareDots.cs" />
+    <Compile Include="Logic\PuzzleGridDots.cs" />
     <Compile Include="Logic\PuzzleSquares.cs" />
     <Compile Include="Logic\PuzzleSquaresAndLetters.cs" />
     <Compile Include="Logic\PuzzleSquareSheets.cs" />
diff --git a/src/Games/Logic/PuzzleSquareDots.cs b/src/Games/Logic/PuzzleGridDots.cs
similarity index 89%
rename from src/Games/Logic/PuzzleSquareDots.cs
rename to src/Games/Logic/PuzzleGridDots.cs
index 4905e35..b837073 100644
--- a/src/Games/Logic/PuzzleSquareDots.cs
+++ b/src/Games/Logic/PuzzleGridDots.cs
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Jordi Mas i Hernàndez <jmas softcatala org>
+ * Copyright (C) 2007-2011 Jordi Mas i Hernàndez <jmas softcatala org>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -26,7 +26,7 @@ using gbrainy.Core.Services;
 
 namespace gbrainy.Games.Logic
 {
-	public class PuzzleSquareDots : Game
+	public class PuzzleGridDots : Game
 	{
 		const double figure_size = 0.25;
 		const int lines = 6;
@@ -36,6 +36,7 @@ namespace gbrainy.Games.Logic
 		static bool O = false;
 		const double space_figures = 0.05;
 		ArrayListIndicesRandom possible_answers;
+		int puzzle_index;
 
 		bool [] [] puzzles = new bool [] []
 		{
@@ -210,13 +211,31 @@ namespace gbrainy.Games.Logic
 				Answer.GetMultiOption (0), Answer.GetMultiOption (1), Answer.GetMultiOption (2)));}
 		}
 
+
+		public override string Rationale {
+			get {
+				switch (puzzle_index) {
+				case 0:
+					return ServiceLocator.Instance.GetService <ITranslations> ().GetString
+					("From the top-left figure, the top-left circle moves down, the bottom-left circle moves up, the bottom-right moves diagonally up-right and the top-right moves diagonally down-right.");
+				case 2:
+					return ServiceLocator.Instance.GetService <ITranslations> ().GetString
+					("From the top-left figure, the circles move two positions in the direction of the first element and turn counterclockwise 90\u00b0 degrees left and move one position.");
+				case 1: // TODO
+				default:
+					return string.Empty;
+				}
+			}
+		}
+
 		protected override void Initialize ()
 		{
 			Answer.CheckAttributes |= GameAnswerCheckAttributes.MultiOption | GameAnswerCheckAttributes.IgnoreSpaces;
 			possible_answers = new ArrayListIndicesRandom (3);
 			possible_answers.Initialize ();
 
-			puzzle = puzzles [random.Next (puzzles.Length)];
+			puzzle_index = random.Next (puzzles.Length);
+			puzzle = puzzles [puzzle_index];
 
 			DrawableArea drawable_area;
 			HorizontalContainer container = new HorizontalContainer (0.05, 0.5, 0.9, figure_size + 0.1);
@@ -285,6 +304,7 @@ namespace gbrainy.Games.Logic
 						continue;
 
 					gr.Arc (pos_x + (square_size * column), pos_y, radius_square, 0, 2 * Math.PI);
+					gr.Fill ();
 					gr.Stroke ();
 				}
 				pos_y += square_size;
diff --git a/src/Games/Makefile.am b/src/Games/Makefile.am
index e01d704..ee0724c 100644
--- a/src/Games/Makefile.am
+++ b/src/Games/Makefile.am
@@ -39,7 +39,7 @@ CSDISTFILES =  \
 		$(srcdir)/Logic/PuzzlePeopleTable.cs			\
 		$(srcdir)/Logic/PuzzlePercentage.cs			\
 		$(srcdir)/Logic/PuzzleQuadrilaterals.cs			\
-		$(srcdir)/Logic/PuzzleSquareDots.cs			\
+		$(srcdir)/Logic/PuzzleGridDots.cs			\
 		$(srcdir)/Logic/PuzzleSquaresAndLetters.cs		\
 		$(srcdir)/Logic/PuzzleSquares.cs				\
 		$(srcdir)/Logic/PuzzleSquareSheets.cs			\



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]