[gbrainy] Fixes issue #618812



commit 0d4e928149d20a9085abd7faa767e79a802a4782
Author: Jordi Mas <jmas softcatala org>
Date:   Sat May 29 05:41:48 2010 +0200

    Fixes issue #618812

 src/Core/Main/CairoContextEx.cs          |   12 ++++++++++++
 src/Games/Logic/PuzzleBalance.cs         |    8 +++++---
 src/Games/Logic/PuzzleFigures.cs         |    6 +++---
 src/Games/Memory/MemoryFiguresAndText.cs |   12 ++++++------
 4 files changed, 26 insertions(+), 12 deletions(-)
---
diff --git a/src/Core/Main/CairoContextEx.cs b/src/Core/Main/CairoContextEx.cs
index eacfd20..f22ee04 100644
--- a/src/Core/Main/CairoContextEx.cs
+++ b/src/Core/Main/CairoContextEx.cs
@@ -90,6 +90,18 @@ namespace gbrainy.Core.Main
 			Stroke ();
 		}
 
+		// Draws a regular pentagon
+		public void DrawPentagon (double x, double y, double size)
+		{
+			MoveTo (x + (0.4998 * size), y + ( 0.0051 * size));
+			LineTo (x + (0.9949 * size), y + (0.3648 * size));
+			LineTo (x + (0.8058 * size), y + (0.9468 * size));
+			LineTo (x + (0.1938 * size), y + (0.9468 * size));
+			LineTo (x + (0.0046 * size), y + (0.3648 * size));
+			LineTo (x + (0.4998 * size), y + (0.0051 * size));
+			Stroke ();
+		}
+
 		public void FillGradient (double x, double y, double w, double h)
 		{
 			Save ();
diff --git a/src/Games/Logic/PuzzleBalance.cs b/src/Games/Logic/PuzzleBalance.cs
index f54af88..da09b9e 100644
--- a/src/Games/Logic/PuzzleBalance.cs
+++ b/src/Games/Logic/PuzzleBalance.cs
@@ -57,12 +57,12 @@ namespace gbrainy.Games.Logic
 
 		public override string Rationale {
 			get {
-				return Catalog.GetString ("Every triangle counts as 1, each diamond as 2 and each square as 3.");
+				return Catalog.GetString ("Every triangle counts as 1, each circle as 2 and each square as 3.");
 			}
 		}
 
 		public override string Tip {
-			get { return Catalog.GetString ("Every diamond counts as two triangles.");}
+			get { return Catalog.GetString ("Every circle counts as two triangles.");}
 		}
 
 		public override void Initialize ()
@@ -94,10 +94,12 @@ namespace gbrainy.Games.Logic
 					gr.DrawEquilateralTriangle (fig_x, fig_y, 0.05);
 					break;
 				case 2:
-					gr.DrawDiamond (fig_x, fig_y, 0.05);
+					gr.Arc (fig_x + (0.05 / 2), fig_y + (0.05 / 2) + 0.003, (0.05 / 2), 0, 2 * Math.PI);
+					gr.Stroke ();
 					break;
 				case 3:
 					gr.Rectangle (fig_x, fig_y + 0.005, 0.045, 0.045);
+					gr.Stroke ();
 					break;
 				}
 			
diff --git a/src/Games/Logic/PuzzleFigures.cs b/src/Games/Logic/PuzzleFigures.cs
index 96ba1a8..764fed2 100644
--- a/src/Games/Logic/PuzzleFigures.cs
+++ b/src/Games/Logic/PuzzleFigures.cs
@@ -78,7 +78,7 @@ namespace gbrainy.Games.Logic
 			{
 				e.Context.MoveTo (0, 0.05);
 				e.Context.ShowPangoText (String.Format (Catalog.GetString ("{0} ->"), GetPossibleAnswer (0)));
-				e.Context.DrawDiamond (0.1, 0, 0.1);
+				e.Context.DrawPentagon (0.1, 0, 0.1);
 				e.Context.Stroke ();
 			};
 
@@ -124,7 +124,7 @@ namespace gbrainy.Games.Logic
 					switch (figures[(n * 6) + element])
 					{
 						case 0:
-							gr.DrawDiamond (x, y, 0.1);
+							gr.DrawPentagon (x, y, 0.1);
 							break;
 						case 1:
 							gr.Arc (x + 0.05, y + 0.05, 0.05, 0, 2 * Math.PI);	
@@ -162,7 +162,7 @@ namespace gbrainy.Games.Logic
 
 			y += 0.16;
 			gr.MoveTo (x, y);		
-			gr.ShowPangoText (String.Format (Catalog.GetString ("E.g: {0}{1}{2} (diamond, triangle, circle)"),
+			gr.ShowPangoText (String.Format (Catalog.GetString ("E.g: {0}{1}{2} (pentagon, triangle, circle)"),
 				GetPossibleAnswer (0), GetPossibleAnswer (2), GetPossibleAnswer (1)));
 		}
 	}
diff --git a/src/Games/Memory/MemoryFiguresAndText.cs b/src/Games/Memory/MemoryFiguresAndText.cs
index 57bd729..54050e0 100644
--- a/src/Games/Memory/MemoryFiguresAndText.cs
+++ b/src/Games/Memory/MemoryFiguresAndText.cs
@@ -41,7 +41,7 @@ namespace gbrainy.Games.Memory
 		{
 			internal const int Triangle = 0;
 			internal const int Rectangle = 1;
-			internal const int Diamond = 2;
+			internal const int Pentagon = 2;
 			internal const int Circle = 3;
 			internal const int Total = Circle + 1;
 
@@ -52,8 +52,8 @@ namespace gbrainy.Games.Memory
 					return Catalog.GetString ("Triangle");
 				case Rectangle:
 					return Catalog.GetString ("Rectangle");
-				case Diamond:
-					return Catalog.GetString ("Diamond");
+				case Pentagon:
+					return Catalog.GetString ("Pentagon");
 				case Circle:
 					return Catalog.GetString ("Circle");
 				default:
@@ -67,7 +67,7 @@ namespace gbrainy.Games.Memory
 		}
 
 		public override string MemoryQuestion {
-			get {return Catalog.GetString ("The list below enumerates the figures shown in the previous image except for one. Which is the missing figure? Possible answers are triangle, rectangle, diamond and circle." );}
+			get {return Catalog.GetString ("The list below enumerates the figures shown in the previous image except for one. Which is the missing figure? Possible answers are triangle, rectangle, pentagon and circle." );}
 		}
 
 		public override void Initialize ()
@@ -190,8 +190,8 @@ namespace gbrainy.Games.Memory
 				gr.Rectangle (x + space_x, y + space_y, figure_size, figure_size);
 				gr.Stroke ();
 				break;
-			case FigureType.Diamond:
-				gr.DrawDiamond (x + space_x, y + space_y, figure_size);
+			case FigureType.Pentagon:
+				gr.DrawPentagon (x + space_x, y + space_y, figure_size);
 				break;
 			case FigureType.Circle:
 				gr.Arc (x + space_x + figure_size / 2, y + space_y + figure_size / 2, figure_size / 2, 0, 2 * Math.PI);



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