Example #1
0
 public void SaveScore(int score)
 {
     var date = DateTime.Now;
     if (_recordManager == null)
     {
         _recordManager = RecordManager.Load();
     }
     _recordManager.Records.Add(new Record(score, date));
 }
Example #2
0
        public PracticeHistoryScreen()
            : base("Practice History")
        {
            MenuPosition = new Vector2(0.125f, 0.8f);

            _back.OnSelected += (sender, args) => CancelScreen();

            MenuItems.AddItems(_back);

            _recordManager = RecordManager.Load();
        }
Example #3
0
        public static RecordManager Load()
        {
            var rm = new RecordManager();

            if (File.Exists(FileName))
            {
                var bf = new BinaryFormatter();
                var fs = new FileStream(FileName, FileMode.Open);
                rm.Records = (List <Record>)bf.Deserialize(fs);
                fs.Close();
            }

            return(rm);
        }
Example #4
0
        public static RecordManager Load()
        {
            var rm = new RecordManager();

            if (File.Exists(FileName))
            {
                var bf = new BinaryFormatter();
                var fs = new FileStream(FileName, FileMode.Open);
                rm.Records = (List<Record>) bf.Deserialize(fs);
                fs.Close();
            }

            return rm;
        }