Esempio n. 1
0
		protected void HandleBombPlanted(object sender, BombEventArgs e)
		{
			if (!IsMatchStarted) return;

			BombPlantedEvent bombPlantedEvent = new BombPlantedEvent(Parser.IngameTick);
			if (e.Player.SteamID != 0)
			{
				PlayerExtended player = Demo.Players.FirstOrDefault(p => p.SteamId == e.Player.SteamID);
				if (player != null)
				{
					player.BombPlantedCount++;
					bombPlantedEvent.Player = player;
					bombPlantedEvent.X = e.Player.Position.X;
					bombPlantedEvent.Y = e.Player.Position.Y;
				}
			}
			bombPlantedEvent.Site = e.Site.ToString();
			Demo.BombPlanted.Add(bombPlantedEvent);
			CurrentRound.BombPlanted.Add(bombPlantedEvent);

			if (AnalyzePlayersPosition && bombPlantedEvent.Player != null)
			{
				PositionPoint positionPoint = new PositionPoint
				{
					X = Demo.BombPlanted.Last().X,
					Y = Demo.BombPlanted.Last().Y,
					Player = bombPlantedEvent.Player,
					Team = e.Player.Team,
					Event = bombPlantedEvent,
					Round = CurrentRound
				};
				Demo.PositionsPoint.Add(positionPoint);
			}
		}
Esempio n. 2
0
		protected void HandleBombPlanted(object sender, BombEventArgs e)
		{
			if (!IsMatchStarted || e.Player == null) return;

			BombPlantedEvent bombPlantedEvent = new BombPlantedEvent(Parser.IngameTick, Parser.CurrentTime)
			{
				PlanterSteamId = e.Player.SteamID,
				PlanterName = e.Player.Name,
				Site = e.Site.ToString(),
				X = e.Player.Position.X,
				Y = e.Player.Position.Y
			};

			if (e.Player.SteamID != 0)
			{
				PlayerExtended player = Demo.Players.FirstOrDefault(p => p.SteamId == e.Player.SteamID);
				if (player != null) player.BombPlantedCount++;
			}

			Demo.BombPlanted.Add(bombPlantedEvent);
			CurrentRound.BombPlanted = bombPlantedEvent;

			if (AnalyzePlayersPosition && e.Player.SteamID != 0)
			{
				PositionPoint positionPoint = new PositionPoint
				{
					X = e.Player.Position.X,
					Y = e.Player.Position.Y,
					PlayerSteamId = e.Player.SteamID,
					PlayerName = e.Player.Name,
					Team = e.Player.Team,
					Event = bombPlantedEvent,
					RoundNumber = CurrentRound.Number
				};
				Demo.PositionsPoint.Add(positionPoint);
			}
		}