fish-station/Content.Server/_Sunrise/RoundEndVote/RoundEndVoteSystem.cs
Vigers Ray eef1472e53
Секрет в голосовании за карту. Автоматическое голосование в конце раунда (#36)
* Секрет в голосовании за карту

* Автоматическое голосование за карту в конце раунда

* чейнжлог
2024-06-07 11:25:19 +03:00

30 lines
931 B
C#

using Content.Server.GameTicking;
using Content.Server.RoundEnd;
using Content.Server.Voting.Managers;
using Content.Shared.Voting;
namespace Content.Server._Sunrise.RoundEndVote;
public sealed class RoundEndVoteSystem : EntitySystem
{
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly IVoteManager _voteManager = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RoundEndSystemChangedEvent>(OnRoundEndSystemChange);
}
private void OnRoundEndSystemChange(RoundEndSystemChangedEvent args)
{
if (_gameTicker.RunLevel != GameRunLevel.PreRoundLobby)
return;
// Очень жаль
//_voteManager.CreateStandardVote(null, StandardVoteType.Preset);
_voteManager.CreateStandardVote(null, StandardVoteType.Map);
_gameTicker.SetGamePreset("Secret");
}
}