Files
tbd-station-14/Content.Server/Ghost/Roles/Raffles/IGhostRoleRaffleDecider.cs
no 630a7a78ed Add ghost role raffles (#26629)
* Add ghost role raffles

* GRR: Fix dialogue sizing, fix merge

* GRR: Add raffle deciders (winner picker)

* GRR: Make settings prototype based with option to override

* GRR: Use Raffles folder and namespace

* GRR: DataFieldify and TimeSpanify

* GRR: Don't actually DataFieldify HashSet<ICommonSession>s

* GRR: add GetGhostRoleCount() + docs

* update engine on branch

* Ghost role raffles: docs, fix window size, cleanup, etc

* GRR: Admin UI

* GRR: Admin UI: Display initial/max/ext of selected raffle settings proto

* GRR: Make a ton of roles raffled
2024-05-06 18:48:16 -07:00

29 lines
1.3 KiB
C#

using Robust.Shared.Player;
namespace Content.Server.Ghost.Roles.Raffles;
/// <summary>
/// Chooses a winner of a ghost role raffle.
/// </summary>
[ImplicitDataDefinitionForInheritors]
public partial interface IGhostRoleRaffleDecider
{
/// <summary>
/// Chooses a winner of a ghost role raffle draw from the given pool of candidates.
/// </summary>
/// <param name="candidates">The players in the session at the time of drawing.</param>
/// <param name="tryTakeover">
/// Call this with the chosen winner as argument.
/// <ul><li>If <c>true</c> is returned, your winner was able to take over the ghost role, and the drawing is complete.
/// <b>Do not call <see cref="tryTakeover"/> again after true is returned.</b></li>
/// <li>If <c>false</c> is returned, your winner was not able to take over the ghost role,
/// and you must choose another winner, and call <see cref="tryTakeover"/> with the new winner as argument.</li>
/// </ul>
///
/// If <see cref="tryTakeover"/> is not called, or only returns false, the raffle will end without a winner.
/// Do not call <see cref="tryTakeover"/> with the same player several times.
/// </param>
void PickWinner(IEnumerable<ICommonSession> candidates, Func<ICommonSession, bool> tryTakeover);
}