public ChallengeGenerationWorkflow(ChallengeGenerator challengeGenerator, BggApiService bggApiService, GameMetadata metadata, ScgOptions options) { _challengeGenerator = challengeGenerator; _bggApiService = bggApiService; _metadata = metadata; _options = options; }
public FileRepository(ScgOptions options, string game) : base($"scg.Games.{game}.") { var basePath = options?.DataFolder ?? Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); _userPath = Path.Combine(basePath, "MadCowDevelopment", "scg", "Games", game); Directory.CreateDirectory(_userPath); }
public ScgOptionsRepository() { if (System.IO.File.Exists("appsettings.json")) { _options = JsonConvert.DeserializeObject <ScgOptions>(System.IO.File.ReadAllText("appsettings.json")); foreach (var prop in typeof(ScgOptions).GetProperties().Where(p => p.GetCustomAttribute <EncryptedAttribute>() != null)) { string decrypted; try { decrypted = StringCipher.Decrypt((string)prop.GetValue(_options), PassPhrase); prop.SetValue(_options, decrypted); } catch (Exception) { decrypted = null; } prop.SetValue(_options, decrypted); } } else { _options = new ScgOptions(); } }