Beispiel #1
0
		public void CreateBattle(RobotListItem[] pRobots, int nNumRounds)
		{
			m_pBattle = new Battle(this, pnlBattleGround.ClientSize, pRobots, nNumRounds);

			for (int i = 0; i < m_pBattle.Robots.Length; i++)
			{
				cboRobots.Items.Add(m_pBattle.Robots[i].Name);
			}
			cboRobots.SelectedIndex = 0;
		}
Beispiel #2
0
		private void ProcessFrame()
		{
			if (!m_bPaused && m_pBattle != null)
			{
				if (m_pBattle.ProcessFrame())
				{
					pnlBattleGround.Robots = m_pBattle.Robots;
					pnlBattleGround.Refresh();
					try
					{
						pgrRobotDetails.Refresh();
					}
					catch (InvalidOperationException) {}
				}
				else
				{
					Results pForm = new Results(m_pBattle.Winners);
					pForm.ShowDialog(this);
					m_pBattle = null;
				}
			}
		}
Beispiel #3
0
		internal void Initialize(Battle pBattle, PointD tPosition, int nHeading, string sName, Graphics pGraphics)
		{
			m_pGraphics = pGraphics;
			m_sName = sName;

			m_pBaseBitmap = new Bitmap(@"images\tankbase.bmp");
			m_pGunBitmap = new Bitmap(@"images\tankgun.bmp");
			m_pGunBitmap.MakeTransparent(Color.White);

			m_pBattle = pBattle;
			m_tPosition = tPosition;
			m_nHeading = m_nGunHeading = m_nRadarHeading = nHeading;
		}