Exemplo n.º 1
0
		public void Reset(Battle b, Scenario s)
		{
			this.Battle = b.Id;
			this.Scenario = s.Id;
			this.Turn = 1;
			this.Phase = 0;
		}
Exemplo n.º 2
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);
		}
Exemplo n.º 3
0
		static void ReadXml (Stream strm)
		{
			XmlDocument d = new XmlDocument ();
			d.Load (strm);
				
			XmlNodeList nodes = d.SelectNodes("//Battles/Battle");
			foreach (XmlNode node in nodes)
			{
				Battle b = new Battle { 
					Id = Convert.ToInt32(node.SelectSingleNode("Id").InnerText), 
	                Name = node.SelectSingleNode("Name").InnerText, 
	                Publisher = node.SelectSingleNode("Publisher").InnerText, 
	                Sort = Convert.ToInt32(node.SelectSingleNode("Sort").InnerText)
	            };
				
				XmlNodeList snodes = node.SelectNodes("Scenarios/Scenario");
				foreach (XmlNode snode in snodes)
				{
					b.Scenarios.Add(new Scenario {
						Id = Convert.ToInt32(snode.SelectSingleNode("Id").InnerText), 
						Name = snode.SelectSingleNode("Name").InnerText, 
						StartYear  = Convert.ToInt32(snode.SelectSingleNode("StartYear").InnerText), 			
						StartMonth = Convert.ToInt32(snode.SelectSingleNode("StartMonth").InnerText), 
						StartDay  = Convert.ToInt32(snode.SelectSingleNode("StartDay").InnerText), 
						StartHour = Convert.ToInt32(snode.SelectSingleNode("StartHour").InnerText), 
						StartMinute = Convert.ToInt32(snode.SelectSingleNode("StartMinute").InnerText), 
						EndYear  = Convert.ToInt32(snode.SelectSingleNode("EndYear").InnerText), 
						EndMonth = Convert.ToInt32(snode.SelectSingleNode("EndMonth").InnerText), 
						EndDay  = Convert.ToInt32(snode.SelectSingleNode("EndDay").InnerText), 
						EndHour  = Convert.ToInt32(snode.SelectSingleNode("EndHour").InnerText), 
						EndMinute  = Convert.ToInt32(snode.SelectSingleNode("EndMinute").InnerText)
					});
				}
				
				battles.Add(b);
			}
		}