|
VoltMod
C++23 framework for CS2 server plugins
|
The game's yes/no vote panel (F1/F2), with the ballots counted here. More...
#include <Vote.hpp>
Public Member Functions | |
| Vote (Interfaces &interfaces, EntitySystem &entities, PlayerManager &players, GameEvents &events, Scheduler &scheduler) | |
| Vote (const Vote &)=delete | |
| Vote & | operator= (const Vote &)=delete |
| bool | Start (VoteRequest request) |
| void | End (VoteEndReason reason) |
| bool | InProgress () const |
| bool | TryCastBallot (int slot, std::string_view option) |
The game's yes/no vote panel (F1/F2), with the ballots counted here.
One vote at a time, open to every connected human; bots get no panel and no ballot. Callbacks run on the game thread.
| VoltMod::Vote::Vote | ( | Interfaces & | interfaces, |
| EntitySystem & | entities, | ||
| PlayerManager & | players, | ||
| GameEvents & | events, | ||
| Scheduler & | scheduler | ||
| ) |
All five must outlive this service; the Runtime declares them above it.
Definition at line 84 of file Vote.cpp.
References VoltMod::ReadFile().
| void VoltMod::Vote::End | ( | VoteEndReason | reason | ) |
End the running vote early. No-op when none is running.
Definition at line 205 of file Vote.cpp.
References VoltMod::ReadFile().
| bool VoltMod::Vote::Start | ( | VoteRequest | request | ) |
Open request's vote. False when one is already running, it has no VoteRequest::Passed, or no human is connected.
Definition at line 109 of file Vote.cpp.
References VoltMod::PlayerManager::All(), VoltMod::AllTeams, VoltMod::Scheduler::Delay(), VoltMod::IsValidSlot(), VoltMod::ReadFile(), and VoltMod::YesNoIssueIndex.
Definition at line 146 of file Vote.cpp.
References VoltMod::IsValidSlot(), VoltMod::NoOption, VoltMod::ReadFile(), and VoltMod::YesOption.