Skip to content

Commit

Permalink
#4 Spiel 10 Volle implementiert
Browse files Browse the repository at this point in the history
  • Loading branch information
borzel committed Jan 31, 2014
1 parent dc9583d commit bb57bff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions kegel-server/KegelApp.Server.Domain/GameEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ public enum GameEnum
{
HausnummerVor,
HausnummerZurueck,
ZehnVolle,
}
}
3 changes: 3 additions & 0 deletions kegel-server/kegel-server/Games/GameFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public static GameBase CreateGame(GameEnum gameToStart)
case GameEnum.HausnummerZurueck:
spiel = new HausnummerZurueck();
break;
case GameEnum.ZehnVolle:
spiel = new ZehnVolle();
break;
default:
spiel = null;
break;
Expand Down
4 changes: 3 additions & 1 deletion kegel-server/kegel-server/Module/GameModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public GameModule () : base(MOUDL_BASEURL)
string spielToStart = Request.Form ["spiel"];

// TODO spieltoStart beachten
GameBase spiel = GameFactory.CreateGame(GameEnum.HausnummerVor);
GameBase spiel = GameFactory.CreateGame((GameEnum)Enum.Parse(typeof(GameEnum), spielToStart));

if (Server.Instance.GetUsers().Any())
{
Expand Down Expand Up @@ -93,13 +93,15 @@ public class GameModel
public bool Spiel { get; set; }
public List<ResultData> Results { get; set; }
public List<User> UsersToPlay { get; set; }
public List<string> Games { get; set; }

public GameModel ()
{
Spiel = false;
Spieler = "";
Spielname = "Es läuft gerade kein Spiel";
Erklaerung = "nix los hier :-(";
Games = Enum.GetNames(typeof(GameEnum)).ToList();
}
}
}
6 changes: 4 additions & 2 deletions kegel-server/kegel-server/Views/game.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
@IfNot.Spiel
<h1>Spiel starten</h1>
<form action="/game/start" method="POST">
<input type="radio" name="spiel" value="hausnummervor">Hausnummer (vorw&auml;rts)<br/>
<input type="radio" name="spiel" value="hausnummerzurueck">Hausnummer (zur&uuml;ck)<br/><br/>
@Each.Games
<input type="radio" name="spiel" value="@!Current">@!Current</input><br/>
@EndEach
<br/>
<input type="submit" value="Start!"/>
</form>
@EndIf
Expand Down
1 change: 1 addition & 0 deletions kegel-server/kegel-server/kegel-server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
<Compile Include="Games\HausnummerVor.cs" />
<Compile Include="Games\HausnummerZurueck.cs" />
<Compile Include="Games\GameBase.cs" />
<Compile Include="Games\ZehnVolle.cs" />
<Compile Include="Models\PlantModel.cs" />
<Compile Include="Models\PlantsModel.cs" />
<Compile Include="Module\DebugModule.cs" />
Expand Down

0 comments on commit bb57bff

Please sign in to comment.