export const GroupOptions = Object.freeze({
  Drop: 'd',
  DropLow: 'dl',
  DropHigh: 'dh',
  Keep: 'k',
  KeepLow: 'kl',
  KeepHigh: 'kh',
  SuccessLt: '<',
  SuccessGtr: '>',
  SuccessEqu: '=',
  Fail: 'f',
  FailLt: 'f<',
  FailGtr: 'f>',
  FailEqu: 'f=',
});

export const DiceOptions = Object.freeze({
  ...GroupOptions,
  Reroll: 'r',
  RerollLt: 'r<',
  RerollGtr: 'r>',
  RerollEqu: 'r=',
  RerollOnce: 'ro',
  RerollOnceLt: 'ro<',
  RerollOnceGtr: 'ro>',
  RerollOnceEqu: 'ro=',
  CritSuccess: 'cs',
  CritSuccessLt: 'cs<',
  CritSuccessGtr: 'cs>',
  CritSuccessEqu: 'cs=',
  CritFail: 'cf',
  CritFailLt: 'cf<',
  CritFailGtr: 'cf>',
  CritFailEqu: 'cf=',
  Exploding: '!',
  ExplodingLt: '!<',
  ExplodingGtr: '!>',
  ExplodingEqu: '!=',
  ExplodeOnce: '!o',
  ExplodeOnceLt: '!o<',
  ExplodeOnceGtr: '!o>',
  ExplodeOnceEqu: '!o=',
  PenetratingExplosion: '!p',
  PenetratingExplosionLt: '!p<',
  PenetratingExplosionGtr: '!p>',
  PenetratingExplosionEqu: '!p=',
  CompoundingExplosion: '!!',
  CompoundingExplosionLt: '!!<',
  CompoundingExplosionGtr: '!!>',
  CompoundingExplosionEqu: '!!=',
  Matching: 'm',
  MatchingTotal: 'mt',
  Sort: 's',
  SortAsc: 'sa',
  SortDesc: 'sd',
});

// Should be ordered such that 'mt' will be encountered before 'm'
export const NumberlessDiceOptions = [
  DiceOptions.SortDesc,
  DiceOptions.SortAsc,
  DiceOptions.Sort,
  DiceOptions.MatchingTotal,
  DiceOptions.Matching,
  DiceOptions.CompoundingExplosion,
  DiceOptions.PenetratingExplosion,
  DiceOptions.ExplodeOnce,
  DiceOptions.Exploding,
];
