public ActionResult JoinGame(string gameId) { var dataProxy = new DataProxy(); var game = dataProxy.Get(gameId); var playerId = game.JoinGame(); return View(new { playerId = playerId }); }
public Card PlayCard(string gameId, string playerId, GameType gt) { var data = new DataProxy(); var game = data.Get(gameId); switch(gt) { case GameType.Euker: var ai = new Models.Euker.AiSimulation(); var card = ai.PlayCard(game.CurrentHand, game.Players.Find(p => p.Id == playerId)); game.CurrentHand.CardsInPlay.Add(card); return card; case GameType.Spades: throw new NotImplementedException(); case GameType.Hearts: throw new NotImplementedException(); case GameType.GoFish: throw new NotImplementedException(); case GameType.GinRummy: throw new NotImplementedException(); case GameType.SpiteAndMalice: throw new NotImplementedException(); } throw new NotImplementedException(); }
public Card GetNextCard(string gameId) { var dataProxy = new DataProxy(); var game = dataProxy.Get(gameId); var card = game.Deck.Pop(); return card; }
public ActionResult Index() { var dataProxy = new DataProxy(); return View(dataProxy.GetGames()); }
public void PlayerPlayedCard(string gameId, Card c) { var data = new DataProxy(); var game = data.Get(gameId); game.CurrentHand.CardsInPlay.Add(c); }