[gbrainy] Remove castings
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gbrainy] Remove castings
- Date: Sun, 25 Apr 2010 18:37:33 +0000 (UTC)
commit c13cd7149bb5bd3bb24cc8e8e081b5216a8982e8
Author: Jordi Mas <jmas softcatala org>
Date: Sun Apr 25 20:38:21 2010 +0200
Remove castings
src/Games/Logic/PuzzleCounting.cs | 8 ++++----
src/Games/Logic/PuzzleFigures.cs | 2 +-
src/Games/Memory/MemoryFigures.cs | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/Games/Logic/PuzzleCounting.cs b/src/Games/Logic/PuzzleCounting.cs
index d6a725b..573df7a 100644
--- a/src/Games/Logic/PuzzleCounting.cs
+++ b/src/Games/Logic/PuzzleCounting.cs
@@ -57,9 +57,9 @@ namespace gbrainy.Games.Logic
gametype = (GameType) random.Next ((int) GameType.Total);
- switch ((int) gametype)
+ switch (gametype)
{
- case (int) GameType.Machine:
+ case GameType.Machine:
var = 2 + random.Next (5);
total = 50 + random.Next (100);
question = String.Format (
@@ -73,7 +73,7 @@ namespace gbrainy.Games.Logic
ans = (total - 1) * var;
break;
- case (int) GameType.Fence:
+ case GameType.Fence:
total = 20 + random.Next (20);
ans = 4 * total - 4;
question = String.Format (
@@ -85,7 +85,7 @@ namespace gbrainy.Games.Logic
Catalog.GetString ("There are {0} fence poles since the poles on the corners of the square are shared."), ans);
break;
- case (int) GameType.Present:
+ case GameType.Present:
int present = 5 + random.Next (20);
total = present + 2;
ans = total;
diff --git a/src/Games/Logic/PuzzleFigures.cs b/src/Games/Logic/PuzzleFigures.cs
index a771249..702bb29 100644
--- a/src/Games/Logic/PuzzleFigures.cs
+++ b/src/Games/Logic/PuzzleFigures.cs
@@ -125,7 +125,7 @@ namespace gbrainy.Games.Logic
y = DrawAreaY;
for (int n = 0; n < 3; n++)
{
- switch ((int) figures[(n * 6) + element])
+ switch (figures[(n * 6) + element])
{
case 0:
gr.DrawDiamond (x, y, 0.1);
diff --git a/src/Games/Memory/MemoryFigures.cs b/src/Games/Memory/MemoryFigures.cs
index 370fb3a..f2e2d32 100644
--- a/src/Games/Memory/MemoryFigures.cs
+++ b/src/Games/Memory/MemoryFigures.cs
@@ -128,7 +128,7 @@ namespace gbrainy.Games.Memory
drawable_area.DataEx = (figure + 1).ToString ();
if (figure == question_pos) {
- int fig = (int)figures[figure];
+ int fig = figures[figure];
if (fig >= figures_active) fig -= figures_active;
drawable_area.Data = fig;
@@ -180,7 +180,7 @@ namespace gbrainy.Games.Memory
gr.Color = new Color (DefaultDrawingColor.R, DefaultDrawingColor.G, DefaultDrawingColor.B, alpha);
for (int figure = 0; figure < figures.Count; figure++, col++)
{
- fig = (int)figures[figure];
+ fig = figures[figure];
if (fig >= figures_active)
fig -= figures_active;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]