Example #1
0
		private void mapControl1_PlanetSelected(object sender, PlanetEventArgs e)
		{
			label1.Text = e.Selected.Name;
			textBox1.Text = (e.Selected.Owner == null ? "Neutral" : e.Selected.Owner.Name);
			textBox2.Text = "N/A"; // e.Selected.Ships;
			textBox3.Text = e.Selected.ProductionRate.ToString();
			textBox4.Text = e.Selected.DefenceRate.ToString();
		}
Example #2
0
		private void CellSelected()
		{
			PlanetEventArgs e;
			IEnumerable<Planet> pe = Planets.Where(pl => pl.GridReference.X == SelectedGrid.X && pl.GridReference.Y == SelectedGrid.Y);

			if( PlanetSelected != null && pe.Count() > 0 )
			{
				e = new PlanetEventArgs(pe.First());
				PlanetSelected(this, e);
			}
		}