Srd.Rules.Initiative (srd_5e v0.2.0)

Copy Markdown View Source

Initiative ordering.

Summary

Types

A combatant identifier paired with its initiative roll.

Functions

Order combatants by their initiative rolls, highest total first.

Types

entry()

@type entry() :: {term(), Srd.Dice.Roll.t()}

A combatant identifier paired with its initiative roll.

Functions

order(entries)

@spec order([entry()]) :: [entry()]

Order combatants by their initiative rolls, highest total first.

Ties keep their input order, so a caller can break ties by sorting the input by its own tiebreaker first; a stable sort preserves that order within a tie.