public ActionResult <string> CreateNewGame(string name, int minbet, int maxbet) { if (minbet <= 0) { return(BadRequest("Min bet < 0")); } if (maxbet < minbet) { return(BadRequest("Max bet < min bet")); } if (maxbet > 200) { return(BadRequest("Max bet > 200")); } { var game = new LiveBlackjackGame(name, minbet, maxbet, 30, 10); _blackJackDAL.AddGame(game); return(game.Id); } }
public void CreateGame(string gameName, int minBet, int maxBet) { if (minBet <= 0) { SendError("Min bet < 0"); return; } if (maxBet < minBet) { SendError("Max bet < min bet"); return; } if (maxBet > 1000) { SendError("Max bet > 1000"); return; } var game = new LiveBlackjackGame(gameName, minBet, maxBet, 30, 10); _blackJackDAL.AddGame(game); Clients.Caller.GameCreated(game.Id); }