public void Write(BinaryWriter writer)
 {
     SaveSerializer.Write(
         writer,
         this,
         SaveSerialization.ExplicitTypes);
 }
Exemple #2
0
    //save zapisany do player pref
    public void Save(EndlessBitDefense.GameManager gameManager, MapManager mapManager)
    {
        //DeleteSaveData();

        state.money      = gameManager.GetMoney();
        state.waveNumber = gameManager.waveNumber;
        state.SetMapTiles(mapManager.GetMapTiles());

        PlayerPrefs.SetString("save", SaveSerializer.Serialize <SaveState>(state));
    }
Exemple #3
0
 public bool Load()
 {
     if (PlayerPrefs.HasKey("save"))
     {
         state = SaveSerializer.Deserialize <SaveState>(PlayerPrefs.GetString("save"));
         return(true);
     }
     else
     {
         state = new SaveState();
         return(false);
     }
 }
Exemple #4
0
 public void SaveActivities()
 {
     try
     {
         if (JsonParser.SaveToJson(SaveSerializer.Serialize(this.Activities), "activities.json"))
         {
             MessageBox.Show("Activities saved successfuly");
         }
     }
     catch (Exception e)
     {
         MessageBox.Show("Saving problem occured: " + e.Message);
     }
 }
 public void Read(BinaryReader reader)
 {
     SaveSerializer.Read(
         reader,
         this);
 }