Example #1
0
 internal void RaiseFireEnd(FireEventArgs args)
 {
     if (FireNadeEnded != null)
     {
         FireNadeEnded(this, args);
     }
 }
Example #2
0
        internal void RaiseFireStart(FireEventArgs args)
        {
            if (FireNadeStarted != null)
            {
                FireNadeStarted(this, args);
            }

            if (NadeReachedTarget != null)
            {
                NadeReachedTarget(this, args);
            }
        }
Example #3
0
		internal void RaiseFireEnd(FireEventArgs args)
		{
			if (FireNadeEnded != null)
				FireNadeEnded(this, args);
		}
Example #4
0
		internal void RaiseFireStart(FireEventArgs args)
		{
			if (FireNadeStarted != null)
				FireNadeStarted(this, args);

			if (NadeReachedTarget != null)
				NadeReachedTarget(this, args);
		}
Example #5
0
		protected void HandleFireNadeEnded(object sender, FireEventArgs e)
		{
			if (!AnalyzePlayersPosition || !IsMatchStarted) return;

			switch (e.NadeType)
			{
				case EquipmentElement.Incendiary:
				case EquipmentElement.Molotov:
					MolotovFireEndedEvent molotovEvent = new MolotovFireEndedEvent(Parser.IngameTick)
					{
						Point = new HeatmapPoint
						{
							X = e.Position.X,
							Y = e.Position.Y
						}
					};

					PlayerExtended thrower = null;

					// Thrower is not indicated every time
					if (e.ThrownBy != null)
					{
						thrower = Demo.Players.FirstOrDefault(player => player.SteamId == e.ThrownBy.SteamID);
					}

					if (LastPlayersFireStartedMolotov.Any())
					{
						LastPlayersFireEndedMolotov.Enqueue(LastPlayersFireStartedMolotov.Peek());
						// Remove the last player who started a fire
						thrower = LastPlayersFireStartedMolotov.Dequeue();
					}

					molotovEvent.Thrower = thrower;
					CurrentRound.MolotovsThrowed.Add(molotovEvent);

					PositionPoint positionPoint = new PositionPoint
					{
						X = e.Position.X,
						Y = e.Position.Y,
						Player = thrower,
						Team = thrower?.Team ?? Team.Spectate,
						Event = molotovEvent,
						Round = CurrentRound
					};
					Demo.PositionsPoint.Add(positionPoint);
					
					break;
			}
		}
		protected void HandleFireNadeStarted(object sender, FireEventArgs e)
		{
			if (!AnalyzePlayersPosition && !AnalyzeHeatmapPoint || !IsMatchStarted) return;

			switch (e.NadeType)
			{
				case EquipmentElement.Incendiary:
				case EquipmentElement.Molotov:
					MolotovFireStartedEvent molotovEvent = new MolotovFireStartedEvent(Parser.IngameTick, Parser.CurrentTime);
					PlayerExtended thrower = null;
					
					if (e.ThrownBy != null)
					{
						thrower = Demo.Players.First(p => p.SteamId == e.ThrownBy.SteamID);
					}

					if (AnalyzePlayersPosition || AnalyzeHeatmapPoint && LastPlayersThrownMolotov.Any())
					{
						LastPlayersFireStartedMolotov.Enqueue(LastPlayersThrownMolotov.Peek());
						// Remove the last player who thrown a molo
						thrower = LastPlayersThrownMolotov.Dequeue();
					}

					if (thrower != null)
					{
						molotovEvent.ThrowerSteamId = thrower.SteamId;
						molotovEvent.ThrowerName = thrower.Name;

						if (AnalyzePlayersPosition)
						{
							PositionPoint positionPoint = new PositionPoint
							{
								X = e.Position.X,
								Y = e.Position.Y,
								PlayerSteamId = thrower.SteamId,
								PlayerName = thrower.Name,
								Team = thrower.Side,
								Event = molotovEvent,
								RoundNumber = CurrentRound.Number
							};
							Demo.PositionsPoint.Add(positionPoint);
						}
					}

					if (AnalyzeHeatmapPoint)
					{
						molotovEvent.Point = new HeatmapPoint
						{
							X = e.Position.X,
							Y = e.Position.Y,
							Player = thrower,
							Team = thrower?.Side ?? Team.Spectate,
							Round = CurrentRound
						};
						Demo.MolotovFireStarted.Add(molotovEvent);
					}
					
					break;
			}
		}