Exemple #1
0
		public Game(Battle battle, Scenario scenario, Lb saved)
		{
			this.Battle = battle;
			this.Scenario = scenario;
			_saved = saved;
			if (_saved.Battle != battle.Id || _saved.Scenario != scenario.Id)
				_saved.Reset(battle, scenario);
		}
		public static Lb GetLb()
		{
			if (lb == null)
			{
				lb = new Lb();
			}
			return lb;
		}
		static void ReadXml ()
		{
			if (File.Exists (storeLocation)) {
				var serializer = new XmlSerializer (typeof(Lb));
				using (var stream = new FileStream (storeLocation, FileMode.Open)) {
					lb = (Lb)serializer.Deserialize (stream);
				}
			}
		}
		public static void SaveLb(Lb saved)
		{ 
			if (saved != null)
				lb = saved;
			WriteXml ();
		}