public ReactionCommands(IServiceProvider serviceProvider) { _cache = serviceProvider.GetRequiredService <IMemoryCache>(); _db = serviceProvider.GetRequiredService <PerudoBotDbContext>(); _gameHandler = new GameHandler(_db, _cache); }
public EloHandler(PerudoBotDbContext db, ulong guildId, string gameMode) { _db = db; _guildId = guildId; _match = new EloMatch(); _gameMode = gameMode; }
public PerudoBotDbContext CreateContext() { if (_connection == null) { _connection = new SqliteConnection("DataSource=:memory:"); _connection.Open(); var options = CreateOptions(); using (var context = new PerudoBotDbContext(options)) { context.Database.EnsureCreated(); } } return(new PerudoBotDbContext(CreateOptions())); }
public GameObject(PerudoBotDbContext db, ulong channelId, ulong guildId) { _db = db; _channelId = channelId; _guildId = guildId; }
/* * Do all the user handling and setup for the game here * Save it all in cache, * and then use it all when starting the game */ public GameHandler(PerudoBotDbContext db, IMemoryCache cache) { _db = db; _cache = cache; }
public RankService(PerudoBotDbContext db) { _db = db; }
public void Setup() { _factory = new GameBotDbContextFactory(); _db = _factory.CreateContext(); _gameHandler = new GameHandler(_db, new MemoryCache(new MemoryCacheOptions())); }