VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::Rounds Class Reference

runtime.Rounds: the running round's timer, and ending the round with the engine's own win panel and round_end, even with mp_ignore_round_win_conditions on. Team scores are not changed. More...

#include <Rounds.hpp>

Public Member Functions

 Rounds (EntitySystem &entities, const Bindings &bindings, const Clock &clock)
 
 Rounds (const Rounds &)=delete
 
Rounds & operator= (const Rounds &)=delete
 
Status Available () const
 
Status End (RoundEndReason reason, float delaySeconds) const
 
Status SetTime (int seconds) const
 
std::optional< float > TimeLeft () const
 

Detailed Description

runtime.Rounds: the running round's timer, and ending the round with the engine's own win panel and round_end, even with mp_ignore_round_win_conditions on. Team scores are not changed.

runtime.Rounds.SetTime(45 * 60);
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56

Game-thread only.

Definition at line 32 of file Rounds.hpp.

Constructor & Destructor Documentation

◆ Rounds() [1/2]

VoltMod::Rounds::Rounds ( EntitySystem &  entities,
const Bindings &  bindings,
const Clock &  clock 
)
inline

All three must outlive this service.

Definition at line 36 of file Rounds.hpp.

◆ Rounds() [2/2]

VoltMod::Rounds::Rounds ( const Rounds &  )
delete

Member Function Documentation

◆ Available()

Status VoltMod::Rounds::Available ( ) const

Whether End works: unsupported when the TerminateRound signature did not bind.

Definition at line 20 of file Rounds.cpp.

References VoltMod::Bindings::TerminateRound, and VoltMod::Error::Unsupported().

Referenced by End().

◆ End()

Status VoltMod::Rounds::End ( RoundEndReason  reason,
float  delaySeconds 
) const

End the round for reason; the next one starts after delaySeconds.

Returns
Error::NotReady when no map is running.

Definition at line 29 of file Rounds.cpp.

References Available(), VoltMod::GameRules(), VoltMod::NoGameRules(), VoltMod::ReadFile(), and VoltMod::Bindings::TerminateRound.

◆ operator=()

Rounds & VoltMod::Rounds::operator= ( const Rounds &  )
delete

◆ SetTime()

Status VoltMod::Rounds::SetTime ( int  seconds) const

Sets the running round to last seconds from its start, whatever mp_roundtime says; the round timer shows it at once. The next round starts from mp_roundtime again.

Returns
Error::NotReady when no map is running.

Definition at line 45 of file Rounds.cpp.

References VoltMod::GameRules(), VoltMod::NoGameRules(), and VoltMod::ReadFile().

◆ TimeLeft()

std::optional< float > VoltMod::Rounds::TimeLeft ( ) const

Seconds until the round timer runs out, below 0 once it has; empty when no map is running.

Definition at line 56 of file Rounds.cpp.

References VoltMod::GameRules(), VoltMod::ReadFile(), and VoltMod::Clock::Time().


The documentation for this class was generated from the following files: