Exemple #1
0
 public static void SaveGame(zipgame zip, String filename)
 {
     Stream s = File.Open(filename, FileMode.Create);
     BinaryFormatter binary = new BinaryFormatter();
     try
     {
         binary.Serialize(s, zip);
     }
     catch (Exception ex)
     {
         MessageBox.Show("Loi 7 :File khong the luu \n " + ex.Message);
     }
     s.Close();
     try
     {
         GC.Collect();
     }
     catch
     {
     }
 }
Exemple #2
0
 public zipgame SaveGame()
 {
     zipgame zip = new zipgame(KindGame,Information.CurrentKindGame,lifetime.Life, argument.Matrix,Level, Information.PokemonNumber, Score,argument.RemainPokemon,limittime.percent,HelpPokemonClick, RandomPokemonClick,SmartEye, timeplay.hour, timeplay.minute, timeplay.second);
     return zip;
 }
Exemple #3
0
 public void LoadGame(zipgame zip)
 {
     HideHelpEffect();
     ComebackDefault();
     KindGame = zip.kindgame;
     Information.CurrentKindGame = zip.sumfirstpokemon;
     argument.Matrix = zip.Matrix;
     Information.PokemonNumber = zip.number_pokemon;
     Information.CurrentKindGame = Information.defaultPokemonNumber + (KindGame - 1) * 6;
     Score = zip.score;
     argument.RemainPokemon = zip.Remainpokemon;
     limittime.percent = zip.percent;
     percent = limittime.percent;
     timeplay.hour = zip.hour;
     timeplay.minute = zip.minute;
     timeplay.second = zip.second;
     Level = zip.level;
     HelpPokemonClick = zip.helpclick;
     RandomPokemonClick = zip.randomclick;
     lifetime.Life = zip.Lifetime;
     lifetime.Invalidate();
     SmartEye = zip.smarteye;
     templateScreen.Show();
     InitialImage();
     time.Start();
     ListHelp = argument.FindCouple();
     Information.Level = Level;
     limittime.UpdatePercent();
     limittime.updateTime();
     PieceUpdate();
     templateScreen.Hide();
     draw = true;
     argument.Level = Level;
     this.Invalidate();
 }