コード例 #1
0
		protected void HandleExplosiveNadeExploded(object sender, GrenadeEventArgs e)
		{
			if (!AnalyzePlayersPosition && !AnalyzeHeatmapPoint || !IsMatchStarted || e.ThrownBy == null) return;

			ExplosiveNadeExplodedEvent explosiveEvent = new ExplosiveNadeExplodedEvent(Parser.IngameTick)
			{
				Thrower = Demo.Players.FirstOrDefault(player => player.SteamId == e.ThrownBy.SteamID)
			};

			if (AnalyzeHeatmapPoint && explosiveEvent.Thrower != null)
			{
				explosiveEvent.Point = new HeatmapPoint
				{
					X = e.Position.X,
					Y = e.Position.Y,
					Player = explosiveEvent.Thrower,
					Team = e.ThrownBy.Team,
					Round = CurrentRound
				};
			}

			CurrentRound.ExplosiveGrenadesExploded.Add(explosiveEvent);

			if (AnalyzePlayersPosition && explosiveEvent.Thrower != null)
			{
				PositionPoint positionPoint = new PositionPoint
				{
					X = e.Position.X,
					Y = e.Position.Y,
					Player = Demo.Players.First(p => p.SteamId == e.ThrownBy.SteamID),
					Team = e.ThrownBy.Team,
					Event = explosiveEvent,
					Round = CurrentRound
				};
				Demo.PositionsPoint.Add(positionPoint);
			}
		}
コード例 #2
0
		protected void HandleExplosiveNadeExploded(object sender, GrenadeEventArgs e)
		{
			if (!AnalyzePlayersPosition && !AnalyzeHeatmapPoint || !IsMatchStarted || e.ThrownBy == null) return;
			PlayerExtended thrower = Demo.Players.FirstOrDefault(player => player.SteamId == e.ThrownBy.SteamID);
			ExplosiveNadeExplodedEvent explosiveEvent = new ExplosiveNadeExplodedEvent(Parser.IngameTick, Parser.CurrentTime)
			{
				ThrowerSteamId = thrower?.SteamId ?? 0,
				ThrowerName = thrower == null ? string.Empty : thrower.Name
			};

			if (AnalyzeHeatmapPoint && thrower != null)
			{
				explosiveEvent.Point = new HeatmapPoint
				{
					X = e.Position.X,
					Y = e.Position.Y,
					Player = thrower,
					Team = e.ThrownBy.Team,
					Round = CurrentRound
				};
			}

			CurrentRound.ExplosiveGrenadesExploded.Add(explosiveEvent);

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