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
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user