| 27 | } |
| 28 | |
| 29 | void ABlasterGameMode::Tick(float DeltaTime) |
| 30 | { |
| 31 | Super::Tick(DeltaTime); |
| 32 | |
| 33 | if (MatchState == MatchState::WaitingToStart) |
| 34 | { |
| 35 | CountdownTime = WarmupTime - GetWorld()->GetTimeSeconds() + LevelStartingTime; |
| 36 | if (CountdownTime <= 0.f) |
| 37 | { |
| 38 | StartMatch(); |
| 39 | } |
| 40 | } |
| 41 | else if (MatchState == MatchState::InProgress) |
| 42 | { |
| 43 | CountdownTime = WarmupTime + MatchTime - GetWorld()->GetTimeSeconds() + LevelStartingTime; |
| 44 | if (CountdownTime <= 0.f) |
| 45 | { |
| 46 | SetMatchState(MatchState::Cooldown); |
| 47 | } |
| 48 | } |
| 49 | else if (MatchState == MatchState::Cooldown) |
| 50 | { |
| 51 | CountdownTime = CooldownTime + WarmupTime + MatchTime - GetWorld()->GetTimeSeconds() + LevelStartingTime; |
| 52 | if (CountdownTime <= 0.f) |
| 53 | { |
| 54 | RestartGame(); |
| 55 | } |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | void ABlasterGameMode::OnMatchStateSet() |
| 60 | { |
nothing calls this directly
no outgoing calls
no test coverage detected