Beispiel #1
0
 internal void RaiseBombAbortPlant(BombEventArgs args)
 {
     if (BombAbortPlant != null)
     {
         BombAbortPlant(this, args);
     }
 }
Beispiel #2
0
 internal void RaiseBombExploded(BombEventArgs args)
 {
     if (BombExploded != null)
     {
         BombExploded(this, args);
     }
 }
Beispiel #3
0
		internal void RaiseBombExploded(BombEventArgs args)
		{
			if (BombExploded != null)
				BombExploded(this, args);
		}
Beispiel #4
0
		internal void RaiseBombAbortPlant(BombEventArgs args)
		{
			if (BombAbortPlant != null)
				BombAbortPlant(this, args);
		}
		protected void HandleBombExploded(object sender, BombEventArgs e)
		{
			if (!IsMatchStarted) return;

			BombExplodedEvent bombExplodedEvent = new BombExplodedEvent(Parser.IngameTick)
			{
				Site = e.Site.ToString()
			};

			if (e.Player != null) bombExplodedEvent.Player = Demo.Players.FirstOrDefault(p => p.SteamId == e.Player.SteamID);

			Demo.BombExploded.Add(bombExplodedEvent);
			CurrentRound.BombExploded.Add(bombExplodedEvent);

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

			BombDefusedEvent bombDefusedEvent = new BombDefusedEvent(Parser.IngameTick);
			if (e.Player.SteamID != 0)
			{
				PlayerExtended player = Demo.Players.FirstOrDefault(p => p.SteamId == e.Player.SteamID);
				if (player != null)
				{
					player.BombDefusedCount++;
					bombDefusedEvent.Player = player;
				}
			}
			Demo.BombDefused.Add(bombDefusedEvent);
			CurrentRound.BombDefused.Add(bombDefusedEvent);

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

			BombExplodedEvent bombExplodedEvent = new BombExplodedEvent(Parser.IngameTick, Parser.CurrentTime)
			{
				Site = e.Site.ToString(),
				PlanterSteamId = e.Player.SteamID,
				PlanterName = e.Player.Name
			};

			PlayerExtended planter = Demo.Players.FirstOrDefault(p => p.SteamId == e.Player.SteamID);
			if (planter != null) planter.BombExplodedCount++;

			Demo.BombExploded.Add(bombExplodedEvent);
			CurrentRound.BombExploded = bombExplodedEvent;

			if (AnalyzePlayersPosition && planter != null)
			{
				PositionPoint positionPoint = new PositionPoint
				{
					X = Demo.BombPlanted.Last().X,
					Y = Demo.BombPlanted.Last().Y,
					PlayerSteamId = e.Player.SteamID,
					PlayerName = e.Player.Name,
					Team = e.Player.Team,
					Event = bombExplodedEvent,
					RoundNumber = CurrentRound.Number
				};
				Demo.PositionsPoint.Add(positionPoint);
			}
		}