You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Projet_IHM/Sources/Stim.Model/Manager.cs

29 lines
689 B

using System.Collections.ObjectModel;
namespace Model
{
public class Manager
{
public IPersistance _persistance;
public ObservableCollection<Game> GameList { get;}
public Manager(IPersistance persistance)
{
_persistance = persistance;
GameList = persistance.LoadGame();
}
public void AddGametoGamesList(Game game)
{
GameList.Add(game);
_persistance.SaveGame(GameList);
}
public void RemoveGameFromGamesList(Game game)
{
GameList.Remove(game);
_persistance.SaveGame(GameList);
}
}
}