IGhostRoleRaffleDecider.cs 1.3 KB

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