// TODO: pass id? /// <summary> /// Creates options for the competition. The <see cref="BenchmarkDotNet.Characteristics.CharacteristicObject.Frozen"/> is false. /// </summary> /// <param name="metadataSource">The metadata source.</param> /// <param name="competitionFeatures">The competition features.</param> /// <returns> /// Options for the competition. The <see cref="BenchmarkDotNet.Characteristics.CharacteristicObject.Frozen"/> is false. /// </returns> protected virtual CompetitionOptions CreateCompetitionOptionsUnfrozen( [CanBeNull] ICustomAttributeProvider metadataSource, [NotNull] CompetitionFeatures competitionFeatures) { var result = new CompetitionOptions(DefaultCompetitionOptions); if (competitionFeatures.AnnotateSources) { result.Adjustments.AdjustMetrics = true; if (competitionFeatures.IgnoreExistingAnnotations) { result.Annotations.IgnoreExistingAnnotations = true; result.Annotations.PreviousRunLogUri = null; } else { result.Annotations.PreviousRunLogUri = competitionFeatures.PreviousRunLogUri; } } if (Debugger.IsAttached) { result.RunOptions.AllowDebugBuilds = true; } if (competitionFeatures.TroubleshootingMode) { result.RunOptions.AllowDebugBuilds = true; result.RunOptions.ReportWarningsAsErrors = false; result.RunOptions.DetailedLogging = true; } else if (competitionFeatures.ReportWarningsAsErrors) { result.RunOptions.ReportWarningsAsErrors = true; } if (competitionFeatures.ContinuousIntegrationMode) { result.RunOptions.ContinuousIntegrationMode = true; result.Annotations.LogAnnotations = true; result.Annotations.PreviousRunLogUri = null; result.Annotations.DontSaveUpdatedAnnotations = true; } return(result); }
/// <summary> /// Intended to be used when resetting a game, and only then. Lets us distinguish the files from each other when the backup is made. /// </summary> /// <param name="seed"></param> /// <param name="title"></param> /// <param name="pladetal"></param> /// <param name="resetTime"></param> public void Initialize(string seed, string title, int pladetal, DateTime resetTime) { //TODO: Refactor the contents of the intialize functions out into seperate functions for types of things that has to be initted, make it more clear _log.Info("Starting event object initialization..."); NumberBoard = new BingoNumberBoard(); NumberBoard.Initialize(); CompetitionList = new BindableCollection <CompetitionObject>(); BingoNumberQueue = new BindableCollection <BingoNumber>(); BnkOptions = new BankoOptions(); CmpOptions = new CompetitionOptions(); SInfo = new SeedInfo(seed); PInfo = new PlateInfo(); WindowSettings = new WinSettings(); EventTitle = title; PInfo.PlatesGenerated = pladetal; WindowSettings = new WinSettings(); _creationTime = DateTime.Now; NotifyOfPropertyChange(() => CreationTime); _initialised = true; IsBingoRunning = false; IsResat = true; ResetTime = resetTime; _log.Info("Event object initialization done."); PInfo.CardGenerator = new Generator(SInfo.Seed); TimeOpt = new TimerOptions(); LatestNumbersQueue = new BindableCollection <string>(); for (int i = 0; i < 10; i++) { LatestNumbersQueue.Add(""); } AvailableNumbersQueue = new BindableCollection <BingoNumber>(); for (int i = 1; i <= 90; i++) { BingoNumber j = new BingoNumber(); j.Value = i; AvailableNumbersQueue.Add(j); } }
public void Initialize(string seed, string title, int pladetal) { _log.Info("Starting event object initialization..."); NumberBoard = new BingoNumberBoard(); NumberBoard.Initialize(); CompetitionList = new BindableCollection <CompetitionObject>(); BingoNumberQueue = new BindableCollection <BingoNumber>(); BnkOptions = new BankoOptions(); CmpOptions = new CompetitionOptions(); SInfo = new SeedInfo(seed); PInfo = new PlateInfo(); WindowSettings = new WinSettings(); EventTitle = title; PInfo.PlatesGenerated = pladetal; PInfoText = "Antal plader: " + pladetal; SInfoText = "Seed: " + SInfo.Seed; _creationTime = DateTime.Now; NotifyOfPropertyChange(() => CreationTime); _initialised = true; IsBingoRunning = false; _log.Info("Event object initialization done."); PInfo.CardGenerator = new Generator(SInfo.Seed); TimeOpt = new TimerOptions(); LatestNumbersQueue = new BindableCollection <string>(); for (int i = 0; i < 10; i++) { LatestNumbersQueue.Add(""); } AvailableNumbersQueue = new BindableCollection <BingoNumber>(); for (int i = 1; i <= 90; i++) { BingoNumber j = new BingoNumber(); j.Value = i; AvailableNumbersQueue.Add(j); } }
public void Initialize(string seed, string title, int pladetal) { _log.Info("Starting event object initialization..."); _seedManipulated = false; _eventTitle = title; _originalSeed = seed; _platesGenerated = pladetal; _seed = GenerateSeedFromKeyword(_originalSeed); _creationTime = DateTime.Now; _bingoNumberBoard = new BingoNumberBoard(); _competitionList = new BindableCollection<CompetitionObject>(); _bingoNumberQueue = new BindableCollection<BingoNumber>(); BnkOptions = new BankoOptions(); CmpOptions = new CompetitionOptions(); VsOptions = new VisualsOptions(); for (int i = 1; i < 91; i++) { _bingoNumberQueue.Add(new BingoNumber(i)); } _initialised = true; worker.DoWork += worker_DoWork; worker.RunWorkerCompleted += worker_RunWorkerCompleted; _log.Info("Event object initialization done."); }