using System.Diagnostics.CodeAnalysis;
using Content.Shared.Voting;
using Robust.Shared.Player;
namespace Content.Server.Voting.Managers
{
///
/// Manages in-game votes that players can vote on.
///
public interface IVoteManager
{
///
/// All votes that are currently active and can be voted on by players.
///
IEnumerable ActiveVotes { get; }
///
/// Try to get a vote handle by integer ID.
///
///
/// Only votes that are currently active can be retrieved.
///
/// The integer ID of the vote, corresponding to .
/// The vote handle, if found.
/// True if the vote was found and it was returned, false otherwise.
bool TryGetVote(int voteId, [NotNullWhen(true)] out IVoteHandle? vote);
///
/// Check if a player can initiate a vote right now. Optionally of a specified standard type.
///
///
/// Players cannot start votes if they have made another vote recently,
/// or if the specified vote type has been made recently.
///
/// The player to check.
///
/// The standard vote type to check cooldown for.
/// Null to only check timeout for all vote types for the specified player.
///
///
/// True if can start votes right now,
/// and if provided if they can start votes of type .
///
bool CanCallVote(ICommonSession initiator, StandardVoteType? voteType = null);
///
/// Initiate a standard vote such as restart round, that can be initiated by players.
///
///
/// The player that called the vote.
/// If null it is assumed to be an automatic vote by the server.
///
/// The type of standard vote to make.
void CreateStandardVote(ICommonSession? initiator, StandardVoteType voteType, string[]? args = null);
///
/// Create a non-standard vote with special parameters.
///
/// The options specifying the vote's behavior.
/// A handle to the created vote.
IVoteHandle CreateVote(VoteOptions options);
void Initialize();
void Update();
}
}