[gbrainy] Make AnswerText not virtual. Remove AnswerText overrides



commit e50e125ed1beb96d126d766301607620b1d285a3
Author: Jordi Mas <jmas softcatala org>
Date:   Mon Mar 7 12:17:49 2011 +0100

    Make AnswerText not virtual. Remove AnswerText overrides

 src/Core/Main/Game.cs             |    2 +-
 src/Core/Main/Verbal/Analogies.cs |   29 +++++++++++------------------
 2 files changed, 12 insertions(+), 19 deletions(-)
---
diff --git a/src/Core/Main/Game.cs b/src/Core/Main/Game.cs
index d9cbf57..996bd6b 100644
--- a/src/Core/Main/Game.cs
+++ b/src/Core/Main/Game.cs
@@ -121,7 +121,7 @@ namespace gbrainy.Core.Main
 		}
 
 		// Builds a text answer for the puzzle
-		public virtual string AnswerText {
+		public string AnswerText {
 			get {
 				string str;
 
diff --git a/src/Core/Main/Verbal/Analogies.cs b/src/Core/Main/Verbal/Analogies.cs
index f9fcde8..7ea5994 100644
--- a/src/Core/Main/Verbal/Analogies.cs
+++ b/src/Core/Main/Verbal/Analogies.cs
@@ -47,29 +47,22 @@ namespace gbrainy.Core.Main.Verbal
 			}
 		}
 
-		public override string AnswerText {
+		public override string Rationale {
 			get {
-				string str;
-				if (Current == null || Current.MultipleAnswers == false)
-					return base.AnswerText;
+				if (Current == null)
+					return string.Empty;
 
+				if (Current.MultipleAnswers == false || String.IsNullOrEmpty (Current.rationale))
+					return Current.rationale;
+
+				string str;	
 				str = String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Possible correct answers are: {0}."), 
-				                     Answer.CorrectShow);
+					Answer.CorrectShow);
 
-				if (String.IsNullOrEmpty (Rationale))
-					return str;
-				
+				// For multiple answer build a rationale
 				// Translators: answer + rationale of the answer
-				return  String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0} {1}"), str, Rationale);
-			}
-		}
-
-		public override string Rationale {
-			get {
-				if (Current == null)
-					return string.Empty;
-				
-				return Current.rationale;
+				return String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0} {1}"), str, 
+					Current.rationale);
 			}
 		}
 



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