[gbrainy] Some small code fixes



commit 0727940dc25a6992304ac47fc3f5c7d3fd1971f7
Author: Jordi Mas <jmas softcatala org>
Date:   Tue Apr 5 07:18:30 2011 +0200

    Some small code fixes

 src/Clients/Classical/Widgets/Toolbar.cs     |    2 +-
 src/Core/Main/Xml/GameXml.cs                 |    2 +-
 src/Core/Main/Xml/GameXmlFactory.cs          |    1 -
 src/Core/Toolkit/Widget.cs                   |    2 +-
 src/Games/Calculation/CalculationOperator.cs |    2 +-
 src/Games/Logic/PuzzleCoverPercentage.cs     |    2 +-
 src/Games/Logic/PuzzleDice.cs                |    2 +-
 src/Games/Logic/PuzzleDivideCircle.cs        |    2 +-
 src/Games/Logic/PuzzleExtraCircle.cs         |    2 +-
 src/Games/Logic/PuzzleFigurePattern.cs       |    2 +-
 src/Games/Logic/PuzzleMissingPiece.cs        |    4 ++--
 src/Games/Logic/PuzzleMissingSlice.cs        |    2 +-
 12 files changed, 12 insertions(+), 13 deletions(-)
---
diff --git a/src/Clients/Classical/Widgets/Toolbar.cs b/src/Clients/Classical/Widgets/Toolbar.cs
index e5e1e3d..143ec7b 100644
--- a/src/Clients/Classical/Widgets/Toolbar.cs
+++ b/src/Clients/Classical/Widgets/Toolbar.cs
@@ -150,7 +150,7 @@ namespace gbrainy.Clients.Classical.Widgets
 			Insert (FinishButton, -1);
 		}
 
-		void AddIcon (IconFactory stock, string stockid, string resource)
+		static void AddIcon (IconFactory stock, string stockid, string resource)
 		{
 			Gtk.IconSet iconset = stock.Lookup (stockid);
 
diff --git a/src/Core/Main/Xml/GameXml.cs b/src/Core/Main/Xml/GameXml.cs
index 0954dbf..d038f32 100644
--- a/src/Core/Main/Xml/GameXml.cs
+++ b/src/Core/Main/Xml/GameXml.cs
@@ -480,7 +480,7 @@ namespace gbrainy.Core.Main.Xml
 			return str.Replace (option_prefix, answer);
 		}
 
