/// <summary> /// Constructor. /// </summary> public GetPlayerScreen() { TransitionOnTime = TimeSpan.FromSeconds(0.5); TransitionOffTime = TimeSpan.FromSeconds(0.5); _controls = new List<Control>(); _fm = new FileManager(); _list = new HighscoreList(); }
public List(Texture2D texture, Vector2 position, string text) : base(position) { base.Text = text; _texture = texture; _fm = new FileManager(); _list = _fm.LoadHighscoreList(); _bounds = new Rectangle((int)position.X, (int)position.Y, texture.Width, texture.Height); }
public void SaveHighscoreList(string name, int score) { HighscoreList list = new HighscoreList(); list.LoadHighscores(); var ordered = list.GetEntries().OrderBy(x => x.Score); foreach (Entry item in list.GetEntries()) { if (item.Score < score) { item.Name = name; item.Score = score; break; } } list.SaveHighscores(); }
public HighscoreList LoadHighscoreList() { HighscoreList list = new HighscoreList(); list.LoadHighscores(); return list; }
public bool IsNewRecord(int score) { HighscoreList list = new HighscoreList(); list.LoadHighscores(); return list.GetEntries().Min(x => x.Score) < score; }