Esempio n. 1
0
		public Bullet(Robot pAttacker, double dPower, double dVelocity)
		{
			m_nHeading = pAttacker.Heading;
			m_pAttacker = pAttacker;
			m_dPower = dPower;
			m_dVelocity = dVelocity;
			m_tPosition = pAttacker.Position;
			m_bIsActive = true;
			m_pVictim = null;
		}
Esempio n. 2
0
		public Results(Robot[] pWinnerRobots)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			int nLength = pWinnerRobots.Length;
			ArrayList pWinnersTemp = new ArrayList();
			Winner[] pWinners = new Winner[nLength];
			for (int i = 0; i < nLength; i++)
			{
				bool bContinue = false;
				for (int j = 0; j < pWinnersTemp.Count; j++)
				{
					if (((Winner) pWinnersTemp[j]).Name == pWinnerRobots[i].Name)
					{
						((Winner) pWinnersTemp[j]).Wins++;
						bContinue = true;
						continue;
					}
				}
				if (bContinue) continue;
				Winner pWinner = new Winner();
				pWinner.Name = pWinnerRobots[i].Name;
				pWinner.Wins = 1;
				pWinnersTemp.Add(pWinner);
			}

			nLength = pWinnersTemp.Count;
			for (int i = 0; i < nLength; i++)
			{
				ListViewItem pItem = new ListViewItem(((Winner) pWinnersTemp[i]).Name);
				pItem.SubItems.Add(((Winner) pWinnersTemp[i]).Wins.ToString());
				listView1.Items.Add(pItem);
			}
			listView1.Sort();
		}