[gbrainy/gbrainy_16x] Base end of game feedback on proportion of games won



commit 3986f9a298c713d474ef4e47b6f2396c2fe5e04f
Author: Jordi Mas <jmas softcatala org>
Date:   Sat Sep 18 14:20:12 2010 +0200

    Base end of game feedback on proportion of games won

 src/Core/Main/GameSession.cs |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/Core/Main/GameSession.cs b/src/Core/Main/GameSession.cs
index 3086dc5..3af4c18 100644
--- a/src/Core/Main/GameSession.cs
+++ b/src/Core/Main/GameSession.cs
@@ -189,13 +189,14 @@ namespace gbrainy.Core.Main
 				string s;
 
 				if (history.GamesPlayed >= 10) {
-					if (history.TotalScore >= 70)
+					int percentage_won = (int) (100 * history.GamesWon / history.GamesPlayed);
+					if (percentage_won >= 90)
 						s = String.Format (Catalog.GetString ("Outstanding results"));
-					else if (history.TotalScore >= 50)
+					else if (percentage_won >= 70)
 						s = String.Format (Catalog.GetString ("Excellent results"));
-					else if (history.TotalScore >= 30)
+					else if (percentage_won >= 50)
 						s = String.Format (Catalog.GetString ("Good results"));
-					else if (history.TotalScore >= 20)
+					else if (percentage_won >= 30)
 						s = String.Format (Catalog.GetString ("Poor results"));
 					else s = String.Format (Catalog.GetString ("Disappointing results"));
 				} else



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