static public void performOperation(string parameters, Message msg) { try { if (msg.msg.ToLower().Trim() == "!register") { if (!pokerContexts.ContainsKey(msg.name)) { pokerContexts.Add(msg.name, new PokerContext()); Chat.sendMessage("You are now registered, and have $1000. The default bet is $1. You can !raise #, !bet #, !roll, or !check the standings."); } else { Chat.sendMessage("You are already registered."); } } else { if (pokerContexts.ContainsKey(msg.name)) { PokerContext ctx = pokerContexts[msg.name]; switch (msg.msg.ToLower().Trim()) { case "!help": Chat.sendMessage("You can !raise #, !bet #, !roll, or !check the standings."); break; case "!check": Chat.sendMessage(msg.name + " has $" + ctx.playerMoney + ". " + _G.propername + " has $" + ctx.botMoney + ". Both sides are currently betting $" + ctx.currentBet); break; case "!roll": ctx.PerformTurn(msg.name); break; } if (msg.msg.ToLower().Trim().StartsWith("!bet")) { try { ctx.Bet(Int32.Parse(msg.msg.Substring(msg.msg.IndexOf(' ') + 1))); } catch (Exception e) { } } if (msg.msg.ToLower().Trim().StartsWith("!raise")) { try { ctx.Raise(Int32.Parse(msg.msg.Substring(msg.msg.IndexOf(' ') + 1))); } catch (Exception e) { } } } else { Chat.sendMessage("You are not registered. Register with !register."); } } } catch (Exception e) { Console.WriteLine(e.Message + " " + e.StackTrace); } }
public void Configuration(IAppBuilder app) { PokerContext ctx = new PokerContext(); new PokerDbInitializer().InitializeDatabase(ctx); // Дополнительные сведения о настройке приложения см. по адресу: http://go.microsoft.com/fwlink/?LinkID=316888 ConfigureOAuth(app); HttpConfiguration config = new HttpConfiguration(); WebApiConfig.Register(config); app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll); app.UseWebApi(config); app.MapSignalR(); }
public UnitOfWork(PokerContext context) { _context = context; }
public RoundRepository(PokerContext context) { _context = context; }
public PlayerRepository(PokerContext context) { _context = context; }
public RankingPointRepository(PokerContext context) { _context = context; }
public RegulationRepository(PokerContext context) { _context = context; }