-		void BuildLocationList ()
+		static void BuildLocationList ()
 		{
 			locators.Clear ();
 
diff --git a/src/Core/Main/Xml/GameXmlFactory.cs b/src/Core/Main/Xml/GameXmlFactory.cs
index 2b0253c..5a5118d 100644
--- a/src/Core/Main/Xml/GameXmlFactory.cs
+++ b/src/Core/Main/Xml/GameXmlFactory.cs
@@ -87,7 +87,6 @@ namespace gbrainy.Core.Main.Xml
 							break;
 
 						str = reader.ReadElementString ();
-						str.Trim ();
 						game.Difficulty = GameDifficultyDescription.FromString (str);
 						break;
 					case "svg":
diff --git a/src/Core/Toolkit/Widget.cs b/src/Core/Toolkit/Widget.cs
index 8b0fe70..21a8645 100644
--- a/src/Core/Toolkit/Widget.cs
+++ b/src/Core/Toolkit/Widget.cs
@@ -38,7 +38,7 @@ namespace gbrainy.Core.Toolkit
 		ISynchronizeInvoke synchronize;
 		bool sensitive;
 
-	    	public Widget (double width, double height)
+	    	protected Widget (double width, double height)
 		{
 			if (width < 0 || width > 1)
 				throw new ArgumentOutOfRangeException ("width");
diff --git a/src/Games/Calculation/CalculationOperator.cs b/src/Games/Calculation/CalculationOperator.cs
index 28dde3f..c3bb737 100644
--- a/src/Games/Calculation/CalculationOperator.cs
+++ b/src/Games/Calculation/CalculationOperator.cs
@@ -47,7 +47,7 @@ namespace gbrainy.Games.Calculation
 			get {return String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Which operators make {0}, {1}, and {2} equal {3}? Answer using '+-/*'."), number_a, number_b, number_c, total);}
 		}
 
-		private double ProcessOperation (double total, double number, char op)
+		static private double ProcessOperation (double total, double number, char op)
 		{
 			switch (op) {
 			case '-':
diff --git a/src/Games/Logic/PuzzleCoverPercentage.cs b/src/Games/Logic/PuzzleCoverPercentage.cs
index d545af9..4f155c5 100644
--- a/src/Games/Logic/PuzzleCoverPercentage.cs
+++ b/src/Games/Logic/PuzzleCoverPercentage.cs
@@ -107,7 +107,7 @@ namespace gbrainy.Games.Logic
 			gr.Restore ();
 		}
 
-		private void CoverZone (CairoContextEx gr, double x, double y)
+		static private void CoverZone (CairoContextEx gr, double x, double y)
 		{
 			Fill (gr, x + line_width, y + line_width , (width / 2) - (line_width * 2), (height / 2) - (line_width * 2));
 		}
diff --git a/src/Games/Logic/PuzzleDice.cs b/src/Games/Logic/PuzzleDice.cs
index fb33f4a..30330f4 100644
--- a/src/Games/Logic/PuzzleDice.cs
+++ b/src/Games/Logic/PuzzleDice.cs
@@ -111,7 +111,7 @@ namespace gbrainy.Games.Logic
 		}
 
 		// Takes a string with Fraction or Number and converts it to double
-		double FractionOrNumberToDouble (string answer)
+		static double FractionOrNumberToDouble (string answer)
 		{
 			string num_a = string.Empty;
 			string num_b = string.Empty;
diff --git a/src/Games/Logic/PuzzleDivideCircle.cs b/src/Games/Logic/PuzzleDivideCircle.cs
index aca1dc7..4290e01 100644
--- a/src/Games/Logic/PuzzleDivideCircle.cs
+++ b/src/Games/Logic/PuzzleDivideCircle.cs
@@ -174,7 +174,7 @@ namespace gbrainy.Games.Logic
 			DrawAndConnectPoints (gr, pos_x, pos_y, circles, Answer.Draw);
 		}
 		
-		string HasNRegionString (int regions)
+		static string HasNRegionString (int regions)
 		{
 			return String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetPluralString ("Has {0} region", 
 				"Has {0} regions", regions), regions);
diff --git a/src/Games/Logic/PuzzleExtraCircle.cs b/src/Games/Logic/PuzzleExtraCircle.cs
index da6955b..2c27e45 100644
--- a/src/Games/Logic/PuzzleExtraCircle.cs
+++ b/src/Games/Logic/PuzzleExtraCircle.cs
@@ -175,7 +175,7 @@ namespace gbrainy.Games.Logic
 			gr.Stroke ();
 		}
 
-		void DrawCircle (CairoContextEx gr, double x, double y, Color[] colors, int color_indice)
+		static void DrawCircle (CairoContextEx gr, double x, double y, Color[] colors, int color_indice)
 		{
 			double dg;
 			gr.Arc (x, y, radius, 0, 2 * Math.PI);
diff --git a/src/Games/Logic/PuzzleFigurePattern.cs b/src/Games/Logic/PuzzleFigurePattern.cs
index 2ad60f4..a0cf832 100644
--- a/src/Games/Logic/PuzzleFigurePattern.cs
+++ b/src/Games/Logic/PuzzleFigurePattern.cs
@@ -71,7 +71,7 @@ namespace gbrainy.Games.Logic
 			}
 		}
 
-		private void DrawRotatedCross (CairoContextEx gr, double x, double y, double size)
+		static private void DrawRotatedCross (CairoContextEx gr, double x, double y, double size)
 		{
 			gr.MoveTo (x, y);
 			gr.LineTo (x + size, y + size);
diff --git a/src/Games/Logic/PuzzleMissingPiece.cs b/src/Games/Logic/PuzzleMissingPiece.cs
index f0d5ac0..4b928d0 100644
--- a/src/Games/Logic/PuzzleMissingPiece.cs
+++ b/src/Games/Logic/PuzzleMissingPiece.cs
@@ -88,7 +88,7 @@ namespace gbrainy.Games.Logic
 			}
 		}
 
-		private void DrawFigureSequence (CairoContextEx gr, double x, double y, int sequence, bool last_block)
+		static private void DrawFigureSequence (CairoContextEx gr, double x, double y, int sequence, bool last_block)
 		{
 			gr.Rectangle (x, y, sub_figure, sub_figure);
 			gr.Rectangle (x + sub_figure, y, sub_figure, sub_figure);
@@ -136,7 +136,7 @@ namespace gbrainy.Games.Logic
 			gr.Stroke ();
 		}
 
-		private void DrawAnswerFigures (CairoContextEx gr, double x, double y, int figure)
+		static private void DrawAnswerFigures (CairoContextEx gr, double x, double y, int figure)
 		{
 			gr.Rectangle (x, y, sub_figure, sub_figure);
 
diff --git a/src/Games/Logic/PuzzleMissingSlice.cs b/src/Games/Logic/PuzzleMissingSlice.cs
index 998046f..ccacfe3 100644
--- a/src/Games/Logic/PuzzleMissingSlice.cs
+++ b/src/Games/Logic/PuzzleMissingSlice.cs
@@ -152,7 +152,7 @@ namespace gbrainy.Games.Logic
 			gr.Stroke ();
 		}
 
-		private void DrawSliceText (CairoContextEx gr, double x, double y, int slice, string str1, string str2, string str3)
+		static private void DrawSliceText (CairoContextEx gr, double x, double y, int slice, string str1, string str2, string str3)
 		{
 			double x0, y0, degrees;
 



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