public void Save()
        {
            GameBank bank     = new GameBank();
            int      lastGame = -1;
            int      curr     = 0;

            foreach (KeyValuePair <string, IGame> pair in ExistingGames)
            {
                if (pair.Value == CurrentGame)
                {
                    lastGame = curr;
                }
                bank.Games.Add(new GameItem()
                {
                    Game          = pair.Value.InternalName,
                    InternalTitle = pair.Key,
                    LastActivity  = pair.Value.Data.LastActivity
                });
                pair.Value.Save(Storage);
                curr++;
            }
            bank.LastGame = lastGame;
            Storage.Write(GamesFolder + "games", bank);
        }
Exemple #2
0
 public void Save(IStructuredStorage storage)
 {
     storage.Write(MainFile, GameData);
 }