Esempio n. 1
0
 /// <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);
     }
 }
Esempio n. 2
0
 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);
     }
 }